You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by mc...@apache.org on 2008/12/02 16:18:47 UTC
svn commit: r722494 - in
/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca:
core/invocation/PhaseSorterTestCase.java
core/wire/InvocationChainImplTestCase.java scope/ScopeTestCase.java
Author: mcombellack
Date: Tue Dec 2 07:18:47 2008
New Revision: 722494
URL: http://svn.apache.org/viewvc?rev=722494&view=rev
Log:
Converted unit tests from JUnit 3 to JUnit 4
Modified:
tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java
tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java
tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java?rev=722494&r1=722493&r2=722494&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java (original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/invocation/PhaseSorterTestCase.java Tue Dec 2 07:18:47 2008
@@ -21,17 +21,21 @@
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 @@
assertTrue(graph.getVertices().isEmpty());
}
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
+ @After
+ public void tearDown() throws Exception {
}
}
Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java?rev=722494&r1=722493&r2=722494&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java (original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java Tue Dec 2 07:18:47 2008
@@ -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.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 @@
}
+ @Test
public void testAddByPhase() throws Exception {
Operation op = newOperation("foo");
InvocationChain chain = new InvocationChainImpl(op, op, false);
Modified: tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java?rev=722494&r1=722493&r2=722494&view=diff
==============================================================================
--- tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java (original)
+++ tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java Tue Dec 2 07:18:47 2008
@@ -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")));