diff options
author | Jan Srnicek <jsrnicek@cisco.com> | 2016-11-21 15:06:16 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-11-24 06:54:46 +0000 |
commit | f698c1ccc38646129ee4a15adacdf47942a24a52 (patch) | |
tree | 779e64002860a328f121dc3f2b958b8225c5c0c7 /vpp-common/vpp-translate-test/src/main/java/io | |
parent | 294d0ea77bd20d580405cc1470dc9a1078be7a5c (diff) |
HONEYCOMB-275 - compilation error with HC runner and setUp
Refactored setUp() method in WriteCustomizerTest
to not trigger http://errorprone.info/bugpattern/JUnit4SetUpNotRun
while used in combination with @RunWith(HoneycombTestRunner.class)
Change-Id: Iba56b39399ddd7678dda97e094e935a3f02dd22c
Signed-off-by: Jan Srnicek <jsrnicek@cisco.com>
Diffstat (limited to 'vpp-common/vpp-translate-test/src/main/java/io')
-rw-r--r-- | vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java index 7067a0c39..e3467e643 100644 --- a/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java +++ b/vpp-common/vpp-translate-test/src/main/java/io/fd/hc2vpp/common/test/write/WriterCustomizerTest.java @@ -16,17 +16,17 @@ package io.fd.hc2vpp.common.test.write; +import io.fd.hc2vpp.common.test.util.FutureProducer; +import io.fd.hc2vpp.common.test.util.NamingContextHelper; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.ModificationCache; import io.fd.honeycomb.translate.spi.write.WriterCustomizer; import io.fd.honeycomb.translate.write.WriteContext; -import io.fd.hc2vpp.common.test.util.FutureProducer; -import io.fd.hc2vpp.common.test.util.NamingContextHelper; +import io.fd.vpp.jvpp.core.future.FutureJVppCore; import org.junit.Before; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import io.fd.vpp.jvpp.core.future.FutureJVppCore; /** * Generic test for classes implementing {@link WriterCustomizer} interface. @@ -52,12 +52,18 @@ public abstract class WriterCustomizerTest implements FutureProducer, cache = new ModificationCache(); Mockito.doReturn(cache).when(writeContext).getModificationCache(); Mockito.doReturn(mappingContext).when(writeContext).getMappingContext(); - setUp(); + setUpTest(); } /** * Optional setup for subclasses. Invoked after parent initialization. */ - protected void setUp() throws Exception { + protected void setUpTest() throws Exception { + // this method would normally trigger this warning while compiling: + // + // "if test is using @RunWith(HoneycombTestRunner and if named setUp() : + // [JUnit4SetUpNotRun] setUpTest() method will not be run; Please add a @Before annotation" + // + // more details http://errorprone.info/bugpattern/JUnit4SetUpNotRun } } |