[Git][java-team/cmlxom][upstream] New upstream version 4.17

Andrius Merkys (@merkys) gitlab at salsa.debian.org
Tue May 5 08:05:03 BST 2026



Andrius Merkys pushed to branch upstream at Debian Java Maintainers / cmlxom


Commits:
ea3b91c8 by Andrius Merkys at 2026-05-05T02:37:30-04:00
New upstream version 4.17
- - - - -


6 changed files:

- CITATION.cff
- README.md
- pom.xml
- + src/test/java/org/xmlcml/euclid/test/DoubleTestBase.java
- + src/test/java/org/xmlcml/euclid/test/EuclidTestBase.java
- + src/test/java/org/xmlcml/euclid/test/StringTestBase.java


Changes:

=====================================
CITATION.cff
=====================================
@@ -1,8 +1,8 @@
 cff-version: 1.2.0
 message: "If you use this software, please cite it as below."
 title: CMLXOM
-version: 4.16
-date-released: 2026-04-12
+version: 4.17
+date-released: 2026-04-18
 url: "https://github.com/BlueObelisk/cmlxom"
 preferred-citation:
   type: article


=====================================
README.md
=====================================
@@ -12,7 +12,7 @@ implementing the XML object model (XOM) for the Chemical Markup Language (CML).
 Instructions to increase the version:
 
 ```shell
-mvn versions:set -DnewVersion=4.17-SNAPSHOT
+mvn versions:set -DnewVersion=4.18-SNAPSHOT
 ```
 
 Deploy to Sonatype with the following commands, for snapshots and releases respectively:


=====================================
pom.xml
=====================================
@@ -5,7 +5,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.blueobelisk</groupId>
 	<artifactId>cmlxom</artifactId>
-	<version>4.16</version>
+	<version>4.17</version>
 	<packaging>jar</packaging>
 	<name>CMLXOM</name>
 	<description>A Java library for processing CML</description>
@@ -371,7 +371,7 @@
 		<dependency>
 			<groupId>org.blueobelisk</groupId>
 			<artifactId>euclid</artifactId>
-			<version>2.15</version>
+			<version>2.16</version>
 		</dependency>
 		<dependency>
 			<groupId>xom</groupId>


=====================================
src/test/java/org/xmlcml/euclid/test/DoubleTestBase.java
=====================================
@@ -0,0 +1,189 @@
+/**
+ *    Copyright 2011 Peter Murray-Rust
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+package org.xmlcml.euclid.test;
+
+import org.junit.Assert;
+
+/**
+ * 
+ * <p>
+ * superclass for manage common methods for unit tests
+ * </p>
+ * 
+ * @author Peter Murray-Rust
+ * @version 5.0
+ * 
+ */
+public class DoubleTestBase {
+
+	//constants
+	static String S_SLASH = "/";
+	static String S_RBRAK = ")";
+
+	/**
+	 * Asserts equality of double arrays.
+	 * 
+	 * checks for non-null, then equality of length, then individual elements
+	 * 
+	 * @param message
+	 * @param expected
+	 *            expected array
+	 * @param actual
+	 *            actual array
+	 * @param eps
+	 *            tolerance for agreement
+	 */
+	public static void assertEquals(String message, double[] expected, double[] actual,
+			double eps) {
+		String s = testEquals(expected, actual, eps);
+		if (s != null) {
+			Assert.fail(message + "; " + s);
+		}
+	}
+
+	
+	
+	private static boolean isEqual(double a, double b, double epsilon) {
+		return Math.abs(a - b) < epsilon;
+	}
+	
+    @SuppressWarnings("unused")
+	private static boolean isEqual(double[] a, double[] b, double epsilon) {
+        if (a == null || b == null || a.length != b.length) {
+            return false;
+        }
+        for (int i = 0; i < a.length; i++) {
+            if (!isEqual(a[i], b[i], epsilon))
+                return false;
+        }
+        return true;
+    }
+	
+	public static void assertObjectivelyEquals(String message, double[] a,
+			double[] b, double eps) {
+		String s = null;
+		if (a == null) {
+			s = "a is null";
+		} else if (b == null) {
+			s = "b is null";
+		} else if (a.length != b.length) {
+			s = "unequal arrays: " + a.length + S_SLASH + b.length;
+		} else {
+			for (int i = 0; i < a.length; i++) {
+				if ( !isEqual(a[i], b[i],
+						eps)) {
+					s = "unequal element at (" + i + "), " + a[i] + " != "
+							+ b[i];
+					break;
+				}
+			}
+		}
+		if (s != null) {
+			Assert.fail(message + "; " + s);
+		}
+	}
+
+	/**
+	 * Asserts non equality of double arrays.
+	 * 
+	 * checks for non-null, then equality of length, then individual elements
+	 * 
+	 * @param message
+	 * @param a
+	 *            expected array
+	 * @param b
+	 *            actual array
+	 * @param eps
+	 *            tolerance for agreement
+	 */
+	public static void assertNotEquals(String message, double[] a, double[] b,
+			double eps) {
+		String s = testEquals(a, b, eps);
+		if (s == null) {
+			Assert.fail(message + "; arrays are equal");
+		}
+	}
+
+	/**
+	 * returns a message if arrays differ.
+	 * 
+	 * @param a
+	 *            array to compare
+	 * @param b
+	 *            array to compare
+	 * @param eps
+	 *            tolerance
+	 * @return null if arrays are equal else indicative message
+	 */
+	static String testEquals(double[] a, double[] b, double eps) {
+		String s = null;
+		if (a == null) {
+			s = "a is null";
+		} else if (b == null) {
+			s = "b is null";
+		} else if (a.length != b.length) {
+			s = "unequal arrays: " + a.length + S_SLASH + b.length;
+		} else {
+			for (int i = 0; i < a.length; i++) {
+				if (!isEqual(a[i], b[i], eps)) {
+					s = "unequal element at (" + i + "), " + a[i] + " != "
+							+ b[i];
+					break;
+				}
+			}
+		}
+		return s;
+	}
+
+	/**
+	 * returns a message if arrays of arrays differ.
+	 * 
+	 * @param a
+	 *            array to compare
+	 * @param b
+	 *            array to compare
+	 * @param eps
+	 *            tolerance
+	 * @return null if array are equal else indicative message
+	 */
+	static String testEquals(double[][] a, double[][] b, double eps) {
+		String s = null;
+		if (a == null) {
+			s = "a is null";
+		} else if (b == null) {
+			s = "b is null";
+		} else if (a.length != b.length) {
+			s = "unequal arrays: " + a.length + S_SLASH + b.length;
+		} else {
+			for (int i = 0; i < a.length; i++) {
+				if (a[i].length != b[i].length) {
+					s = "row (" + i + ") has unequal lengths: " + a[i].length
+							+ S_SLASH + b[i].length;
+					break;
+				}
+				for (int j = 0; j < a[i].length; j++) {
+					if (!isEqual(a[i][j], b[i][j], eps)) {
+						s = "unequal element at (" + i + ", " + j + "), ("
+								+ a[i][j] + " != " + b[i][j] + S_RBRAK;
+						break;
+					}
+				}
+			}
+		}
+		return s;
+	}
+
+}


=====================================
src/test/java/org/xmlcml/euclid/test/EuclidTestBase.java
=====================================
@@ -0,0 +1,52 @@
+/**
+ *    Copyright 2011 Peter Murray-Rust
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+package org.xmlcml.euclid.test;
+
+
+/**
+ * 
+ * <p>
+ * superclass for manage common methods for unit tests
+ * </p>
+ * 
+ * @author Peter Murray-Rust
+ * @version 5.0
+ * 
+ */
+public final class EuclidTestBase {
+
+	static String S_SPACE = " ";
+	
+	/**
+	 * used by Assert routines. copied from Assert
+	 * 
+	 * @param message
+	 *            prepends if not null
+	 * @param expected
+	 * @param actual
+	 * @return message
+	 */
+	public static String getAssertFormat(String message, Object expected,
+			Object actual) {
+		String formatted = "";
+		if (message != null) {
+			formatted = message + S_SPACE;
+		}
+		return formatted + "expected:<" + expected + "> but was:<" + actual
+				+ ">";
+	}
+
+}


=====================================
src/test/java/org/xmlcml/euclid/test/StringTestBase.java
=====================================
@@ -0,0 +1,125 @@
+/**
+ *    Copyright 2011 Peter Murray-Rust
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+package org.xmlcml.euclid.test;
+
+import org.junit.Assert;
+
+/**
+ * 
+ * <p>
+ * superclass for manage common methods for unit tests
+ * </p>
+ * 
+ * @author Peter Murray-Rust
+ * @version 5.0
+ * 
+ */
+public class StringTestBase {
+
+	//constants
+	static String S_SLASH = "/";
+	static String S_SPACE = " ";
+	
+	/**
+	 * Asserts equality of String arrays.
+	 * 
+	 * checks for non-null, then equality of length, then individual elements
+	 * equality if individual elements are equal or both elements are null
+	 * 
+	 * @param message
+	 * @param a
+	 *            expected array may include nulls
+	 * @param b
+	 *            actual array may include nulls
+	 */
+	public static void assertEquals(String message, String[] a, String[] b) {
+		String s = testEquals(a, b);
+		if (s != null) {
+			Assert.fail(message + "; " + s);
+		}
+	}
+
+	/**
+	 * Asserts equality of String arrays.
+	 * 
+	 * convenience method where test is a whitespace-separated set of tokens
+	 * 
+	 * @param message
+	 * @param expected
+	 *            expected array as space concatenated
+	 * @param actual
+	 *            actual array may not include nulls
+	 */
+	public static void assertEquals(String message, String expected, String[] actual) {
+		if(expected==null){
+			Assert.fail(message+"; "+"null expected String");
+		}
+		String[] aa = expected.split(S_SPACE);
+		String s = testEquals(aa, actual);
+		if (s != null) {
+			Assert.fail(message + "; " + s);
+		}
+	}
+
+	/**
+	 * match arrays. error is a == null or b == null or a.length != b.length or
+	 * a[i] != b[i] nulls match
+	 * 
+	 * @param a
+	 * @param b
+	 * @return message if errors else null
+	 */
+	public static String testEquals(String[] a, String[] b) {
+		String s = null;
+		if (a == null) {
+			s = "a is null";
+		} else if (b == null) {
+			s = "b is null";
+		} else if (a.length != b.length) {
+			s = "unequal arrays: " + a.length + S_SLASH + b.length;
+		} else {
+			for (int i = 0; i < a.length; i++) {
+				if (a[i] == null && b[i] == null) {
+					// both null, match
+				} else if (a[i] == null || b[i] == null || !a[i].equals(b[i])) {
+					s = "unequal element (" + i + "), expected: " + a[i]
+							+ " found: " + b[i];
+					break;
+				}
+			}
+		}
+		return s;
+	}
+
+	/**
+	 * Asserts non equality of String arrays.
+	 * 
+	 * checks for non-null, then equality of length, then individual elements
+	 * 
+	 * @param message
+	 * @param expected
+	 *            expected array
+	 * @param actual
+	 *            actual array
+	 */
+	public static void assertNotEquals(String message, String[] expected, String[] actual) {
+		String s = testEquals(expected, actual);
+		if (s == null) {
+			Assert.fail(message + "; arrays are equal");
+		}
+	}
+
+}



View it on GitLab: https://salsa.debian.org/java-team/cmlxom/-/commit/ea3b91c8ef48b31a707c30837dee1d36a13012f8

-- 
View it on GitLab: https://salsa.debian.org/java-team/cmlxom/-/commit/ea3b91c8ef48b31a707c30837dee1d36a13012f8
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260505/a40633bc/attachment.htm>


More information about the pkg-java-commits mailing list