summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/itest
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-15 16:53:20 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-15 16:53:20 +0000
commit215d3dd6dcdf0278684890ce56187c62d1747d8c (patch)
treed374dad8c4c1b275b86b6f66b5f01c2a3a972243 /sca-java-2.x/trunk/itest
parent6b51b7c94e2859e7bca4440d29f918d5cd4e9f87 (diff)
Add a test case to show that Deployer can report problems through the monitor framework instead of runtime
exceptions git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@923335 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/itest')
-rw-r--r--sca-java-2.x/trunk/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java b/sca-java-2.x/trunk/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java
index 18fb9394bf..8f512beae2 100644
--- a/sca-java-2.x/trunk/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java
+++ b/sca-java-2.x/trunk/itest/scdl/src/test/java/org/apache/tuscany/sca/itest/scdl/SCDLTestCase.java
@@ -19,7 +19,9 @@
package org.apache.tuscany.sca.itest.scdl;
+import java.net.URI;
import java.net.URL;
+import java.util.Arrays;
import javax.xml.stream.XMLStreamException;
@@ -31,11 +33,14 @@ import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.binding.jms.JMSBinding;
import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
import org.apache.tuscany.sca.binding.rmi.RMIBinding;
+import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.deployment.Deployer;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
import org.junit.Test;
/**
@@ -83,5 +88,22 @@ public class SCDLTestCase {
// WSBinding wsBinding = wsService.getBinding(WSBinding.class);
// Assert.assertNotNull(wsBinding);
}
+
+ @Test
+ public void testBuild() throws Exception {
+ ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
+ Deployer deployer = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(Deployer.class);
+ URL r = getClass().getResource("/test.composite");
+ r = new URL(r, "../");
+ Monitor monitor = deployer.createMonitor();
+ Contribution contribution = deployer.loadContribution(URI.create("c1"), r, monitor);
+ deployer.build(Arrays.asList(contribution), null, monitor);
+ int i = 0;
+ for (Problem p : monitor.getProblems()) {
+ System.err.println(i + ": " + p);
+ i++;
+ }
+ Assert.assertTrue(i > 0);
+ }
}