From d1fb0c2cfc6a6cac2da2bda79fb8563c2a34425a Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 13:42:16 +0100 Subject: [PATCH 01/10] BridgeDb 3.0.29 --- org.pathvisio.lib/pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/org.pathvisio.lib/pom.xml b/org.pathvisio.lib/pom.xml index 7e5dd69..b192c62 100644 --- a/org.pathvisio.lib/pom.xml +++ b/org.pathvisio.lib/pom.xml @@ -76,9 +76,9 @@ org.apache.servicemix.bundles.jdom;bundle-version="2.0.6", - org.bridgedb;bundle-version="3.0.20", - org.bridgedb.bio;bundle-version="3.0.20", - org.bridgedb.rdb;bundle-version="3.0.20", + org.bridgedb;bundle-version="3.0.29", + org.bridgedb.bio;bundle-version="3.0.29", + org.bridgedb.rdb;bundle-version="3.0.29", org.apache.commons.commons-collections4;bundle-version="4.4" @@ -197,17 +197,17 @@ org.bridgedb org.bridgedb - 3.0.23 + 3.0.29 org.bridgedb org.bridgedb.bio - 3.0.23 + 3.0.29 org.bridgedb org.bridgedb.rdb - 3.0.23 + 3.0.29 From 5de6e02f7ef61ba98e531df0937c16ca08382830 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 13:53:54 +0100 Subject: [PATCH 02/10] Developer plugin updates --- org.pathvisio.lib/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/org.pathvisio.lib/pom.xml b/org.pathvisio.lib/pom.xml index b192c62..85f69a7 100644 --- a/org.pathvisio.lib/pom.xml +++ b/org.pathvisio.lib/pom.xml @@ -96,7 +96,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.5.0 ${project.build.outputDirectory}/META-INF/MANIFEST.MF @@ -106,7 +106,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.14.1 11 11 @@ -115,7 +115,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.4.0 attach-sources @@ -128,7 +128,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.12.0 attach-javadocs @@ -149,7 +149,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + 3.2.8 sign-artifacts @@ -162,12 +162,12 @@ maven-surefire-plugin - 3.0.0-M7 + 3.5.4 org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.14 start-agent From 4ede6dc5906a50a037fc7047cdf872976d123087 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 14:36:07 +0100 Subject: [PATCH 03/10] Updated Action plugin versions --- .github/workflows/maven.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 286484f..101cf7f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,17 +15,19 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ 11, 17, 19 ] + java: [ 11, 17, 21, 25 ] name: Java ${{ matrix.java }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v5 with: java-version: ${{ matrix.java }} distribution: temurin - name: Build with Maven run: cd org.pathvisio.lib; mvn clean install -Dgpg.skip -Dmaven.javadoc.skip=true - name: push JaCoCo stats to codecov.io - run: bash <(curl -s https://codecov.io/bash) + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 903cc9346c31e10baab632c53f03598a0e6ec402 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 14:42:04 +0100 Subject: [PATCH 04/10] Only push to codecov once --- .github/workflows/maven.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 101cf7f..117fa01 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -27,6 +27,18 @@ jobs: distribution: temurin - name: Build with Maven run: cd org.pathvisio.lib; mvn clean install -Dgpg.skip -Dmaven.javadoc.skip=true + + code-coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Set up JDK 11 + uses: actions/setup-java@v5 + with: + java-version: 11 + distribution: temurin + - name: Build with Maven + run: cd org.pathvisio.lib; mvn clean install -Dgpg.skip -Pjacoco - name: push JaCoCo stats to codecov.io uses: codecov/codecov-action@v5 env: From 2269e776e8216c450ebb1f0a3fa1083ac09d7c8f Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 14:51:20 +0100 Subject: [PATCH 05/10] Apache collections 4.5.0 --- org.pathvisio.lib/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.pathvisio.lib/pom.xml b/org.pathvisio.lib/pom.xml index 85f69a7..a8e6d8c 100644 --- a/org.pathvisio.lib/pom.xml +++ b/org.pathvisio.lib/pom.xml @@ -79,7 +79,7 @@ org.bridgedb;bundle-version="3.0.29", org.bridgedb.bio;bundle-version="3.0.29", org.bridgedb.rdb;bundle-version="3.0.29", - org.apache.commons.commons-collections4;bundle-version="4.4" + org.apache.commons.commons-collections4;bundle-version="4.5.0" @@ -213,7 +213,7 @@ org.apache.commons commons-collections4 - 4.4 + 4.5.0 commons-lang From c1dc66b5a43f2fc16c77483c4fa6788c79b0dccc Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 15:01:53 +0100 Subject: [PATCH 06/10] Updated sonatype configuration --- org.pathvisio.lib/pom.xml | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/org.pathvisio.lib/pom.xml b/org.pathvisio.lib/pom.xml index a8e6d8c..418e28d 100644 --- a/org.pathvisio.lib/pom.xml +++ b/org.pathvisio.lib/pom.xml @@ -31,30 +31,31 @@ - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2 - + + central + https://central.sonatype.com/repository/maven-snapshots/ + + + central + https://central.sonatype.com/ + default + - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://s01.oss.sonatype.org/ - true - - + + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 + true + + central + true + published + + org.apache.felix maven-bundle-plugin From 6e071640d7b25737017ba1db1c3e6c03291c207c Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 15:13:32 +0100 Subject: [PATCH 07/10] Rewrite for JUnit5 --- org.pathvisio.lib/pom.xml | 15 ++-- .../conversion/TestConversionToGPML2013a.java | 16 ++-- .../conversion/TestConversionToGPML2021.java | 16 ++-- .../pathvisio/libgpml/debug/TestDebug.java | 13 ++- .../libgpml/io/ConverterExceptionTest.java | 22 +++-- .../org/pathvisio/libgpml/model/Test.java | 87 +++++++++++-------- .../pathvisio/libgpml/model/TestAlias.java | 26 +++--- .../pathvisio/libgpml/model/TestAnchor.java | 21 +++-- .../libgpml/model/TestAnnotation.java | 23 ++--- .../pathvisio/libgpml/model/TestCitation.java | 21 +++-- .../org/pathvisio/libgpml/model/TestCopy.java | 47 +++++----- .../libgpml/model/TestElementId.java | 30 +++---- .../pathvisio/libgpml/model/TestEvidence.java | 21 +++-- .../pathvisio/libgpml/model/TestGraph.java | 21 +++-- .../libgpml/model/TestGraphLink.java | 19 ++-- .../pathvisio/libgpml/model/TestGroup.java | 29 ++++--- .../libgpml/model/TestGroupNested.java | 31 +++---- .../libgpml/model/TestLinePoint.java | 21 +++-- .../libgpml/model/TestReferenceable.java | 26 +++--- .../pathvisio/libgpml/model/TestState.java | 22 +++-- .../libgpml/model/TestTemporary.java | 7 +- .../connector/TestSegmentedConnector.java | 13 +-- .../libgpml/model/type/TestDataNodeType.java | 21 +++-- .../libgpml/util/TestColorUtils.java | 22 +++-- .../util/TestGroupRectPropertyUtils.java | 7 +- .../pathvisio/libgpml/util/TestXrefUtils.java | 18 ++-- 26 files changed, 344 insertions(+), 271 deletions(-) diff --git a/org.pathvisio.lib/pom.xml b/org.pathvisio.lib/pom.xml index 418e28d..0761111 100644 --- a/org.pathvisio.lib/pom.xml +++ b/org.pathvisio.lib/pom.xml @@ -210,7 +210,6 @@ org.bridgedb.rdb 3.0.29 - org.apache.commons commons-collections4 @@ -221,12 +220,14 @@ commons-lang 2.6 - - - junit - junit - 4.13.2 - + + + org.junit.jupiter + junit-jupiter + 5.14.1 + test + + diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2013a.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2013a.java index 2611895..a1a5a02 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2013a.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2013a.java @@ -16,26 +16,26 @@ ******************************************************************************/ package org.pathvisio.libgpml.conversion; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.IOException; import java.net.URL; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.io.ConverterException; import org.pathvisio.libgpml.model.GPML2013aWriter; import org.pathvisio.libgpml.model.GPML2021Writer; import org.pathvisio.libgpml.model.PathwayModel; -import junit.framework.TestCase; - /** * Test for reading and writing of a single GPML2021 file, for * troubleshooting and resolving specific issues. * * @author finterly */ -public class TestConversionToGPML2013a extends TestCase { +class TestConversionToGPML2013a { private PathwayModel pathwayModel; private String inputFile = "example-v2021.gpml"; private URL url = Thread.currentThread().getContextClassLoader().getResource(inputFile); @@ -46,8 +46,8 @@ public class TestConversionToGPML2013a extends TestCase { * @throws ConverterException * @throws IOException */ - @Before - public void setUp() throws IOException, ConverterException { + @BeforeEach + void setUp() throws IOException, ConverterException { File file = new File(url.getPath()); assertTrue(file.exists()); pathwayModel = new PathwayModel(); @@ -61,7 +61,7 @@ public void setUp() throws IOException, ConverterException { * @throws IOException */ @Test - public void testWrite() throws IOException, ConverterException { + void write() throws Exception { File tmp = File.createTempFile(inputFile + "_testwriteGPML2013a_", ".gpml"); GPML2013aWriter.GPML2013aWRITER.writeToXml(pathwayModel, tmp, true); System.out.println(tmp); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2021.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2021.java index f69a233..3740938 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2021.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/conversion/TestConversionToGPML2021.java @@ -16,26 +16,26 @@ ******************************************************************************/ package org.pathvisio.libgpml.conversion; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.IOException; import java.net.URL; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.io.ConverterException; import org.pathvisio.libgpml.model.GPML2013aWriter; import org.pathvisio.libgpml.model.GPML2021Writer; import org.pathvisio.libgpml.model.PathwayModel; -import junit.framework.TestCase; - /** * Test for reading and writing of a single GPML2013a file, for * troubleshooting and resolving specific issues. * * @author finterly */ -public class TestConversionToGPML2021 extends TestCase { +class TestConversionToGPML2021 { private PathwayModel pathwayModel; private String inputFile = "example-v2013a.gpml"; private URL url = Thread.currentThread().getContextClassLoader().getResource(inputFile); @@ -46,8 +46,8 @@ public class TestConversionToGPML2021 extends TestCase { * @throws ConverterException * @throws IOException */ - @Before - public void setUp() throws IOException, ConverterException { + @BeforeEach + void setUp() throws IOException, ConverterException { File file = new File(url.getPath()); assertTrue(file.exists()); pathwayModel = new PathwayModel(); @@ -61,7 +61,7 @@ public void setUp() throws IOException, ConverterException { * @throws IOException */ @Test - public void testWrite() throws IOException, ConverterException { + void write() throws Exception { File tmp = File.createTempFile(inputFile + "_testwriteGPML2013a_", ".gpml"); GPML2013aWriter.GPML2013aWRITER.writeToXml(pathwayModel, tmp, true); System.out.println(tmp); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/debug/TestDebug.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/debug/TestDebug.java index b5b2fc0..55546f6 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/debug/TestDebug.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/debug/TestDebug.java @@ -16,20 +16,24 @@ ******************************************************************************/ package org.pathvisio.libgpml.debug; +import static org.junit.jupiter.api.Assertions.fail; + import java.util.ConcurrentModificationException; import java.util.ListIterator; -import junit.framework.TestCase; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Tests for debug. * * @author unknown */ -public class TestDebug extends TestCase { +class TestDebug { DebugList l; - public void setUp() { + @BeforeEach + void setUp() { l = new DebugList(); l.add("boom"); l.add("roos"); @@ -37,7 +41,8 @@ public void setUp() { l.add("vuur"); } - public void test1() { + @Test + void test1() { try { ListIterator i = l.listIterator(); while (i.hasNext()) { diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/io/ConverterExceptionTest.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/io/ConverterExceptionTest.java index 89efbdb..c155fb8 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/io/ConverterExceptionTest.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/io/ConverterExceptionTest.java @@ -14,30 +14,28 @@ */ package org.pathvisio.libgpml.io; -import org.junit.Assert; -import org.junit.Test; - -import junit.framework.TestCase; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Test for reading and writing of a single GPML2021 file, for * troubleshooting and resolving specific issues. */ -public class ConverterExceptionTest extends TestCase { +class ConverterExceptionTest { @Test - public void testConstructor() { + void constructor() { Exception exception = new ConverterException("Something bad happened"); - Assert.assertNotNull(exception); - Assert.assertSame("Something bad happened", exception.getMessage()); + Assertions.assertNotNull(exception); + Assertions.assertSame("Something bad happened", exception.getMessage()); } @Test - public void testConstructor_Exception() { + void constructorException() { Exception exception = new ConverterException(new Exception("Something bad happened")); - Assert.assertNotNull(exception); - Assert.assertNotNull(exception.getMessage()); - Assert.assertTrue(exception.getMessage().contains("Something bad happened")); + Assertions.assertNotNull(exception); + Assertions.assertNotNull(exception.getMessage()); + Assertions.assertTrue(exception.getMessage().contains("Something bad happened")); } } diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/Test.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/Test.java index 4968f8a..b91a439 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/Test.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/Test.java @@ -16,6 +16,13 @@ ******************************************************************************/ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.net.URL; import java.util.ArrayList; @@ -24,17 +31,16 @@ import org.bridgedb.DataSource; import org.bridgedb.Xref; import org.bridgedb.bio.DataSourceTxt; +import org.junit.jupiter.api.BeforeEach; import org.pathvisio.libgpml.model.GraphLink.LinkableTo; import org.pathvisio.libgpml.model.type.DataNodeType; -import junit.framework.TestCase; - /** * Tests for libgpml model classes. * * @author unknown */ -public class Test extends TestCase implements PathwayModelListener, PathwayObjectListener { +public class Test implements PathwayModelListener, PathwayObjectListener { PathwayModel data; DataNode o; @@ -42,7 +48,8 @@ public class Test extends TestCase implements PathwayModelListener, PathwayObjec List receivedElementEvents; Interaction l; - public void setUp() { + @BeforeEach + void setUp() { data = new PathwayModel(); data.addListener(this); o = new DataNode("", DataNodeType.UNDEFINED); @@ -56,13 +63,14 @@ public void setUp() { receivedElementEvents.clear(); } - public void testFields() { + @org.junit.jupiter.api.Test + void fields() { o.setCenterX(1.0); - assertEquals("test set/get CenterX", 1.0, o.getCenterX(), 0.0001); + assertEquals(1.0, o.getCenterX(), 0.0001, "test set/get CenterX"); - assertEquals("Setting CenterX should generate single event", receivedElementEvents.size(), 1); - assertEquals("test getProperty()", 1.0, o.getCenterX(), 0.0001); + assertEquals(1, receivedElementEvents.size(), "Setting CenterX should generate single event"); + assertEquals(1.0, o.getCenterX(), 0.0001, "test getProperty()"); // try { // o.setCenterX(null); @@ -72,9 +80,9 @@ public void testFields() { // however, you should be able to set graphRef to null - assertNull("graphref null by default", l.getStartElementRef()); + assertNull(l.getStartElementRef(), "graphref null by default"); l.setStartElementRef(null); - assertNull("can set graphRef to null", l.getStartElementRef()); + assertNull(l.getStartElementRef(), "can set graphRef to null"); } // public void testProperties() throws IOException, ConverterException { @@ -153,7 +161,8 @@ public void testFields() { // assertEquals("Something other than 'World7'", o2.getPropertyEx("Hello7")); // } - public void testColor() { + @org.junit.jupiter.api.Test + void color() { try { o.setTextColor(null); o.setBorderColor(null); @@ -162,46 +171,49 @@ public void testColor() { } } - public void testParent() { + @org.junit.jupiter.api.Test + void parent() { // remove data.remove(o); - assertNull("removing object set parents null", o.getPathwayModel()); - assertEquals(received.size(), 1); - assertEquals("Event type should be DELETED", received.get(0).getType(), PathwayModelEvent.DELETED); + assertNull(o.getPathwayModel(), "removing object set parents null"); + assertEquals(1, received.size()); + assertEquals(PathwayModelEvent.DELETED, received.get(0).getType(), "Event type should be DELETED"); // re-add data.add(o); - assertEquals("adding sets parent", o.getPathwayModel(), data); - assertEquals(received.size(), 2); - assertEquals("Event type should be ADDED", received.get(1).getType(), PathwayModelEvent.ADDED); + assertEquals(o.getPathwayModel(), data, "adding sets parent"); + assertEquals(2, received.size()); + assertEquals(PathwayModelEvent.ADDED, received.get(1).getType(), "Event type should be ADDED"); } /** * Test graphRef's and graphId's * */ - public void testRef() { - assertTrue("query non-existing list of ref", data.getReferringLinkableFroms(o).size() == 0); + @org.junit.jupiter.api.Test + void ref() { + assertEquals(0, data.getReferringLinkableFroms(o).size(), "query non-existing list of ref"); // create link l.setStartElementRef(o); - assertTrue("reference created", data.getReferringLinkableFroms(o).contains(l.getStartLinePoint())); + assertTrue(data.getReferringLinkableFroms(o).contains(l.getStartLinePoint()), "reference created"); l.setStartElementRef(null); - assertTrue("reference removed", data.getReferringLinkableFroms(o).size() == 0); + assertEquals(0, data.getReferringLinkableFroms(o).size(), "reference removed"); DataNode o2 = new DataNode("", DataNodeType.UNDEFINED); data.add(o2); // create link in opposite order l.setEndElementRef(o); - assertTrue("reference created (2)", data.getReferringLinkableFroms(o).contains(l.getEndLinePoint())); + assertTrue(data.getReferringLinkableFroms(o).contains(l.getEndLinePoint()), "reference created (2)"); } /** * test that Xref and XrefWithSymbol obey the equals contract */ - public void testXRefEquals() { + @org.junit.jupiter.api.Test + void xRefEquals() { if (!DataSource.fullNameExists("Affy")) DataSourceTxt.init(); @@ -216,16 +228,16 @@ public void testXRefEquals() { for (int i = 0; i < testList.length; ++i) { Object refi = testList[i]; // equals must be reflexive - assertTrue(refi.equals(refi)); + assertEquals(refi, refi); // never equal to null - assertFalse(refi.equals(null)); + assertNotEquals(null, refi); } for (int i = 1; i < testList.length; ++i) for (int j = 0; j < i; ++j) { // equals must be symmetric Object refi = testList[i]; Object refj = testList[j]; - assertEquals("Symmetry fails for " + refj + " and " + refi, refi.equals(refj), refj.equals(refi)); + assertEquals(refi.equals(refj), refj.equals(refi), "Symmetry fails for " + refj + " and " + refi); // hashcode contract if (refi.equals(refj)) { @@ -240,13 +252,13 @@ public void testXRefEquals() { Object refj = testList[j]; Object refk = testList[k]; if (refi.equals(refj) && refj.equals(refk)) { - assertTrue(refk.equals(refi)); + assertEquals(refk, refi); } if (refj.equals(refk) && refk.equals(refi)) { - assertTrue(refi.equals(refj)); + assertEquals(refi, refj); } if (refk.equals(refi) && refi.equals(refj)) { - assertTrue(refk.equals(refj)); + assertEquals(refk, refj); } } } @@ -310,22 +322,24 @@ public void testXRefEquals() { // } // } - public void testRef2() { + @org.junit.jupiter.api.Test + void ref2() { o.setElementId("1"); LinkableTo o2 = new DataNode("", DataNodeType.UNDEFINED); // note: parent not set yet! data.add((PathwayObject) o2); // reference should now be created - assertNull("default endGraphRef is null", l.getEndElementRef()); + assertNull(l.getEndElementRef(), "default endGraphRef is null"); l.setEndElementRef(o2); - assertTrue("reference created through adding", - data.getReferringLinkableFroms(o2).contains(l.getEndLinePoint())); + assertTrue(data.getReferringLinkableFroms(o2).contains(l.getEndLinePoint()), + "reference created through adding"); } - public void testWrongFormat() { + @org.junit.jupiter.api.Test + void wrongFormat() { try { String inputFile = "test.mapp"; URL url = Thread.currentThread().getContextClassLoader().getResource(inputFile); @@ -350,7 +364,8 @@ public void testWrongFormat() { * Test that there is one and only one Pathway object * */ - public void testMappInfo() { + @org.junit.jupiter.api.Test + void mappInfo() { Pathway mi; // pathway is created and set when a pathway model is first created. diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAlias.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAlias.java index c66c58d..f0387f7 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAlias.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAlias.java @@ -1,16 +1,14 @@ package org.pathvisio.libgpml.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; -import java.io.IOException; -import org.junit.Before; -import org.junit.Test; -import org.pathvisio.libgpml.io.ConverterException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.model.type.GroupType; @@ -20,15 +18,15 @@ * @author finterly * */ -public class TestAlias { +class TestAlias { private PathwayModel p; private Group g; private DataNode d; private DataNode alias; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { p = new PathwayModel(); g = new Group(GroupType.GROUP); d = new DataNode("textLabel", DataNodeType.UNDEFINED); @@ -50,7 +48,7 @@ public void setUp() throws Exception { * */ @Test - public void testRemoveAlias() { + void removeAlias() { p.removeDataNode(alias); assertNull(alias.getAliasRef()); assertNull(p.getLinkedAliases(g)); @@ -61,7 +59,7 @@ public void testRemoveAlias() { * */ @Test - public void testRemoveGroup() { + void removeGroup() { p.removeGroup(g); assertNull(alias.getAliasRef()); assertNull(p.getLinkedAliases(g)); @@ -72,7 +70,7 @@ public void testRemoveGroup() { * */ @Test - public void testWriteGPML2021() throws IOException, ConverterException { + void writeGPML2021() throws Exception { File tmp = File.createTempFile("alias_testwriteGPML2021_", ".gpml"); GPML2021Writer.GPML2021WRITER.writeToXml(p, tmp, false); System.out.println(tmp); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnchor.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnchor.java index a000f5b..79dc179 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnchor.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnchor.java @@ -16,24 +16,27 @@ ******************************************************************************/ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.LineElement.Anchor; import org.pathvisio.libgpml.model.LineElement.LinePoint; import org.pathvisio.libgpml.model.type.AnchorShapeType; import org.pathvisio.libgpml.model.type.ArrowHeadType; -import junit.framework.TestCase; - /** * Test for {@link Anchor}. * * @author finterly */ -public class TestAnchor extends TestCase { +class TestAnchor { private PathwayModel p; private Interaction i1; @@ -42,8 +45,8 @@ public class TestAnchor extends TestCase { /** * Creates and adds anchor to line, line to pathwayModel. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); i1 = new Interaction(); LinePoint pt1 = i1.getLinePoints().get(0); @@ -102,7 +105,7 @@ public void setUp() { * Tests removing anchor. */ @Test - public void testRemoveAnchor() { + void removeAnchor() { // remove anchor i1.removeAnchor(a1); assertFalse(i1.hasAnchor(a1)); @@ -113,7 +116,7 @@ public void testRemoveAnchor() { * Tests removing line and thus anchor. */ @Test - public void testRemoveLine() { + void removeLine() { p.removeInteraction(i1); assertFalse(i1.hasAnchor(a1)); assertFalse(p.hasPathwayObject(a1)); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnnotation.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnnotation.java index a9bf085..eb22feb 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnnotation.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestAnnotation.java @@ -1,25 +1,26 @@ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.net.URL; import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; -import org.pathvisio.libgpml.io.ConverterException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.PathwayElement.AnnotationRef; import org.pathvisio.libgpml.model.type.AnnotationType; import org.pathvisio.libgpml.model.type.DataNodeType; -import junit.framework.TestCase; - /** * Tests for Annotation class. * * @author p70073399 */ -public class TestAnnotation extends TestCase { +class TestAnnotation { private PathwayModel p; private DataNode d1; @@ -31,8 +32,8 @@ public class TestAnnotation extends TestCase { /** * Two annotationRefs (same annotation) added to a data node. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); d1 = new DataNode("d1", DataNodeType.UNDEFINED); p.addDataNode(d1); @@ -53,7 +54,7 @@ public void setUp() { } @Test - public void testReadingOfPathwayAnnotations() throws ConverterException { + void readingOfPathwayAnnotations() throws Exception { String inputFile = "example-v2013a.gpml"; URL url = Thread.currentThread().getContextClassLoader().getResource(inputFile); File file = new File(url.getPath()); @@ -73,7 +74,7 @@ public void testReadingOfPathwayAnnotations() throws ConverterException { * Tests for removing annotation. */ @Test - public void testRemoveAnnotation() { + void removeAnnotation() { System.out.println(d1.getAnnotationRefs()); System.out.println(a.getAnnotationRefs()); p.removeAnnotation(a); @@ -88,7 +89,7 @@ public void testRemoveAnnotation() { * model. */ @Test - public void testDuplicateAnnotation() { + void duplicateAnnotation() { AnnotationRef ar3 = d1.addAnnotation("value", AnnotationType.ONTOLOGY, null, null); assertEquals(ar1.getAnnotation(), ar3.getAnnotation()); } diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCitation.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCitation.java index 93acb7e..6368f2b 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCitation.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCitation.java @@ -1,22 +1,25 @@ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + + import org.bridgedb.DataSource; import org.bridgedb.Xref; import org.bridgedb.bio.DataSourceTxt; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.PathwayElement.CitationRef; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.util.XrefUtils; -import junit.framework.TestCase; - /** * For testing Citation methods * * @author finterly */ -public class TestCitation extends TestCase { +class TestCitation { private PathwayModel p; private DataNode d1; @@ -28,8 +31,8 @@ public class TestCitation extends TestCase { /** * Two annotationRefs (same annotation) added to a data node. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { if (!DataSource.fullNameExists("Affy")) DataSourceTxt.init(); p = new PathwayModel(); @@ -56,7 +59,7 @@ public void setUp() { * Tests for removing annotation. */ @Test - public void testRemoveCitation() { + void removeCitation() { System.out.println(d1.getCitationRefs()); System.out.println(a.getCitationRefs()); p.removeCitation(a); @@ -71,7 +74,7 @@ public void testRemoveCitation() { * model. */ @Test - public void testDuplicateCitation() { + void duplicateCitation() { Xref xref = XrefUtils.createXref("11", "ensembl"); CitationRef ar3 = d1.addCitation(xref, "urlLink"); assertEquals(ar1.getCitation(), ar3.getCitation()); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCopy.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCopy.java index 4b96715..a5a5b69 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCopy.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestCopy.java @@ -16,25 +16,28 @@ ******************************************************************************/ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.DataNode.State; import org.pathvisio.libgpml.model.LineElement.LinePoint; import org.pathvisio.libgpml.model.PathwayElement.CitationRef; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.model.type.StateType; -import junit.framework.TestCase; - /** * Test for Clone methods. * * @author finterly */ -public class TestCopy extends TestCase { +class TestCopy { private PathwayModel p; private DataNode o1; @@ -43,8 +46,8 @@ public class TestCopy extends TestCase { private Citation c; private Interaction i1; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { p = new PathwayModel(); // add datanode o1 = new DataNode("o1", DataNodeType.UNDEFINED); @@ -62,12 +65,12 @@ public void setUp() throws Exception { i1.addAnchor(0, null); } - + /** * */ @Test - public void testClonePathway() { + void clonePathway() { // link dataNode and interaction i1.setStartElementRef(o1); PathwayModel p2 = p.clone(); @@ -82,21 +85,21 @@ public void testClonePathway() { // } // assertEquals(o2.getAnchors().get(0).getPathwayModel(), p2); } - + /** * */ @Test - public void testCopyDataNode() { + void copyDataNode() { CopyElement copy = o1.copy(); DataNode o2 = (DataNode) copy.getNewElement(); State s2 = o2.getStates().get(0); assertEquals(o1, o1); - assertFalse(o1 == o2); + assertNotSame(o1, o2); assertEquals(s1.getDataNode(), o1); assertEquals(s2.getDataNode(), o2); - assertFalse(s1 == s2); + assertNotSame(s1, s2); assertEquals(o1.getPathwayModel(), p); assertEquals(s1.getPathwayModel(), p); @@ -118,7 +121,7 @@ public void testCopyDataNode() { o2.copyReferencesFrom(copy.getSourceElement()); CitationRef cr2 = o2.getCitationRefs().get(0); Citation c2 = cr2.getCitation(); - assertEquals(c2.getUrlLink(), "String"); + assertEquals("String", c2.getUrlLink()); assertTrue(o2.hasCitationRef(cr2)); assertTrue(p2.hasPathwayObject(c2)); @@ -128,10 +131,10 @@ public void testCopyDataNode() { * */ @Test - public void testCopyInteraction() { + void copyInteraction() { Interaction o2 = (Interaction) i1.copy().getNewElement(); assertEquals(i1, i1); - assertFalse(i1 == o2); + assertNotSame(i1, o2); assertEquals(i1.getPathwayModel(), p); assertNull(o2.getPathwayModel()); @@ -148,7 +151,7 @@ public void testCopyInteraction() { * */ @Test - public void testCopyGraphicalLine() { + void copyGraphicalLine() { GraphicalLine o1 = new GraphicalLine(); p.addGraphicalLine(o1); @@ -160,7 +163,7 @@ public void testCopyGraphicalLine() { GraphicalLine o2 = (GraphicalLine) o1.copy().getNewElement(); assertEquals(o1, o1); - assertFalse(o1 == o2); + assertNotSame(o1, o2); assertEquals(o1.getPathwayModel(), p); assertNull(o2.getPathwayModel()); @@ -177,14 +180,14 @@ public void testCopyGraphicalLine() { * */ @Test - public void testCopyLabel() { + void copyLabel() { Label o1 = new Label("o1"); p.addLabel(o1); Label o2 = (Label) o1.copy().getNewElement(); assertEquals(o1, o1); - assertFalse(o1 == o2); + assertNotSame(o1, o2); assertEquals(o1.getPathwayModel(), p); assertNull(o2.getPathwayModel()); } @@ -193,14 +196,14 @@ public void testCopyLabel() { * */ @Test - public void testCopyShape() { + void copyShape() { Shape o1 = new Shape(); p.addShape(o1); Shape o2 = (Shape) o1.copy().getNewElement(); assertEquals(o1, o1); - assertFalse(o1 == o2); + assertNotSame(o1, o2); assertEquals(o1.getPathwayModel(), p); assertNull(o2.getPathwayModel()); } diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestElementId.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestElementId.java index 2c7619d..a584f84 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestElementId.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestElementId.java @@ -1,12 +1,12 @@ package org.pathvisio.libgpml.model; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -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.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.model.type.GroupType; @@ -15,12 +15,12 @@ * * @author finterly */ -public class TestElementId { +class TestElementId { private PathwayModel p; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { p = new PathwayModel(); } @@ -28,7 +28,7 @@ public void setUp() throws Exception { * */ @Test - public void testDataNode() { + void dataNode() { DataNode o = new DataNode("textLabel", DataNodeType.UNDEFINED); assertNull(o.getElementId()); p.add(o); @@ -41,7 +41,7 @@ public void testDataNode() { } @Test - public void testInteraction() { + void interaction() { Interaction o = new Interaction(); assertNull(o.getElementId()); p.add(o); @@ -54,7 +54,7 @@ public void testInteraction() { } @Test - public void testGraphicalLine() { + void graphicalLine() { GraphicalLine o = new GraphicalLine(); assertNull(o.getElementId()); p.add(o); @@ -67,7 +67,7 @@ public void testGraphicalLine() { } @Test - public void testLabel() { + void label() { Label o = new Label("textLabel"); assertNull(o.getElementId()); p.add(o); @@ -80,7 +80,7 @@ public void testLabel() { } @Test - public void testShape() { + void shape() { Shape o = new Shape(); assertNull(o.getElementId()); p.add(o); @@ -93,7 +93,7 @@ public void testShape() { } @Test - public void testGroup() { + void group() { Group o = new Group(GroupType.GROUP); assertNull(o.getElementId()); p.add(o); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestEvidence.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestEvidence.java index 42426ad..07cd273 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestEvidence.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestEvidence.java @@ -1,19 +1,22 @@ package org.pathvisio.libgpml.model; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.PathwayElement.EvidenceRef; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.util.XrefUtils; -import junit.framework.TestCase; - /** * For testing Evidence methods * * @author finterly */ -public class TestEvidence extends TestCase { +class TestEvidence { private PathwayModel p; private DataNode d1; @@ -25,8 +28,8 @@ public class TestEvidence extends TestCase { /** * Two annotationRefs (same annotation) added to a data node. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); d1 = new DataNode("d1", DataNodeType.UNDEFINED); p.addDataNode(d1); @@ -51,7 +54,7 @@ public void setUp() { * Tests for removing annotation. */ @Test - public void testRemoveEvidence() { + void removeEvidence() { System.out.println(d1.getEvidenceRefs()); System.out.println(a.getEvidenceRefs()); p.removeEvidence(a); @@ -66,7 +69,7 @@ public void testRemoveEvidence() { * model. */ @Test - public void testDuplicateEvidence() { + void duplicateEvidence() { EvidenceRef ar3 = d1.addEvidence("value", XrefUtils.createXref("123", "doid"), "urlLink"); assertEquals(ar1.getEvidence(), ar3.getEvidence()); } diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraph.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraph.java index c483da7..fb768a5 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraph.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraph.java @@ -16,27 +16,30 @@ ******************************************************************************/ package org.pathvisio.libgpml.model; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.LineElement.LinePoint; import org.pathvisio.libgpml.model.type.DataNodeType; -import junit.framework.TestCase; - /** * Test graph properties of a pathway model. * * @author unknown */ -public class TestGraph extends TestCase { +class TestGraph { PathwayModel p; Interaction l; DataNode n1, n2; LinePoint start, end; - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); l = new Interaction(); @@ -70,7 +73,7 @@ public void setUp() { * that the mPoint is linked to an object or not. */ @Test - public void testRelative() { + void relative() { assertFalse(start.isRelative()); assertFalse(end.isRelative()); @@ -101,7 +104,7 @@ public void testRelative() { * properly unlinked. */ @Test - public void testRemove() { + void remove() { assertFalse(start.isRelative()); assertEquals(11.0, start.getX(), 0.01); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraphLink.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraphLink.java index 80e6a68..328dd3c 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraphLink.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGraphLink.java @@ -1,16 +1,17 @@ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.LineElement.Anchor; import org.pathvisio.libgpml.model.LineElement.LinePoint; import org.pathvisio.libgpml.model.type.DataNodeType; -import junit.framework.TestCase; - /** * For testing methods for elementRef: *

@@ -22,14 +23,14 @@ * * @author finterly */ -public class TestGraphLink extends TestCase { +class TestGraphLink { private PathwayModel p; private Interaction i; private Interaction i2; - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); i = new Interaction(); i2 = new Interaction(); @@ -60,7 +61,7 @@ public void setUp() { * */ @Test - public void testLinkToShapedElement() { + void linkToShapedElement() { DataNode d1 = new DataNode("d", DataNodeType.METABOLITE); p.addDataNode(d1); @@ -98,7 +99,7 @@ public void testLinkToShapedElement() { * */ @Test - public void testLinkToAnchor() { + void linkToAnchor() { // adds anchor to interaction i2 Anchor a = i2.addAnchor(0.5, null); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroup.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroup.java index 2478d3e..20f6741 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroup.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroup.java @@ -1,19 +1,24 @@ package org.pathvisio.libgpml.model; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.DataNode.State; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.model.type.GroupType; -import junit.framework.TestCase; - /** * Test for {@link Group}. * * @author finterly */ -public class TestGroup extends TestCase { +class TestGroup { PathwayModel p; Group g1; @@ -25,8 +30,8 @@ public class TestGroup extends TestCase { /** * Creates and adds anchor to line, line to pathwayModel. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); g1 = new Group(GroupType.GROUP); @@ -82,7 +87,7 @@ public void setUp() { * */ @Test - public void testRemoveDataNode() { + void removeDataNode() { // terminates data node and empty group p.removeDataNode(d1); assertFalse(p.hasPathwayObject(g1)); @@ -112,7 +117,7 @@ public void testRemoveDataNode() { * */ @Test - public void testRemoveDataNodeFromGroup() { + void removeDataNodeFromGroup() { // removes data node from group, terminates group, data node remains g1.removePathwayElement(d1); @@ -156,7 +161,7 @@ public void testRemoveDataNodeFromGroup() { * */ @Test - public void testRemoveGroup() { + void removeGroup() { // terminates group, data nodes remain p.removeGroup(g1); assertFalse(p.hasPathwayObject(g1)); @@ -186,7 +191,7 @@ public void testRemoveGroup() { * */ @Test - public void testSwitchGroup() { + void switchGroup() { d1.setGroupRefTo(g2); assertFalse(p.hasPathwayObject(g1)); assertTrue(p.hasPathwayObject(g2)); @@ -213,7 +218,7 @@ public void testSwitchGroup() { * @author unknown, finterly */ @Test - public void testUngroup() { + void ungroup() { PathwayModel pwy = new PathwayModel(); Interaction line = new Interaction(null); Group group = new Group(null); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroupNested.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroupNested.java index 2e81022..ad1899e 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroupNested.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestGroupNested.java @@ -1,22 +1,23 @@ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; -import java.io.IOException; -import org.junit.Before; -import org.junit.Test; -import org.pathvisio.libgpml.io.ConverterException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.model.type.GroupType; -import junit.framework.TestCase; - /** * Tests for nested {@link Group}(s). * * @author finterly */ -public class TestGroupNested extends TestCase { +class TestGroupNested { PathwayModel p; Group g1; @@ -28,8 +29,8 @@ public class TestGroupNested extends TestCase { /** * Creates and adds anchor to line, line to pathwayModel. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); g1 = new Group(GroupType.GROUP); @@ -76,7 +77,7 @@ public void setUp() { * */ @Test - public void testRemoveDataNode() { + void removeDataNode() { // terminates data node and g1 p.removeDataNode(d1); assertFalse(p.hasPathwayObject(g1)); @@ -108,7 +109,7 @@ public void testRemoveDataNode() { * */ @Test - public void testRemoveDataNode2() { + void removeDataNode2() { // terminates data node, group remains p.removeDataNode(d2); assertTrue(p.hasPathwayObject(g2)); @@ -130,7 +131,7 @@ public void testRemoveDataNode2() { * */ @Test - public void testRemoveDataNodeFromGroup() { + void removeDataNodeFromGroup() { // removes data node from group, terminates group, data node remains g1.removePathwayElement(d1); @@ -176,7 +177,7 @@ public void testRemoveDataNodeFromGroup() { * */ @Test - public void testRemoveGroup() { + void removeGroup() { // terminates group, data nodes remain p.removeGroup(g1); assertFalse(p.hasPathwayObject(g1)); @@ -208,7 +209,7 @@ public void testRemoveGroup() { * */ @Test - public void testSwitchGroup() { + void switchGroup() { d1.setGroupRefTo(g2); assertFalse(p.hasPathwayObject(g1)); assertTrue(p.hasPathwayObject(g2)); @@ -234,7 +235,7 @@ public void testSwitchGroup() { * */ @Test - public void testWriteGPML2021() throws IOException, ConverterException { + void writeGPML2021() throws Exception { File tmp = File.createTempFile("group_nested_testwriteGPML2021_", ".gpml"); GPML2021Writer.GPML2021WRITER.writeToXml(p, tmp, false); System.out.println(tmp); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestLinePoint.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestLinePoint.java index 6268eaf..589778a 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestLinePoint.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestLinePoint.java @@ -16,21 +16,24 @@ ******************************************************************************/ package org.pathvisio.libgpml.model; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.List; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.LineElement.LinePoint; -import junit.framework.TestCase; - /** * Test for {@link LinePoint}. * * @author finterly */ -public class TestLinePoint extends TestCase { +class TestLinePoint { private PathwayModel p; private Interaction i1; @@ -40,8 +43,8 @@ public class TestLinePoint extends TestCase { /** * Creates and adds anchor to line, line to pathwayModel. */ - @Before - public void setUp() { + @BeforeEach + void setUp() { p = new PathwayModel(); i1 = new Interaction(); LinePoint pt1 = i1.getLinePoints().get(0); @@ -88,7 +91,7 @@ public void setUp() { * Tests removing line and thus anchor. */ @Test - public void testRemoveLine() { + void removeLine() { p.removeInteraction(i1); assertFalse(p.hasPathwayObject(i1)); assertFalse(p.hasPathwayObject(pt3)); @@ -99,7 +102,7 @@ public void testRemoveLine() { * Tests calling setLinePoints() before adding line to pathway model. */ @Test - public void testSetLinePoints() { + void setLinePoints() { PathwayModel p = new PathwayModel(); GraphicalLine i1 = new GraphicalLine(); LinePoint pt1 = i1.getLinePoints().get(0); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestReferenceable.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestReferenceable.java index d747926..b32eeb1 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestReferenceable.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestReferenceable.java @@ -1,7 +1,13 @@ package org.pathvisio.libgpml.model; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.PathwayElement.AnnotationRef; import org.pathvisio.libgpml.model.PathwayElement.CitationRef; import org.pathvisio.libgpml.model.PathwayElement.EvidenceRef; @@ -12,8 +18,6 @@ import org.pathvisio.libgpml.model.type.DataNodeType; import org.pathvisio.libgpml.util.XrefUtils; -import junit.framework.TestCase; - /** * Tests for {@link Referenceable}: * @@ -28,7 +32,7 @@ * * @author finterly */ -public class TestReferenceable extends TestCase { +class TestReferenceable { private PathwayModel p; private DataNode d1; @@ -45,8 +49,8 @@ public class TestReferenceable extends TestCase { private CitationRef cr2; private EvidenceRef er2; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { p = new PathwayModel(); d1 = new DataNode("d1", DataNodeType.UNDEFINED); // instantiate dataNode p.addDataNode(d1); // add datanode to pathway model @@ -68,7 +72,7 @@ public void setUp() throws Exception { } @Test - public void testCheckSetUp() { + void checkSetUp() { // pathway model has objects assertTrue(p.hasPathwayObject(d1)); assertTrue(p.hasPathwayObject(a1)); @@ -112,7 +116,7 @@ public void testCheckSetUp() { } @Test - public void testRemoveAnnotation() { + void removeAnnotation() { p.removeAnnotation(a1); // pathway model has objects @@ -154,7 +158,7 @@ public void testRemoveAnnotation() { } @Test - public void testRemoveAnnotationRef() { + void removeAnnotationRef() { d1.removeAnnotationRef(ar1); // pathway model has objects @@ -197,7 +201,7 @@ public void testRemoveAnnotationRef() { } @Test - public void testRemoveDataNode() { + void removeDataNode() { p.removeDataNode(d1); // pathway model has objects diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestState.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestState.java index 72798ae..93f33c9 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestState.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestState.java @@ -16,13 +16,17 @@ ******************************************************************************/ package org.pathvisio.libgpml.model; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.DataNode.State; import org.pathvisio.libgpml.model.type.DataNodeType; -import junit.framework.TestCase; - /** * Test for {@link State}. *

@@ -35,7 +39,7 @@ * * @author finterly */ -public class TestState extends TestCase { +class TestState { private PathwayModel p; private DataNode d1; @@ -43,8 +47,8 @@ public class TestState extends TestCase { private State st2; private State st3; - @Before - public void setUp() throws Exception { + @BeforeEach + void setUp() throws Exception { p = new PathwayModel(); d1 = new DataNode("d1", DataNodeType.UNDEFINED); p.addDataNode(d1); @@ -67,7 +71,7 @@ public void setUp() throws Exception { * */ @Test - public void testRemoveState() { + void removeState() { d1.removeState(st3); assertFalse(d1.hasState(st3)); assertFalse(p.hasPathwayObject(st3)); @@ -78,7 +82,7 @@ public void testRemoveState() { * Tests removing a data node and its effect on states. */ @Test - public void testRemoveDataNode() { + void removeDataNode() { p.removeDataNode(d1); assertTrue(d1.getStates().isEmpty()); assertTrue(p.getDataNodes().isEmpty()); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java index 811d8c3..5329e4f 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java @@ -1,18 +1,19 @@ package org.pathvisio.libgpml.model; -import junit.framework.TestCase; +import org.junit.jupiter.api.Test; /** * Test for random things. * * @author finterly */ -public class TestTemporary extends TestCase { +class TestTemporary { /** * Temporary place for testing various methods. */ - public static void testThis() { + @Test + static void testThis() { // PathwayModel p = new PathwayModel(); // Interaction line = new Interaction(); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/connector/TestSegmentedConnector.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/connector/TestSegmentedConnector.java index 8271174..f07302b 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/connector/TestSegmentedConnector.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/connector/TestSegmentedConnector.java @@ -16,25 +16,26 @@ ******************************************************************************/ package org.pathvisio.libgpml.model.connector; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.awt.geom.Point2D; import java.util.Arrays; - +import org.junit.jupiter.api.Test; import org.pathvisio.libgpml.model.Interaction; import org.pathvisio.libgpml.model.LineElement.LinePoint; import org.pathvisio.libgpml.model.connector.ConnectorShape.Segment; -import junit.framework.TestCase; - /** * Test for segmented connector. * * @author unknown * */ -public class TestSegmentedConnector extends TestCase { - +class TestSegmentedConnector { + /** test conversion to / from line coordinates */ - public void testLineCoordinates() { + @Test + void lineCoordinates() { Interaction line = new Interaction(); LinePoint[] points = new LinePoint[] { line.new LinePoint(75.0, 125.0), line.new LinePoint(75.0, 50.0), diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/type/TestDataNodeType.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/type/TestDataNodeType.java index c05bf52..523cbc2 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/type/TestDataNodeType.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/type/TestDataNodeType.java @@ -16,22 +16,28 @@ ******************************************************************************/ package org.pathvisio.libgpml.model.type; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.Arrays; import java.util.List; -import junit.framework.TestCase; +import org.junit.jupiter.api.Test; /** * Test for extensible enum class. Tests DataNodeType as an example. * * @author finterly */ -public class TestDataNodeType extends TestCase { +class TestDataNodeType { /** * For testing data node type features. */ - public static void testDataNodeType() { + @Test + static void dataNodeType() { // returns "RNA" DataNodeType rna1 = DataNodeType.register("RNA"); @@ -43,7 +49,7 @@ public static void testDataNodeType() { // should return "Complex" in place of "comPLEX" DataNodeType complex1 = DataNodeType.register("comPLEX"); // should both equal "Complex" - assertEquals(complex1, DataNodeType.COMPLEX); + assertEquals(DataNodeType.COMPLEX, complex1); // should add "new data node type" DataNodeType new1 = DataNodeType.register("new data node type"); @@ -70,14 +76,15 @@ public static void testDataNodeType() { // System.out.println(DataNodeType.getNames()); // System.out.println(rna1 == DataNodeType.RNA); } - + /** * For testing group type features. */ - public static void testGroupType() { + @Test + static void groupType() { GroupType type1 = GroupType.register("group"); assertEquals(GroupType.GROUP, type1); - assertTrue(GroupType.GROUP == type1); + assertSame(GroupType.GROUP, type1); } } \ No newline at end of file diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestColorUtils.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestColorUtils.java index e2cbb11..8896ca9 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestColorUtils.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestColorUtils.java @@ -1,20 +1,24 @@ package org.pathvisio.libgpml.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.awt.Color; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import junit.framework.TestCase; +import org.junit.jupiter.api.Test; /** * Tests for ColorUtils class. * * @author finterly */ -public class TestColorUtils extends TestCase { - - public void testHexToColorToHex() { +class TestColorUtils { + + @Test + void hexToColorToHex() { // hex strings tests List hexTests = new ArrayList(Arrays.asList("#b4b46419", "#00000000", "#ffffff")); // color object equivalent of hex string tests @@ -35,8 +39,9 @@ public void testHexToColorToHex() { } } - - public void testStringToColor() { + + @Test + void stringToColor() { // strings tests List strTests = new ArrayList(Arrays.asList("white", "Transparent", "blue")); // color object equivalent of hex string tests @@ -52,8 +57,9 @@ public void testStringToColor() { assertEquals(color.getAlpha(), colorTests.get(i).getAlpha()); } } - - public void testTransparency() { + + @Test + void transparency() { Color color = ColorUtils.hexToColor("00000000"); Color color2 = ColorUtils.hexToColor("ffffff00"); assertTrue(ColorUtils.isTransparent(color)); diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestGroupRectPropertyUtils.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestGroupRectPropertyUtils.java index 0a38cf2..0d9c391 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestGroupRectPropertyUtils.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestGroupRectPropertyUtils.java @@ -17,16 +17,17 @@ package org.pathvisio.libgpml.util; -import junit.framework.TestCase; +import org.junit.jupiter.api.Test; /** * Tests for GroupRectPropertyUtils class, the utility class for finding group bounds. * * @author finterly */ -public class TestGroupRectPropertyUtils extends TestCase { +class TestGroupRectPropertyUtils { - public void testGroupRectPropertyCalculation() { + @Test + void groupRectPropertyCalculation() { // Group group = new Group(); // diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestXrefUtils.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestXrefUtils.java index 59cfa2c..ffbc018 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestXrefUtils.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/util/TestXrefUtils.java @@ -1,19 +1,24 @@ package org.pathvisio.libgpml.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + + import org.bridgedb.DataSource; import org.bridgedb.Xref; import org.bridgedb.bio.DataSourceTxt; - -import junit.framework.TestCase; +import org.junit.jupiter.api.Test; /** * Tests for XrefUtils class. * * @author finterly */ -public class TestXrefUtils extends TestCase { +class TestXrefUtils { - public void testBridgeDb() { + @Test + void bridgeDb() { if (!DataSource.fullNameExists("Affy")) DataSourceTxt.init(); @@ -28,14 +33,15 @@ public void testBridgeDb() { Xref xref1 = XrefUtils.createXref("123", "doid"); - assertEquals(XrefUtils.getXrefDataSourceStr(xref1.getDataSource()), "doid"); + assertEquals("doid", XrefUtils.getXrefDataSourceStr(xref1.getDataSource())); } /** * Tests the method for checking if Xrefs are equal */ - public void testEquivalentXrefs() { + @Test + void equivalentXrefs() { if (!DataSource.fullNameExists("Ensembl")) DataSourceTxt.init(); Xref xref00 = null; From 155f487eb6f23fa39ad9386ea591e93b92011c4d Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 15:31:45 +0100 Subject: [PATCH 08/10] Updated config for codecov --- .github/workflows/maven.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 117fa01..3e345b9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -41,5 +41,7 @@ jobs: run: cd org.pathvisio.lib; mvn clean install -Dgpg.skip -Pjacoco - name: push JaCoCo stats to codecov.io uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + directory: 'org.pathvisio.lib' + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} From 74e43ec68dfd4efabe9241cb15aea2feabb9264d Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 15:39:32 +0100 Subject: [PATCH 09/10] Method should not be static --- .../test/java/org/pathvisio/libgpml/model/TestTemporary.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java index 5329e4f..9d77aca 100644 --- a/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java +++ b/org.pathvisio.lib/src/test/java/org/pathvisio/libgpml/model/TestTemporary.java @@ -13,7 +13,7 @@ class TestTemporary { * Temporary place for testing various methods. */ @Test - static void testThis() { + void testThis() { // PathwayModel p = new PathwayModel(); // Interaction line = new Interaction(); From f11c3575dda5223e97d29c4395453defbb228105 Mon Sep 17 00:00:00 2001 From: Egon Willighagen Date: Sat, 27 Dec 2025 15:42:33 +0100 Subject: [PATCH 10/10] Added missing JavaDoc descriptions --- .../java/org/pathvisio/libgpml/model/GPML2013aWriter.java | 6 +++--- .../java/org/pathvisio/libgpml/model/GPMLFormatWriter.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPML2013aWriter.java b/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPML2013aWriter.java index 6b74bba..dd2d71e 100644 --- a/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPML2013aWriter.java +++ b/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPML2013aWriter.java @@ -85,7 +85,7 @@ protected GPML2013aWriter(String xsdFile, Namespace nsGPML) { * @param validate if true, validate the dom structure before writing. If * there is a validation error, or the xsd is not in the * classpath, an exception will be thrown. - * @throws ConverterException + * @throws ConverterException when an {@link IOException} when the XML code is sent to the output stream */ @Override public void writeToXml(PathwayModel pathwayModel, OutputStream output, boolean validate) throws ConverterException { @@ -120,7 +120,7 @@ public void writeToXml(PathwayModel pathwayModel, OutputStream output, boolean v * @param file the file to which the JDOM document should be saved. * @param validate if true, validate the dom structure before writing to * file. - * @throws ConverterException + * @throws ConverterException when an {@link IOException} happened during the creation of a {@link FileOutputStream} */ @Override public void writeToXml(PathwayModel pathwayModel, File file, boolean validate) throws ConverterException { @@ -138,7 +138,7 @@ public void writeToXml(PathwayModel pathwayModel, File file, boolean validate) t * pathwayModel {@link PathwayModel} data. * * @param pathwayModel the pathway model to be written. - * @throws ConverterException + * @throws ConverterException when an {@link IOException} happened during the creation of a Jdom */ @Override public Document createJdom(PathwayModel pathwayModel) throws ConverterException { diff --git a/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPMLFormatWriter.java b/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPMLFormatWriter.java index 260165d..1f8d5af 100644 --- a/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPMLFormatWriter.java +++ b/org.pathvisio.lib/src/main/java/org/pathvisio/libgpml/model/GPMLFormatWriter.java @@ -34,7 +34,7 @@ public interface GPMLFormatWriter extends GPMLFormatVersion { * * @param pathwayModel the pathway model. * @return - * @throws ConverterException + * @throws ConverterException when an exception happened during the conversion */ Document createJdom(PathwayModel pathwayModel) throws ConverterException; @@ -44,7 +44,7 @@ public interface GPMLFormatWriter extends GPMLFormatVersion { * @param pathwayModel the pathway model. * @param file the file to write to. * @param validate if true, validate. - * @throws ConverterException + * @throws ConverterException when an exception happened during the conversion */ void writeToXml(PathwayModel pathwayModel, File file, boolean validate) throws ConverterException; @@ -54,7 +54,7 @@ public interface GPMLFormatWriter extends GPMLFormatVersion { * @param pathwayModel the pathway model. * @param out the output stream. * @param validate if true, validate. - * @throws ConverterException + * @throws ConverterException when an exception happened during the conversion */ void writeToXml(PathwayModel pathwayModel, OutputStream out, boolean validate) throws ConverterException;