diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-01 22:26:23 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-10-01 22:26:23 +0200 |
commit | 34c3d369bb9365d368fff4c9cf8022655ebf229a (patch) | |
tree | 1a1cd10a8b33cf912cae0a05a23ccccc75061b5a /jdisc_core/src/test/java/com/yahoo | |
parent | 81286072eea21017cc4f24046bdcbe531c2f55b8 (diff) |
- Add deprecation warning for methods only used in tests to enable using final on members.
- assign the reference at the end of the constructor to avoid possibility for exceptions thrown leaving the reference hidden in the dark.
- Catch Throwable instead of RuntimException to avoid some exceptions to pass.
Diffstat (limited to 'jdisc_core/src/test/java/com/yahoo')
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/RequestTestCase.java | 2 | ||||
-rw-r--r-- | jdisc_core/src/test/java/com/yahoo/jdisc/core/ContainerSnapshotTestCase.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/RequestTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/RequestTestCase.java index ab92f5fdcca..e85d34b9982 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/RequestTestCase.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/RequestTestCase.java @@ -34,6 +34,7 @@ import static org.junit.Assert.fail; public class RequestTestCase { @Test + @SuppressWarnings("deprecation") public void requireThatAccessorsWork() throws BindingSetNotFoundException { MyTimer timer = new MyTimer(); timer.currentTime = 69; @@ -249,6 +250,7 @@ public class RequestTestCase { assertTrue(driver.close()); } + @SuppressWarnings("deprecation") private static void assertUri(CurrentContainer container, String requestUri, String expectedUri) { Request serverReq = new Request(container, URI.create(requestUri)); assertEquals(expectedUri, serverReq.getUri().toString()); diff --git a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ContainerSnapshotTestCase.java b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ContainerSnapshotTestCase.java index 0ea1040306c..d8f8087bd46 100644 --- a/jdisc_core/src/test/java/com/yahoo/jdisc/core/ContainerSnapshotTestCase.java +++ b/jdisc_core/src/test/java/com/yahoo/jdisc/core/ContainerSnapshotTestCase.java @@ -31,6 +31,7 @@ import static org.junit.Assert.assertTrue; public class ContainerSnapshotTestCase { @Test + @SuppressWarnings("deprecation") public void requireThatServerHandlerCanBeResolved() { TestDriver driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi(); ContainerBuilder builder = driver.newContainerBuilder(); @@ -63,6 +64,7 @@ public class ContainerSnapshotTestCase { } @Test + @SuppressWarnings("deprecation") public void requireThatClientHandlerCanBeResolved() { TestDriver driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi(); ContainerBuilder builder = driver.newContainerBuilder(); @@ -95,6 +97,7 @@ public class ContainerSnapshotTestCase { } @Test + @SuppressWarnings("deprecation") public void requireThatClientBindingsAreUsed() { TestDriver driver = TestDriver.newSimpleApplicationInstanceWithoutOsgi(); ContainerBuilder builder = driver.newContainerBuilder(); |