summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest/contribution-jee/src/test
diff options
context:
space:
mode:
authorvamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-04-03 21:28:04 +0000
committervamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68>2009-04-03 21:28:04 +0000
commit707688021dcefb93f9ceb7098d73dd695d7be7a8 (patch)
tree529f36a6192e861e1eb13de6f4e16ee7c9df9924 /branches/sca-java-1.x/itest/contribution-jee/src/test
parentb66881ceea755b7a4f0313b58076c563c41161be (diff)
TUSCANY-2935 Integration tests for Java EE contribution processing
o Test Enhanced EAR containing non-enhanced WAR, non-enhanced EJB JAR. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@761806 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/itest/contribution-jee/src/test')
-rw-r--r--branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/ContributionServiceTestCase.java23
-rw-r--r--branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app.earbin0 -> 16291 bytes
2 files changed, 23 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 7eb27022f8..918920a840 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
@@ -56,6 +56,7 @@ public class ContributionServiceTestCase {
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 static final String EAR_ENHANCED_16_CONTRIBUTION = "/repository/simple-app.ear";
private ClassLoader cl;
@@ -262,4 +263,26 @@ public class ContributionServiceTestCase {
Assert.assertEquals("Number of services", 2, jeeImpl.getServices().size());
Assert.assertEquals("Number of references", 1, jeeImpl.getReferences().size());
}
+
+ /**
+ * This method tests an EAR as a contribution.
+ * Enhanced EAR containing non-enhanced WAR, non-enhanced EJB JAR.
+ */
+ @Test
+ public void testContributeEAR_Enhanced16() throws Exception {
+ URL contributionLocation = getClass().getResource(EAR_ENHANCED_16_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 b/branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app.ear
new file mode 100644
index 0000000000..c912e64237
--- /dev/null
+++ b/branches/sca-java-1.x/itest/contribution-jee/src/test/resources/repository/simple-app.ear
Binary files differ