diff --git a/test/unit/io/parser/BIMtoOSMParserTest.java b/test/unit/io/parser/BIMtoOSMParserTest.java index cfbd1ee..1207d3c 100644 --- a/test/unit/io/parser/BIMtoOSMParserTest.java +++ b/test/unit/io/parser/BIMtoOSMParserTest.java @@ -1,27 +1,25 @@ // License: AGPL. For details, see LICENSE file. package io.parser; -import org.openstreetmap.josm.plugins.indoorhelper.io.parser.BIMtoOSMParser; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.jupiter.api.Disabled; -import org.openstreetmap.josm.TestUtils; - import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.TestUtils; +import org.openstreetmap.josm.plugins.indoorhelper.io.parser.BIMtoOSMParser; + /** * Unit tests of {@link BIMtoOSMParser} class. */ -@Ignore("Causes unexpected error in Jenkins build") @Disabled("Causes unexpected error in Jenkins build\n") -public class BIMtoOSMParserTest { +class BIMtoOSMParserTest { /** * Setup test. */ // @Rule -// public JOSMTestRules test = new JOSMTestRules().preferences(); +// JOSMTestRules test = new JOSMTestRules().preferences(); String pluginDir = System.getProperty("user.dir"); String resourcePathDir = TestUtils.getTestDataRoot(); @@ -30,7 +28,7 @@ public class BIMtoOSMParserTest { * Test case for {@link BIMtoOSMParser#parse} method. */ @Test - public void testParse() { + void testParse() { // IFC2X3 assertParseTrue("test1_IFC2X3_TC1.ifc"); assertParseTrue("test2_IFC2X3_TC1.ifc"); diff --git a/test/unit/io/parser/data/math/Matrix3DTest.java b/test/unit/io/parser/data/math/Matrix3DTest.java index 2774cf8..8b092dd 100644 --- a/test/unit/io/parser/data/math/Matrix3DTest.java +++ b/test/unit/io/parser/data/math/Matrix3DTest.java @@ -2,16 +2,16 @@ //import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; import org.openstreetmap.josm.plugins.indoorhelper.io.parser.math.Matrix3D; import org.openstreetmap.josm.plugins.indoorhelper.io.parser.math.Vector3D; -import org.junit.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; /** * Unit tests of {@link Matrix3D} class. */ -public class Matrix3DTest { +class Matrix3DTest { /** * Setup test */ @@ -35,7 +35,7 @@ public class Matrix3DTest { Vector3D matrix1TransformedPoint1 = new Vector3D(86.0, 105.8, 125.123); @Test - public void testTransform() { + void testTransform() { Vector3D v = new Vector3D(vector1); matrix1.transform(v); assertEquals(v.getX(), matrix1TransformedPoint1.getX(), 0.005); @@ -44,7 +44,7 @@ public void testTransform() { } @Test - public void testMultiply() { + void testMultiply() { Matrix3D m = new Matrix3D(matrix1); m.multiply(10.0); assertEquals(m.getM00(), matrix1.getM00() * 10.0, 0.005); @@ -75,25 +75,25 @@ public void testMultiply() { } @Test - public void testInvert() { + void testInvert() { Matrix3D m = new Matrix3D(matrix3); m.invert(); - assertEquals(m.getM00(), -(1.0 / 3.0), 0.005); - assertEquals(m.getM01(), 0.0, 0.005); - assertEquals(m.getM02(), (2.0 / 3.0), 0.005); + assertEquals(-(1.0 / 3.0), m.getM00(), 0.005); + assertEquals(0.0, m.getM01(), 0.005); + assertEquals((2.0 / 3.0), m.getM02(), 0.005); - assertEquals(m.getM10(), (2.0 / 3.0), 0.005); - assertEquals(m.getM11(), 0.0, 0.005); - assertEquals(m.getM12(), -(1.0 / 3.0), 0.005); + assertEquals((2.0 / 3.0), m.getM10(), 0.005); + assertEquals(0.0, m.getM11(), 0.005); + assertEquals(-(1.0 / 3.0), m.getM12(), 0.005); - assertEquals(m.getM20(), -2.0, 0.005); - assertEquals(m.getM21(), 1.0, 0.005); - assertEquals(m.getM22(), 0.0, 0.005); + assertEquals(-2.0, m.getM20(), 0.005); + assertEquals(1.0, m.getM21(), 0.005); + assertEquals(0.0, m.getM22(), 0.005); } @Test - public void testDet() { - assertEquals(matrix3.det(), 3.0); + void testDet() { + assertEquals(3.0, matrix3.det()); } } \ No newline at end of file diff --git a/test/unit/io/parser/optimizer/OutputOptimizerTest.java b/test/unit/io/parser/optimizer/OutputOptimizerTest.java index c47a613..d144277 100644 --- a/test/unit/io/parser/optimizer/OutputOptimizerTest.java +++ b/test/unit/io/parser/optimizer/OutputOptimizerTest.java @@ -1,29 +1,30 @@ package io.parser.optimizer; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import org.openstreetmap.josm.plugins.indoorhelper.io.optimizer.OutputOptimizer; -import org.junit.Test; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.Node; +import org.openstreetmap.josm.plugins.indoorhelper.io.optimizer.OutputOptimizer; import org.openstreetmap.josm.testutils.DatasetFactory; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @Disabled("Causes java.lang.SecurityException: class \"org.openstreetmap.josm.tools.MemoryManagerTest\"'s " + "signer information does not match signer information of other classes in the same package\n") -public class OutputOptimizerTest { +class OutputOptimizerTest { /** * Setup test. */ // @Rule -// public JOSMTestRules test = new JOSMTestRules().preferences(); +// JOSMTestRules test = new JOSMTestRules().preferences(); @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") - public ArrayList testNodes1 = new ArrayList() { + ArrayList testNodes1 = new ArrayList() { { add(new LatLon(50.81400880917, 12.9240191164)); add(new LatLon(50.81410474868, 12.92479892858)); @@ -44,7 +45,7 @@ public class OutputOptimizerTest { * Test case for {@link OutputOptimizer#optimize} method. */ @Test - public void testOptimize() { + void testOptimize() { // ArrayList nodes = llsToNodes(testNodes1); // ArrayList ways = new ArrayList<>(); // Pair, ArrayList> testData = new Pair<>(nodes, ways); diff --git a/test/unit/model/LevelRangeVerifierTest.java b/test/unit/model/LevelRangeVerifierTest.java index a396804..043a5b4 100644 --- a/test/unit/model/LevelRangeVerifierTest.java +++ b/test/unit/model/LevelRangeVerifierTest.java @@ -1,22 +1,22 @@ // License: AGPL. For details, see LICENSE file. package model; -import org.openstreetmap.josm.plugins.indoorhelper.model.LevelRangeVerifier; -import org.junit.Test; - import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.plugins.indoorhelper.model.LevelRangeVerifier; + /** * Unit tests of {@link LevelRangeVerifier} class. */ -public class LevelRangeVerifierTest { +class LevelRangeVerifierTest { /** * Test case for {@link LevelRangeVerifier#isPartOfWorkingLevel(String, int)} method. */ @Test - public void testIsPartOfWorkingLevel() { + void testIsPartOfWorkingLevel() { assertTrue(LevelRangeVerifier.isPartOfWorkingLevel("-3--1", -3)); assertTrue(LevelRangeVerifier.isPartOfWorkingLevel("-3--1", -2)); assertTrue(LevelRangeVerifier.isPartOfWorkingLevel("-3--1", -1)); diff --git a/test/unit/model/PresetCounterTest.java b/test/unit/model/PresetCounterTest.java index 03d5862..dc35779 100644 --- a/test/unit/model/PresetCounterTest.java +++ b/test/unit/model/PresetCounterTest.java @@ -1,25 +1,25 @@ // License: AGPL. For details, see LICENSE file. package model; -import org.openstreetmap.josm.plugins.indoorhelper.model.PresetCounter; -import org.openstreetmap.josm.plugins.indoorhelper.model.TagCatalog.IndoorObject; -import org.junit.Test; +import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.assertEquals; +import org.junit.jupiter.api.Test; +import org.openstreetmap.josm.plugins.indoorhelper.model.PresetCounter; +import org.openstreetmap.josm.plugins.indoorhelper.model.TagCatalog.IndoorObject; /** * Unit tests of {@link PresetCounter} class. */ -public class PresetCounterTest { +class PresetCounterTest { /** * Test case for testing the ranking functionality. */ @Test - public void testRanking() { + void testRanking() { // input preparation PresetCounter counter = new PresetCounter();