diff --git a/test/unit/org/openstreetmap/josm/plugins/datepicker/impl/GenericDateImplementationTest.java b/test/unit/org/openstreetmap/josm/plugins/datepicker/impl/GenericDateImplementationTest.java index b7be8c357..6873b8d45 100644 --- a/test/unit/org/openstreetmap/josm/plugins/datepicker/impl/GenericDateImplementationTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/datepicker/impl/GenericDateImplementationTest.java @@ -11,22 +11,16 @@ import java.util.Date; import java.util.stream.Stream; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; - import org.openstreetmap.josm.plugins.datepicker.IDatePicker; -import org.openstreetmap.josm.testutils.JOSMTestRules; /** * Test method for date implementations. * The {@link #getDatePickers} method should be updated when new date pickers are implemented. */ class GenericDateImplementationTest { - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules(); - static Stream getDatePickers() { Calendar minCalendar = Calendar.getInstance(); minCalendar.setTime(new Date(Long.MIN_VALUE)); diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListenerTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListenerTest.java index 5b052bff9..4eb27efd3 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListenerTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/MapillaryKeyListenerTest.java @@ -1,3 +1,4 @@ +// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.mapillary; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -7,7 +8,6 @@ import javax.swing.JPopupMenu; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.openstreetmap.josm.data.coor.LatLon; @@ -26,9 +26,10 @@ import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryImageUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryKeys; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryMapFeatureUtils; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; import org.openstreetmap.josm.testutils.annotations.BasicWiremock; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; /** * Test class for {@link MapillaryKeyListener} @@ -36,14 +37,14 @@ * @author Taylor Smock */ @BasicPreferences -@BasicWiremock // TODO remove when it is inheritable (see #21139) -@MapillaryURLWireMock +@BasicWiremock +@Main @MapillaryLayerAnnotation +@MapillaryURLWireMock +@Projection class MapillaryKeyListenerTest { /** This is the JOSM standard component count. Update as needed. */ private static final int TAG_MENU_COMPONENT_COUNT = 15; - @RegisterExtension - static JOSMTestRules josmTestRules = new JOSMTestRules().main().projection(); @Test void testListenerNoSpuriousActions() throws ReflectiveOperationException { diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/MapObjectLayerActionTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/MapObjectLayerActionTest.java index a6ef3de38..8b14af5b3 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/MapObjectLayerActionTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/MapObjectLayerActionTest.java @@ -4,23 +4,21 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.MainApplication; import org.openstreetmap.josm.gui.layer.OsmDataLayer; import org.openstreetmap.josm.plugins.mapillary.gui.layer.PointObjectLayer; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMock; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMockErrors; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; @BasicPreferences +@Main @MapillaryURLWireMock +@Projection class MapObjectLayerActionTest { - - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules().main().projection(); - @Test @MapillaryURLWireMockErrors void testAction() { diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java index 3c66f3fd3..b1c8571aa 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCacheTest.java @@ -18,7 +18,6 @@ import org.awaitility.Awaitility; import org.awaitility.Durations; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.openstreetmap.josm.TestUtils; import org.openstreetmap.josm.data.cache.ICachedLoaderListener; import org.openstreetmap.josm.data.coor.LatLon; @@ -34,19 +33,18 @@ import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMockErrors; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryImageUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillarySequenceUtils; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.tools.Logging; @AwaitThreadFinish @BasicPreferences +@Main @MapillaryCaches @MapillaryURLWireMock +@Projection class MapillaryCacheTest { - - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules().main().projection(); - @Test void test() throws ExecutionException, InterruptedException, TimeoutException { // Use 135511895288847 since that is an image we have real information for diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructionsTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructionsTest.java index d73c6e96f..6259a8cd7 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructionsTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructionsTest.java @@ -1,3 +1,4 @@ +// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.mapillary.data.mapillary; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -9,14 +10,14 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.openstreetmap.josm.command.Command; import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Node; import org.openstreetmap.josm.data.osm.Way; -import org.openstreetmap.josm.testutils.JOSMTestRules; +import org.openstreetmap.josm.testutils.annotations.AssumeRevision; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Projection; /** * Test class for {@link AdditionalInstructions} @@ -24,9 +25,8 @@ * @author Taylor Smock */ @BasicPreferences +@Projection class AdditionalInstructionsTest { - @RegisterExtension - static JOSMTestRules josmTestRules = new JOSMTestRules().projection(); private DataSet dataSet; @BeforeEach @@ -55,13 +55,13 @@ void testApplyNull() { assertNull(this.snapToRoad.apply(node)); } - @JOSMTestRules.OverrideAssumeRevision("18108\n") + @AssumeRevision("18108\n") @Test void testApplyHighway() { this.applyHighwayCommon(); } - @JOSMTestRules.OverrideAssumeRevision("18109\n") + @AssumeRevision("18109\n") @Test void testApplyHighway18109() { this.applyHighwayCommon(); diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetectionsTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetectionsTest.java index 4dfb5751e..6e1771e43 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetectionsTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetectionsTest.java @@ -12,24 +12,22 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.openstreetmap.josm.actions.ExpertToggleAction; import org.openstreetmap.josm.plugins.mapillary.gui.DeveloperToggleAction; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.ObjectDetectionsAnnotation; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.TaggingPresets; /** * Test class for {@link ObjectDetections} */ @BasicPreferences @ObjectDetectionsAnnotation +@TaggingPresets class ObjectDetectionsTest { - @RegisterExtension - static JOSMTestRules rule = new JOSMTestRules().presets(); static Field osmKey; @BeforeAll diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListenerTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListenerTest.java index eafbeeb61..c99eea43b 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListenerTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListenerTest.java @@ -21,7 +21,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.openstreetmap.josm.data.Bounds; @@ -52,15 +51,16 @@ import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryKeys; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryMapFeatureUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryProperties; -import org.openstreetmap.josm.testutils.JOSMTestRules; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; /** * Test class for {@link DataMouseListener} */ +@Main @MapillaryURLWireMock +@Projection class DataMouseListenerTest { - @RegisterExtension - static JOSMTestRules josmTestRules = new JOSMTestRules().main().projection(); private DataMouseListener dataMouseListener; private OsmDataLayer osmDataLayer; diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSettingTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSettingTest.java index 3f84ccabf..a3cd90913 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSettingTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSettingTest.java @@ -24,7 +24,6 @@ import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -34,16 +33,13 @@ import org.openstreetmap.josm.data.preferences.StringProperty; import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryProperties; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; import org.openstreetmap.josm.tools.I18n; @BasicPreferences +@Main class MapillaryPreferenceSettingTest { - - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules().main(); - @Test void testAddGui() { PreferenceTabbedPane tabs = new PreferenceTabbedPane(); diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayerTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayerTest.java index 0a0aa87e8..10131b103 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayerTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayerTest.java @@ -20,7 +20,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.openstreetmap.gui.jmapviewer.interfaces.TileSource; import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.imagery.ImageryInfo; @@ -40,18 +39,17 @@ import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMockErrors; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryImageUtils; import org.openstreetmap.josm.plugins.mapillary.utils.api.JsonImageDetailsDecoderTest; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; @BasicPreferences +@Main @MapillaryLayerAnnotation @MapillaryURLWireMock @MapillaryURLWireMockErrors +@Projection class MapillaryLayerTest { - - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules().main().projection(); - private static Layer getDummyLayer() { return ImageryLayer.create(new ImageryInfo("dummy", "https://example.org")); } diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayerTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayerTest.java index beb5ee75e..5c246e331 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayerTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/gui/layer/PointObjectLayerTest.java @@ -13,25 +13,25 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.api.Timeout; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.gui.MainApplication; import org.openstreetmap.josm.gui.layer.OsmDataLayer; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.AwaitThreadFinish; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryLayerAnnotation; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryKeys; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; -@BasicPreferences @AwaitThreadFinish +@BasicPreferences +@Main @MapillaryLayerAnnotation +@Projection +@Timeout(20) class PointObjectLayerTest { - - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules().timeout(20000).projection().main(); - private PointObjectLayer instance; private static WireMockServer wmRule; diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/io/remotecontrol/MapillaryRemoteControlTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/io/remotecontrol/MapillaryRemoteControlTest.java index cbc146eca..b48ec8622 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/io/remotecontrol/MapillaryRemoteControlTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/io/remotecontrol/MapillaryRemoteControlTest.java @@ -16,7 +16,6 @@ import org.awaitility.Awaitility; import org.awaitility.Durations; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -30,8 +29,9 @@ import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryLayerAnnotation; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMock; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryImageUtils; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; /** * Test class for {@link MapillaryRemoteControl} @@ -40,13 +40,11 @@ */ @AwaitThreadFinish @BasicPreferences -@MapillaryURLWireMock +@Main @MapillaryLayerAnnotation +@MapillaryURLWireMock +@Projection class MapillaryRemoteControlTest { - // Needed for layer clearing. And Main. - @RegisterExtension - static JOSMTestRules josmTestRules = new JOSMTestRules().main().projection(); - @Test void testGetMandatoryParams() { assertEquals(0, new MapillaryRemoteControl().getMandatoryParams().length); diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/model/ImageDetectionTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/model/ImageDetectionTest.java index fbf097586..093010c8e 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/model/ImageDetectionTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/model/ImageDetectionTest.java @@ -10,21 +10,16 @@ import java.util.stream.Stream; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.openstreetmap.josm.plugins.mapillary.data.mapillary.ObjectDetections; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryCaches; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMock; -import org.openstreetmap.josm.testutils.JOSMTestRules; @MapillaryURLWireMock @MapillaryCaches class ImageDetectionTest { - @RegisterExtension - static JOSMTestRules josmTestRules = new JOSMTestRules(); - @Test void testBasics() { ImageDetection id = new ImageDetection<>(new Path2D.Double(), 1, 2, "value"); diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/testutils/annotations/AwaitThreadFinish.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/testutils/annotations/AwaitThreadFinish.java index bfd267073..5ae059ed6 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/testutils/annotations/AwaitThreadFinish.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/testutils/annotations/AwaitThreadFinish.java @@ -1,3 +1,4 @@ +// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.mapillary.testutils.annotations; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -19,6 +20,7 @@ import org.junit.jupiter.api.extension.ExtensionContext; import org.openstreetmap.josm.gui.MainApplication; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils; +import org.openstreetmap.josm.testutils.annotations.ThreadSync; /** * An annotation that waits for threads to finish before continuing @@ -29,6 +31,7 @@ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.TYPE, ElementType.METHOD }) @ExtendWith(AwaitThreadFinish.AwaitThreadFinishExtension.class) +@ExtendWith(ThreadSync.ThreadSyncExtension.class) public @interface AwaitThreadFinish { /** * An extension that waits for threads to finish, and then continues diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonSequencesDecoderTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonSequencesDecoderTest.java index 5ef070292..227406097 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonSequencesDecoderTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonSequencesDecoderTest.java @@ -20,7 +20,6 @@ import jakarta.json.JsonReader; import jakarta.json.JsonValue; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.NullSource; import org.junit.jupiter.params.provider.ValueSource; @@ -30,14 +29,12 @@ import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMock; import org.openstreetmap.josm.plugins.mapillary.testutils.annotations.MapillaryURLWireMockErrors; import org.openstreetmap.josm.plugins.mapillary.utils.TestUtil; -import org.openstreetmap.josm.testutils.JOSMTestRules; +import org.openstreetmap.josm.testutils.annotations.Main; +@Main @MapillaryCaches @MapillaryURLWireMock class JsonSequencesDecoderTest { - @RegisterExtension - static JOSMTestRules rules = new JOSMTestRules().main(); - @Test void testDecodeSequencesInvalid() throws IOException { // null input