diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-10 22:28:22 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-10 22:28:22 +0000 |
commit | 9134aecc4e049bfa5df2fc2f17c90f3088b1e2f1 (patch) | |
tree | d17cd7f2330bd4b216069eeaea49f93324c21711 /branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java | |
parent | 267c37371ae406d89c59fe039d45a13f09472047 (diff) |
Restrict Export-Package and convert test cases to Junit 4
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@703589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java')
-rw-r--r-- | branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java b/branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java index dfb600153e..6edfbb78b6 100644 --- a/branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java +++ b/branches/sca-equinox/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java @@ -18,45 +18,52 @@ */ package org.apache.tuscany.sca.contribution.services; -import java.net.URL; +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNull; -import junit.framework.TestCase; +import java.net.URL; import org.apache.tuscany.sca.contribution.PackageType; import org.apache.tuscany.sca.contribution.service.impl.PackageTypeDescriberImpl; +import org.junit.BeforeClass; +import org.junit.Test; -public class PackageTypeDescriberImplTestCase extends TestCase { - private PackageTypeDescriberImpl packageTypeDescriber; +public class PackageTypeDescriberImplTestCase { + private static PackageTypeDescriberImpl packageTypeDescriber; + @Test public void testResolveArchivePackageType() throws Exception { URL artifactURL = getClass().getResource("/deployables/sample-calculator.jar"); assertEquals(PackageType.JAR, this.packageTypeDescriber.getType(artifactURL, null)); } + @Test public void testResolveFolderPackageType() throws Exception { URL artifactURL = getClass().getResource("/deployables/"); assertEquals(PackageType.FOLDER, this.packageTypeDescriber.getType(artifactURL, null)); } + @Test public void testResolveFolder2PackageType() throws Exception { URL artifactURL = getClass().getResource("/deployables"); assertEquals(PackageType.FOLDER, this.packageTypeDescriber.getType(artifactURL, null)); } - + @Test public void testResolveUnknownPackageType() throws Exception { URL artifactURL = getClass().getResource("/test.ext"); assertNull(this.packageTypeDescriber.getType(artifactURL, null)); } - + + @Test public void testDefaultPackageType() throws Exception { URL artifactURL = getClass().getResource("/test.ext"); - assertEquals("application/vnd.tuscany.ext", - packageTypeDescriber.getType(artifactURL, "application/vnd.tuscany.ext")); + assertEquals("application/vnd.tuscany.ext", packageTypeDescriber.getType(artifactURL, + "application/vnd.tuscany.ext")); } - @Override - protected void setUp() throws Exception { + @BeforeClass + public static void setUp() throws Exception { packageTypeDescriber = new PackageTypeDescriberImpl(); } |