summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authorvamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-04-03 21:09:42 +0000
committervamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-04-03 21:09:42 +0000
commitb66881ceea755b7a4f0313b58076c563c41161be (patch)
tree7056eb439f2e4f3ffe339b762ea425ebbbd14c48 /branches
parentde9bc569bc59080f65e69f37119320eeacae3cff (diff)
TUSCANY-2935 Integration tests for Java EE contribution processing
o Test non-enhanced EAR containing non-enhanced WAR, non-enhanced EJB JAR. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@761797 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/ContributionServiceTestCase.java25
-rw-r--r--branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app-ear.jarbin0 -> 16204 bytes
2 files changed, 25 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/ContributionServiceTestCase.java b/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/ContributionServiceTestCase.java
index f57337ca93..7eb27022f8 100644
--- a/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/ContributionServiceTestCase.java
+++ b/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/ContributionServiceTestCase.java
@@ -34,6 +34,7 @@ import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.contribution.service.ContributionService;
import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
import org.apache.tuscany.sca.implementation.ejb.EJBImplementation;
+import org.apache.tuscany.sca.implementation.jee.JEEImplementation;
import org.apache.tuscany.sca.implementation.web.WebImplementation;
import org.junit.Before;
import org.junit.Ignore;
@@ -54,6 +55,8 @@ public class ContributionServiceTestCase {
private static final String WAR_CONTRIBUTION = "/repository/helloworld-web.war";
private static final String WAR_W_DEPLOYABLE_CONTRIBUTION = "/repository/helloworld-web-w-dep.war";
private static final String EAR_CONTRIBUTION = "/repository/helloworld-ejb.ear";
+ private static final String EAR_NONENHANCED_CONTRIBUTION = "/repository/simple-app-ear.jar";
+
private ClassLoader cl;
private EmbeddedSCADomain domain;
@@ -237,4 +240,26 @@ public class ContributionServiceTestCase {
contributionService.contribute(contributionId, contributionLocation, false);
Assert.assertNotNull(contributionService.getContribution(contributionId));
}
+
+ /**
+ * This method tests a JAR containing an EAR as a contribution.
+ * non-enhanced EAR containing non-enhanced WAR, non-enhanced EJB JAR.
+ */
+ @Test
+ public void testContributeEAR_NonEnhanced() throws Exception {
+ URL contributionLocation = getClass().getResource(EAR_NONENHANCED_CONTRIBUTION);
+ String contributionId = CONTRIBUTION_001_ID;
+ contributionService.contribute(contributionId, contributionLocation, false);
+ Contribution contribution = contributionService.getContribution(contributionId);
+ Assert.assertNotNull(contribution);
+ List<Composite> deployables = contribution.getDeployables();
+ Assert.assertEquals("Deployable composites", 1, deployables.size());
+ Composite composite = deployables.get(0);
+ Assert.assertEquals("Number of components", 1, composite.getComponents().size());
+ Component component = composite.getComponents().get(0);
+ Assert.assertTrue("Component with implementation.jee", component.getImplementation() instanceof JEEImplementation);
+ JEEImplementation jeeImpl = (JEEImplementation)component.getImplementation();
+ Assert.assertEquals("Number of services", 2, jeeImpl.getServices().size());
+ Assert.assertEquals("Number of references", 1, jeeImpl.getReferences().size());
+ }
}
diff --git a/branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app-ear.jar b/branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app-ear.jar
new file mode 100644
index 0000000000..24f55a5f63
--- /dev/null
+++ b/branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app-ear.jar
Binary files differ