diff options
Diffstat (limited to '')
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(); |