summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authormcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2008-12-02 15:18:47 +0000
committermcombellack <mcombellack@13f79535-47bb-0310-9956-ffa450edef68>2008-12-02 15:18:47 +0000
commit09d417d754c70f2c267abd7675ef2f962129c671 (patch)
tree5983d4d25d218121d7bc72b62b4b0c919a9b07f9 /java
parentd7eaeda0e69a81759abb2fc855a8ebc120653fee (diff)
Converted unit tests from JUnit 3 to JUnit 4
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@722494 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java19
-rw-r--r--java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java7
-rw-r--r--java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java11
3 files changed, 24 insertions, 13 deletions
diff --git a/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java b/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java
index 61164fa2de..b1a91df515 100644
--- a/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java
+++ b/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java
@@ -21,17 +21,21 @@ package org.apache.tuscany.sca.core.invocation;
import java.util.Arrays;
import java.util.List;
-import junit.framework.TestCase;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
-public class PhaseSorterTestCase extends TestCase {
+public class PhaseSorterTestCase {
private PhaseSorter<String> graph;
- @Override
- protected void setUp() throws Exception {
- super.setUp();
+ @Before
+ public void setUp() throws Exception {
graph = new PhaseSorter<String>();
}
+ @Test
public void testSort() {
graph.addEdge("a", "b");
graph.addEdge("a", "c");
@@ -55,9 +59,8 @@ public class PhaseSorterTestCase extends TestCase {
assertTrue(graph.getVertices().isEmpty());
}
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
+ @After
+ public void tearDown() throws Exception {
}
}
diff --git a/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java b/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java
index 1ad0927d16..81173b5e96 100644
--- a/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java
+++ b/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java
@@ -18,7 +18,7 @@
*/
package org.apache.tuscany.sca.core.wire;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
import org.apache.tuscany.sca.core.invocation.InvocationChainImpl;
import org.apache.tuscany.sca.interfacedef.Operation;
@@ -28,12 +28,14 @@ import org.apache.tuscany.sca.invocation.InvocationChain;
import org.apache.tuscany.sca.invocation.Invoker;
import org.apache.tuscany.sca.invocation.Message;
import org.apache.tuscany.sca.invocation.Phase;
+import org.junit.Test;
/**
* @version $Rev$ $Date$
*/
-public class InvocationChainImplTestCase extends TestCase {
+public class InvocationChainImplTestCase {
+ @Test
public void testInsertAtEnd() throws Exception {
Operation op = newOperation("foo");
InvocationChain chain = new InvocationChainImpl(op, op, true);
@@ -48,6 +50,7 @@ public class InvocationChainImplTestCase extends TestCase {
}
+ @Test
public void testAddByPhase() throws Exception {
Operation op = newOperation("foo");
InvocationChain chain = new InvocationChainImpl(op, op, false);
diff --git a/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java b/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
index 341d889b7d..ca7bf9b3d7 100644
--- a/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
+++ b/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
@@ -18,32 +18,37 @@
*/
package org.apache.tuscany.sca.scope;
-import junit.framework.TestCase;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import org.apache.tuscany.sca.core.scope.Scope;
-
+import org.junit.Test;
/**
* @version $Rev$ $Date$
*/
-public class ScopeTestCase extends TestCase {
+public class ScopeTestCase {
+ @Test
public void testEquals() throws Exception {
Scope scope = new Scope("COMPOSITE");
assertTrue(scope.equals(Scope.COMPOSITE));
}
+ @Test
public void testEqualsNew() throws Exception {
Scope foo = new Scope("foo");
Scope foo2 = new Scope("FOO");
assertTrue(foo.equals(foo2));
}
+ @Test
public void testNotEquals() throws Exception {
Scope foo = new Scope("BAR");
Scope foo2 = new Scope("FOO");
assertFalse(foo.equals(foo2));
}
+ @Test
public void testNotEqualsDifferent() throws Exception {
Scope foo = new Scope("FOO");
assertFalse(foo.equals(new Bar("FOO")));