summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-11-18 20:10:05 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-11-18 20:10:05 +0000
commitbd0de2fd94cee619b4fc05ff3b9267e084184f01 (patch)
tree5163fba97d8d114ca87f20db432368fc8ed44c04
parent146d6718330958411e6b7709e3da9fcab106b576 (diff)
Convert two more test cases into JUNIT 4
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@718700 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java24
-rw-r--r--branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java15
2 files changed, 21 insertions, 18 deletions
diff --git a/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java b/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
index 7b44736d4b..d3e31eb570 100644
--- a/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
+++ b/branches/sca-equinox/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java
@@ -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() {
}
diff --git a/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java b/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
index 4194b4e79f..be64c65c45 100644
--- a/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
+++ b/branches/sca-equinox/modules/workspace-impl/src/test/java/org/apache/tuscany/sca/workspace/builder/impl/ContributionDependencyBuilderTestCase.java
@@ -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.contribution.namespace.NamespaceImportExportFactor
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();