summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2016-09-23 11:28:41 +0200
committerDavid Ostrovsky <david@ostrovsky.org>2016-09-23 11:29:20 +0200
commit6cf472b970b0a2112601198c0c239d88b8c60954 (patch)
tree4a8a3704c24b83df6d676703c556a75d392209a8
parent9411b6d9d37fbbd9a6bb98307bcb8f4f47c58f37 (diff)
Make JUint test not inherit from TestCase
-rw-r--r--src/test/java/com/googlesource/gerrit/plugins/replication/GitUpdateProcessingTest.java14
1 files 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 =