- Timestamp:
- 2017-04-15T20:20:00+02:00 (8 years ago)
- Location:
- trunk
- Files:
-
- 14 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.classpath
r11728 r11921 21 21 <classpathentry kind="lib" path="test/lib/system-rules-1.16.1.jar"/> 22 22 <classpathentry kind="lib" path="test/lib/unitils-core/unitils-core-3.4.6.jar"/> 23 <classpathentry kind="lib" path="test/lib/commons-testing/commons-testing-2.1.0.jar"/> 23 24 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 24 25 <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/> -
trunk/src/org/openstreetmap/josm/Main.java
r11904 r11921 1221 1221 private static MasterWindowListener INSTANCE; 1222 1222 1223 /** 1224 * Returns the unique {@code MasterWindowListener} instance. 1225 * @return the unique {@code MasterWindowListener} instance 1226 */ 1223 1227 public static synchronized MasterWindowListener getInstance() { 1224 1228 if (INSTANCE == null) { -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r11389 r11921 539 539 * Class contains some auxiliary functions 540 540 */ 541 privatestatic final class EN {541 static final class EN { 542 542 private EN() { 543 543 // Hide implicit public constructor for utility class -
trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java
r11792 r11921 15 15 /** 16 16 * Helper class for handling OGC GetCapabilities documents 17 * 17 * @since 10993 18 18 */ 19 19 public final class GetCapabilitiesParseHelper { -
trunk/src/org/openstreetmap/josm/data/oauth/SignpostAdapters.java
r11453 r11921 18 18 19 19 private SignpostAdapters() { 20 // Hide constructor for utility classes 20 21 } 21 22 -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r9496 r11921 45 45 * this is a static utility class only 46 46 */ 47 private ConditionalOptionPaneUtil() {} 47 private ConditionalOptionPaneUtil() { 48 // Hide default constructor for utility classes 49 } 48 50 49 51 /** -
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r10055 r11921 38 38 */ 39 39 private ExceptionDialogUtil() { 40 // Hide default constructor for utility classes 40 41 } 41 42 -
trunk/src/org/openstreetmap/josm/gui/datatransfer/ClipboardUtils.java
r11746 r11921 34 34 35 35 private ClipboardUtils() { 36 // Hide default constructor for utility classes 36 37 } 37 38 -
trunk/src/org/openstreetmap/josm/tools/StreamUtils.java
r10718 r11921 16 16 * Utility class 17 17 */ 18 private StreamUtils() {} 18 private StreamUtils() { 19 // Hide default constructor for utility classes 20 } 19 21 20 22 /** -
trunk/src/org/openstreetmap/josm/tools/date/DateUtils.java
r11878 r11921 59 59 * Constructs a new {@code DateUtils}. 60 60 */ 61 pr otectedDateUtils() {61 private DateUtils() { 62 62 // Hide default constructor for utils classes 63 63 } -
trunk/test/unit/org/openstreetmap/josm/MainTest.java
r10966 r11921 14 14 import org.junit.Test; 15 15 import org.openstreetmap.josm.Main.DownloadParamType; 16 import org.openstreetmap.josm.Main.MasterWindowListener; 16 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 17 18 … … 81 82 assertNotNull(Main.toolbar); 82 83 } 84 85 /** 86 * Unit test of {@link Main.MasterWindowListener}. 87 */ 88 @Test 89 public void testMasterWindowListener() { 90 MasterWindowListener.setup(); 91 MasterWindowListener.teardown(); 92 assertNotNull(MasterWindowListener.getInstance()); 93 } 83 94 } -
trunk/test/unit/org/openstreetmap/josm/actions/OrthogonalizeActionTest.java
r10945 r11921 23 23 24 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 25 import net.trajano.commons.testing.UtilityClassTestUtil; 25 26 26 27 /** … … 34 35 @Rule 35 36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 36 public JOSMTestRules test = new JOSMTestRules() ;37 public JOSMTestRules test = new JOSMTestRules().projection(); 37 38 38 39 @Test(expected = OrthogonalizeAction.InvalidUserInputException.class) … … 84 85 } 85 86 87 /** 88 * Tests that {@code OrthogonalizeAction.EN} satisfies utility class criterias. 89 * @throws ReflectiveOperationException if an error occurs 90 */ 91 @Test 92 public void testUtilityClass() throws ReflectiveOperationException { 93 UtilityClassTestUtil.assertUtilityClassWellDefined(OrthogonalizeAction.EN.class); 94 } 95 86 96 DataSet performTest(String... search) throws Exception { 87 97 try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "orthogonalize.osm")) { -
trunk/test/unit/org/openstreetmap/josm/actions/SelectByInternalPointActionTest.java
r11324 r11921 21 21 22 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 23 import net.trajano.commons.testing.UtilityClassTestUtil; 23 24 24 25 /** … … 33 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 35 public JOSMTestRules rules = new JOSMTestRules().preferences().projection(); 36 37 /** 38 * Tests that {@code SelectByInternalPointAction} satisfies utility class criterias. 39 * @throws ReflectiveOperationException if an error occurs 40 */ 41 @Test 42 public void testUtilityClass() throws ReflectiveOperationException { 43 UtilityClassTestUtil.assertUtilityClassWellDefined(SelectByInternalPointAction.class); 44 } 35 45 36 46 /** -
trunk/test/unit/org/openstreetmap/josm/corrector/ReverseWayTagCorrectorTest.java
r11069 r11921 19 19 20 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 21 import net.trajano.commons.testing.UtilityClassTestUtil; 21 22 22 23 /** … … 31 32 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 33 public JOSMTestRules test = new JOSMTestRules(); 34 35 /** 36 * Tests that {@code ReverseWayTagCorrector.TagSwitcher} satisfies utility class criterias. 37 * @throws ReflectiveOperationException if an error occurs 38 */ 39 @Test 40 public void testUtilityClass() throws ReflectiveOperationException { 41 UtilityClassTestUtil.assertUtilityClassWellDefined(ReverseWayTagCorrector.TagSwitcher.class); 42 } 33 43 34 44 /** -
trunk/test/unit/org/openstreetmap/josm/data/CustomConfiguratorTest.java
r10962 r11921 18 18 import org.openstreetmap.josm.Main; 19 19 import org.openstreetmap.josm.TestUtils; 20 import org.openstreetmap.josm.data.CustomConfigurator.PreferencesUtils; 20 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 22 import org.openstreetmap.josm.tools.Utils; 22 23 23 24 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 25 import net.trajano.commons.testing.UtilityClassTestUtil; 24 26 25 27 /** … … 118 120 assertEquals(9, pref.getCollection("lorem_ipsum").size()); 119 121 } 122 123 /** 124 * Tests that {@code PreferencesUtils} satisfies utility class criterias. 125 * @throws ReflectiveOperationException if an error occurs 126 */ 127 @Test 128 public void testUtilityClass() throws ReflectiveOperationException { 129 UtilityClassTestUtil.assertUtilityClassWellDefined(PreferencesUtils.class); 130 } 120 131 } -
trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCacheManagerTest.java
r11324 r11921 16 16 17 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 import net.trajano.commons.testing.UtilityClassTestUtil; 18 19 19 20 /** … … 28 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 30 public JOSMTestRules test = new JOSMTestRules().preferences(); 31 32 /** 33 * Tests that {@code JCSCacheManager} satisfies utility class criterias. 34 * @throws ReflectiveOperationException if an error occurs 35 */ 36 @Test 37 public void testUtilityClass() throws ReflectiveOperationException { 38 UtilityClassTestUtil.assertUtilityClassWellDefined(JCSCacheManager.class); 39 } 30 40 31 41 /** -
trunk/test/unit/org/openstreetmap/josm/data/oauth/SignpostAdaptersTest.java
r10945 r11921 19 19 20 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 21 import net.trajano.commons.testing.UtilityClassTestUtil; 21 22 22 23 /** … … 34 35 private static HttpClient newClient() throws MalformedURLException { 35 36 return HttpClient.create(new URL("https://www.openstreetmap.org")); 37 } 38 39 /** 40 * Tests that {@code SignpostAdapters} satisfies utility class criterias. 41 * @throws ReflectiveOperationException if an error occurs 42 */ 43 @Test 44 public void testUtilityClass() throws ReflectiveOperationException { 45 UtilityClassTestUtil.assertUtilityClassWellDefined(SignpostAdapters.class); 36 46 } 37 47 -
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/ClipboardUtilsTest.java
r10604 r11921 21 21 22 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 23 import net.trajano.commons.testing.UtilityClassTestUtil; 23 24 24 25 /** … … 120 121 assertNull(ClipboardUtils.getSystemSelection()); 121 122 } 123 124 /** 125 * Tests that {@code ClipboardUtils} satisfies utility class criterias. 126 * @throws ReflectiveOperationException if an error occurs 127 */ 128 @Test 129 public void testUtilityClass() throws ReflectiveOperationException { 130 UtilityClassTestUtil.assertUtilityClassWellDefined(ClipboardUtils.class); 131 } 122 132 } -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactoryTest.java
r11562 r11921 6 6 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context; 7 7 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op; 8 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.PseudoClasses; 8 9 import org.openstreetmap.josm.testutils.JOSMTestRules; 9 10 10 11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 12 import net.trajano.commons.testing.UtilityClassTestUtil; 11 13 12 14 /** … … 30 32 ConditionFactory.createKeyValueCondition("name", "Rodovia ([A-Z]{2,3}-[0-9]{2,4}", Op.REGEX, Context.PRIMITIVE, false); 31 33 } 34 35 /** 36 * Tests that {@code PseudoClasses} satisfies utility class criterias. 37 * @throws ReflectiveOperationException if an error occurs 38 */ 39 @Test 40 public void testUtilityClass() throws ReflectiveOperationException { 41 UtilityClassTestUtil.assertUtilityClassWellDefined(PseudoClasses.class); 42 } 32 43 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
r10758 r11921 13 13 14 14 import org.junit.Assert; 15 import org.junit. BeforeClass;15 import org.junit.Rule; 16 16 import org.junit.Test; 17 import org.openstreetmap.josm.JOSMFixture;18 17 import org.openstreetmap.josm.TestUtils; 19 18 import org.openstreetmap.josm.gui.tagging.presets.items.Check; 20 19 import org.openstreetmap.josm.gui.tagging.presets.items.Key; 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 21 import org.xml.sax.SAXException; 22 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 22 24 23 25 /** … … 27 29 28 30 /** 29 * Setup test.31 * Setup rule 30 32 */ 31 @BeforeClass 32 public static void setUp() { 33 JOSMFixture.createUnitTestFixture().init(); 34 } 33 @Rule 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().platform(); 35 36 36 37 /** -
trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java
r10324 r11921 9 9 10 10 import org.junit.Assert; 11 import org.junit. BeforeClass;11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.JOSMFixture; 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 14 15 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 16 import net.trajano.commons.testing.UtilityClassTestUtil; 14 17 15 18 /** … … 19 22 20 23 /** 21 * Setup test.24 * Setup rule 22 25 */ 23 @BeforeClass 24 public static void setUp() { 25 JOSMFixture.createUnitTestFixture().init(); 26 @Rule 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(); 29 30 /** 31 * Tests that {@code CertificateAmendment} satisfies utility class criterias. 32 * @throws ReflectiveOperationException if an error occurs 33 */ 34 @Test 35 public void testUtilityClass() throws ReflectiveOperationException { 36 UtilityClassTestUtil.assertUtilityClassWellDefined(CertificateAmendment.class); 26 37 } 27 38 … … 58 69 @Test 59 70 public void testStartSSL() throws IOException { 60 connect("https://map.dgpsonline.eu", true);61 connect("https://www.startssl.com", true);71 // StartSSL is untrusted 72 connect("https://www.startssl.com", false); 62 73 } 63 74 -
trunk/test/unit/org/openstreetmap/josm/tools/FontsManagerTest.java
r11202 r11921 12 12 13 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 14 import net.trajano.commons.testing.UtilityClassTestUtil; 14 15 15 16 /** … … 42 43 } 43 44 } 45 46 /** 47 * Tests that {@code FontsManager} satisfies utility class criterias. 48 * @throws ReflectiveOperationException if an error occurs 49 */ 50 @Test 51 public void testUtilityClass() throws ReflectiveOperationException { 52 UtilityClassTestUtil.assertUtilityClassWellDefined(FontsManager.class); 53 } 44 54 } -
trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java
r11324 r11921 10 10 11 11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 12 import net.trajano.commons.testing.UtilityClassTestUtil; 12 13 13 14 /** … … 21 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 22 23 public JOSMTestRules rules = new JOSMTestRules().platform().projection().commands(); 24 25 /** 26 * Tests that {@code RightAndLefthandTraffic} satisfies utility class criterias. 27 * @throws ReflectiveOperationException if an error occurs 28 */ 29 @Test 30 public void testUtilityClass() throws ReflectiveOperationException { 31 UtilityClassTestUtil.assertUtilityClassWellDefined(RightAndLefthandTraffic.class); 32 } 23 33 24 34 /** -
trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
r11360 r11921 10 10 11 11 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 12 import net.trajano.commons.testing.UtilityClassTestUtil; 12 13 13 14 /** … … 23 24 24 25 /** 25 * Test of {@link Territories#getIso3166Codes} method. 26 * Tests that {@code Territories} satisfies utility class criterias. 27 * @throws ReflectiveOperationException if an error occurs 26 28 */ 27 29 @Test 28 public void testGetIso3166Codes() { 30 public void testUtilityClass() throws ReflectiveOperationException { 31 UtilityClassTestUtil.assertUtilityClassWellDefined(Territories.class); 32 } 33 34 /** 35 * Test of {@link Territories#isIso3166Code} method. 36 */ 37 @Test 38 public void testIsIso3166Code() { 29 39 check("Paris", new LatLon(48.8567, 2.3508), "EU", "FR", "FX"); 30 40 } -
trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
r11435 r11921 18 18 19 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 20 import net.trajano.commons.testing.UtilityClassTestUtil; 20 21 21 22 /** … … 29 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 31 public JOSMTestRules rules = new JOSMTestRules(); 32 33 /** 34 * Tests that {@code Utils} satisfies utility class criterias. 35 * @throws ReflectiveOperationException if an error occurs 36 */ 37 @Test 38 public void testUtilityClass() throws ReflectiveOperationException { 39 UtilityClassTestUtil.assertUtilityClassWellDefined(Utils.class); 40 } 31 41 32 42 /** -
trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
r11486 r11921 16 16 17 17 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 import net.trajano.commons.testing.UtilityClassTestUtil; 18 19 19 20 /** … … 30 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 32 public JOSMTestRules test = new JOSMTestRules().i18n().preferences(); 33 34 /** 35 * Tests that {@code DateUtils} satisfies utility class criterias. 36 * @throws ReflectiveOperationException if an error occurs 37 */ 38 @Test 39 public void testUtilityClass() throws ReflectiveOperationException { 40 UtilityClassTestUtil.assertUtilityClassWellDefined(DateUtils.class); 41 } 32 42 33 43 /** … … 209 219 } 210 220 } 211 212 /**213 * Unit test to reach 100% code coverage.214 */215 @Test216 @SuppressFBWarnings(value = "ISC_INSTANTIATE_STATIC_CLASS")217 public void testCoverage() {218 assertNotNull(new DateUtils());219 }220 221 }
Note:
See TracChangeset
for help on using the changeset viewer.