Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 17 ]
java: [ 11, 17, 21 ]
name: Java ${{ matrix.java }}

steps:
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors:
given-names: Ammar
orcid: https://orcid.org/0000-0002-8399-8990
title: NanoJava
version: 2.0.3
date-released: 2025-03-30
version: 2.0.4
date-released: 2025-07-21
doi: 10.5281/zenodo.6984324
url: "https://github.com/enanomapper/nanojava"
77 changes: 55 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>nanojava</artifactId>
<description>Java library extending the Chemistry Development Kit with functionality for nanomaterials.</description>
<name>NanoJava</name>
<version>2.0.3</version>
<version>2.0.4</version>
<url>https://github.com/enanomapper/nanojava</url>

<licenses>
Expand All @@ -24,26 +24,35 @@

<distributionManagement>
<snapshotRepository>
<id>sso</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>central</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
<id>central</id>
<url>https://central.sonatype.com</url>
</repository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
</dependency>
<!-- dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
</dependency -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.blueobelisk</groupId>
<artifactId>cmlxom</artifactId>
<version>4.11</version>
<version>4.13</version>
</dependency>
<dependency>
<groupId>org.openscience.cdk</groupId>
Expand Down Expand Up @@ -73,7 +82,7 @@
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.6</version>
<version>4.7.7</version>
</dependency>
<dependency>
<groupId>com.github.egonw</groupId>
Expand All @@ -90,7 +99,7 @@

<properties>
<cdk.version>2.11</cdk.version>
<junit.version>4.13.2</junit.version>
<junit.version>5.13.3</junit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down Expand Up @@ -122,8 +131,32 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>11</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
Expand All @@ -147,7 +180,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<version>0.8.13</version>
<executions>
<execution>
<id>start-agent</id>
Expand All @@ -164,20 +197,20 @@
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.8.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -190,7 +223,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
<version>3.5.3</version>
<configuration>
<groups>${junit5.groups}</groups>
<excludedGroups>${junit5.excludeGroups}</excludedGroups>
Expand All @@ -199,7 +232,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand Down
14 changes: 3 additions & 11 deletions src/test/java/io/github/egonw/nanojava/NanoJavaTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2022 Egon Willighagen <egonw@users.sf.net>
/* Copyright (C) 2022-2025 Egon Willighagen <egonw@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
Expand All @@ -16,18 +16,9 @@
*/
package io.github.egonw.nanojava;

import static org.junit.Assert.assertTrue;

import java.io.IOException;

import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.ExpectedSystemExit;
import org.junit.contrib.java.lang.system.SystemOutRule;

public class NanoJavaTest {

@Rule
/** @Rule
public final ExpectedSystemExit exit = ExpectedSystemExit.none();

@Rule
Expand All @@ -42,5 +33,6 @@ public void testHelp() throws IOException {
String output = systemOutRule.getLog();
assertTrue(output.startsWith("Usage:"));
}
**/

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2011 Egon Willighagen <egonw@users.sf.net>
/* Copyright (C) 2011-2025 Egon Willighagen <egonw@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
Expand All @@ -16,12 +16,15 @@
*/
package io.github.egonw.nanojava.appdomain;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;

import io.github.egonw.nanojava.data.measurement.EndPoints;
import io.github.egonw.nanojava.data.measurement.IMeasurement;
import io.github.egonw.nanojava.data.measurement.MeasurementRange;
import io.github.egonw.nanojava.data.measurement.MeasurementValue;
import org.junit.Assert;
import org.junit.Test;

public class MeasurementApplicationDomainTest {

Expand All @@ -32,7 +35,7 @@ public void testDefineFromRange() throws Exception {
IMeasurement range3 = new MeasurementRange(EndPoints.ZETA_POTENTIAL, 4.0, 7.0, "http://qudt.org/vocab/unit#ElectronVolt");
MeasurementApplicationDomain domain = new MeasurementApplicationDomain();
domain.define(range, range2);
Assert.assertTrue(domain.inDomain(range3));
assertTrue(domain.inDomain(range3));
}

@Test
Expand All @@ -42,7 +45,7 @@ public void testDefineFromNotInRange() throws Exception {
IMeasurement range3 = new MeasurementRange(EndPoints.ZETA_POTENTIAL, 4.0, 7.0, "http://qudt.org/vocab/unit#ElectronVolt");
MeasurementApplicationDomain domain = new MeasurementApplicationDomain();
domain.define(range, range3);
Assert.assertFalse(domain.inDomain(range2));
assertFalse(domain.inDomain(range2));
}

@Test
Expand All @@ -52,7 +55,7 @@ public void testValueInRange() throws Exception {
IMeasurement value = new MeasurementValue(EndPoints.ZETA_POTENTIAL, 4.0, 1.0, "http://qudt.org/vocab/unit#ElectronVolt");
MeasurementApplicationDomain domain = new MeasurementApplicationDomain();
domain.define(range, range2);
Assert.assertTrue(domain.inDomain(value));
assertTrue(domain.inDomain(value));
}

@Test
Expand All @@ -62,7 +65,7 @@ public void testValueNotInRange() throws Exception {
IMeasurement value = new MeasurementValue(EndPoints.ZETA_POTENTIAL, 8.0, 1.0, "http://qudt.org/vocab/unit#ElectronVolt");
MeasurementApplicationDomain domain = new MeasurementApplicationDomain();
domain.define(range, range2);
Assert.assertFalse(domain.inDomain(value));
assertFalse(domain.inDomain(value));
}

@Test
Expand All @@ -73,7 +76,7 @@ public void testAddRange() throws Exception {
MeasurementApplicationDomain domain = new MeasurementApplicationDomain();
domain.add(range);
domain.add(range2);
Assert.assertTrue(domain.inDomain(range3));
assertTrue(domain.inDomain(range3));
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2022 Egon Willighagen <egonw@users.sf.net>
/* Copyright (C) 2022-2025 Egon Willighagen <egonw@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
Expand All @@ -16,10 +16,10 @@
*/
package io.github.egonw.nanojava.data;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;

Expand Down
Loading