tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r718700 - in /tuscany/branches/sca-equinox/modules: core/src/test/java/org/apache/tuscany/sca/core/ workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/
Date Tue, 18 Nov 2008 20:10:05 GMT
Author: rfeng
Date: Tue Nov 18 12:10:05 2008
New Revision: 718700

URL: http://svn.apache.org/viewvc?rev=718700&view=rev
Log:
Convert two more test cases into JUNIT 4

Modified:
    tuscany/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
    tuscany/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java

Modified: tuscany/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java?rev=718700&r1=718699&r2=718700&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
(original)
+++ tuscany/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
Tue Nov 18 12:10:05 2008
@@ -19,30 +19,34 @@
 
 package org.apache.tuscany.sca.core;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 
-public class DefaultExtensionPointRegistryTestCase extends TestCase {
+import org.junit.Before;
+import org.junit.Test;
+
+public class DefaultExtensionPointRegistryTestCase {
     private ExtensionPointRegistry registry;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Before
+    public void setUp() throws Exception {
         registry = new DefaultExtensionPointRegistry();
     }
 
+    @Test
     public void testRegistry() {
-        MyRegistry service = new MyREgistryImpl();
+        MyExtensionPoint service = new MyExtensionPointImpl();
         registry.addExtensionPoint(service);
-        assertSame(service, registry.getExtensionPoint(MyRegistry.class));
+        assertSame(service, registry.getExtensionPoint(MyExtensionPoint.class));
         registry.removeExtensionPoint(service);
-        assertNull(registry.getExtensionPoint(MyRegistry.class));
+        assertNull(registry.getExtensionPoint(MyExtensionPoint.class));
     }
 
-    public static interface MyRegistry {
+    public static interface MyExtensionPoint {
         void doSomething();
     }
 
-    private static class MyREgistryImpl implements MyRegistry {
+    private static class MyExtensionPointImpl implements MyExtensionPoint {
 
         public void doSomething() {
         }

Modified: tuscany/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java?rev=718700&r1=718699&r2=718700&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
(original)
+++ tuscany/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
Tue Nov 18 12:10:05 2008
@@ -19,9 +19,9 @@
 
 package org.apache.tuscany.sca.workspace.builder.impl;
 
-import java.util.List;
+import static org.junit.Assert.assertTrue;
 
-import junit.framework.TestCase;
+import java.util.List;
 
 import org.apache.tuscany.sca.contribution.Contribution;
 import org.apache.tuscany.sca.contribution.ContributionFactory;
@@ -33,29 +33,28 @@
 import org.apache.tuscany.sca.workspace.DefaultWorkspaceFactory;
 import org.apache.tuscany.sca.workspace.Workspace;
 import org.apache.tuscany.sca.workspace.WorkspaceFactory;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Test the contribution dependency analyzer.
  * 
  * @version $Rev$ $Date$
  */
-public class ContributionDependencyBuilderTestCase extends TestCase {
+public class ContributionDependencyBuilderTestCase {
 
     private ContributionFactory contributionFactory;
     private WorkspaceFactory workspaceFactory;
     private NamespaceImportExportFactory importExportFactory;
 
-    @Override
+    @Before
     public void setUp() throws Exception {
         contributionFactory = new DefaultContributionFactory();
         workspaceFactory = new DefaultWorkspaceFactory();
         importExportFactory = new DefaultNamespaceImportExportFactory();
     }
 
-    @Override
-    public void tearDown() throws Exception {
-    }
-
+    @Test
     public void testAnalyze() throws Exception {
         Workspace workspace = workspaceFactory.createWorkspace();
         Contribution importer = contributionFactory.createContribution();



Mime
View raw message