From 6cf472b970b0a2112601198c0c239d88b8c60954 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Fri, 23 Sep 2016 11:28:41 +0200 Subject: Make JUint test not inherit from TestCase Change-Id: Ic627b67c1e9c0830708dba475c911e0c478887aa --- .../plugins/replication/GitUpdateProcessingTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java b/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java index 4cbac3a..21ee4b5 100644 --- a/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java +++ b/src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java @@ -32,15 +32,15 @@ import com.google.gwtorm.server.StandardKeyEncoder; import com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing; import com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult; -import junit.framework.TestCase; - import org.eclipse.jgit.transport.RemoteRefUpdate; import org.eclipse.jgit.transport.URIish; +import org.junit.Before; +import org.junit.Test; import java.net.URISyntaxException; @SuppressWarnings("unchecked") -public class GitUpdateProcessingTest extends TestCase { +public class GitUpdateProcessingTest { static { KeyUtil.setEncoderImpl(new StandardKeyEncoder()); } @@ -48,9 +48,8 @@ public class GitUpdateProcessingTest extends TestCase { private EventDispatcher dispatcherMock; private GitUpdateProcessing gitUpdateProcessing; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { dispatcherMock = createMock(EventDispatcher.class); replay(dispatcherMock); ReviewDb reviewDbMock = createNiceMock(ReviewDb.class); @@ -61,6 +60,7 @@ public class GitUpdateProcessingTest extends TestCase { gitUpdateProcessing = new GitUpdateProcessing(dispatcherMock); } + @Test public void testHeadRefReplicated() throws URISyntaxException, OrmException { reset(dispatcherMock); RefReplicatedEvent expectedEvent = @@ -76,6 +76,7 @@ public class GitUpdateProcessingTest extends TestCase { verify(dispatcherMock); } + @Test public void testChangeRefReplicated() throws URISyntaxException, OrmException { reset(dispatcherMock); RefReplicatedEvent expectedEvent = @@ -91,6 +92,7 @@ public class GitUpdateProcessingTest extends TestCase { verify(dispatcherMock); } + @Test public void testOnAllNodesReplicated() throws OrmException { reset(dispatcherMock); RefReplicationDoneEvent expectedDoneEvent = -- cgit v1.2.3