From f698c1ccc38646129ee4a15adacdf47942a24a52 Mon Sep 17 00:00:00 2001 From: Jan Srnicek Date: Mon, 21 Nov 2016 15:06:16 +0100 Subject: 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 --- .../hc2vpp/common/test/write/WriterCustomizerTest.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'vpp-common') 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 } } -- cgit 1.2.3-korg