summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-06-14 10:13:16 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2012-06-14 10:13:16 +0000
commit22e553ee877cd302cb592d409e8ecfd7a7a99fe3 (patch)
tree246ce84d34dc5c88404a330d85345baded65b0ed /sca-java-2.x
parentccb57216b27cfdcd14d24e7c56f9ddcb7849312f (diff)
Format the code, no other changes
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1350177 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DynamicTestCase.java41
1 files changed, 21 insertions, 20 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DynamicTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DynamicTestCase.java
index 6aaf621454..f05771e129 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DynamicTestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DynamicTestCase.java
@@ -56,21 +56,22 @@ import org.oasisopen.sca.NoSuchServiceException;
public class DynamicTestCase {
@Test
- public void testInstalledContribution() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException, ClassNotFoundException, IntrospectionException, IllegalArgumentException, InvocationTargetException, IllegalAccessException {
-
- // get the various factories that will be needed
+ public void testInstalledContribution() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException, ClassNotFoundException, IntrospectionException, IllegalArgumentException, InvocationTargetException,
+ IllegalAccessException {
+
+ // get the various factories that will be needed
TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
ExtensionPointRegistry extensionPoints = tuscanyRuntime.getExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
-
- // Create a contribution
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+
+ // Create a contribution
ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
Contribution contribution = contributionFactory.createContribution();
contribution.setURI("testContribution");
ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
contribution.setModelResolver(modelResolver);
- contribution.setClassLoader(new URLClassLoader(new URL[]{new File("src/test/resources/sample-helloworld.jar").toURI().toURL()}));
+ contribution.setClassLoader(new URLClassLoader(new URL[] {new File("src/test/resources/sample-helloworld.jar").toURI().toURL()}));
// Create a composite
AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
@@ -84,32 +85,32 @@ public class DynamicTestCase {
JavaImplementationFactory javaImplementationFactory = modelFactories.getFactory(JavaImplementationFactory.class);
JavaImplementation javaImplementation = javaImplementationFactory.createJavaImplementation(contribution.getClassLoader().loadClass("sample.HelloworldImpl"));
javaImplementation.setJavaClass(contribution.getClassLoader().loadClass("sample.HelloworldImpl"));
- component.setImplementation(javaImplementation );
-
- // add the component to the composite
- composite.getComponents().add(component);
+ component.setImplementation(javaImplementation);
+
+ // add the component to the composite
+ composite.getComponents().add(component);
- // add the composite to the contribution
+ // add the composite to the contribution
contribution.addComposite(composite);
// Now run the composite with a Tuscany Node
Node node = tuscanyRuntime.createNode();
node.installContribution(contribution, null);
node.startComposite(contribution.getURI(), composite.getURI());
-
+
// test that the service has started and can be invoked
testService(node, contribution.getClassLoader());
-
+
node.stop();
tuscanyRuntime.stop();
}
- private void testService(Node node, ClassLoader classLoader) throws ClassNotFoundException, NoSuchServiceException, NoSuchDomainException, IllegalArgumentException, InvocationTargetException, IllegalAccessException {
- Class<?> interfaze = classLoader.loadClass("sample.Helloworld");
- Object clientProxy = node.getService(interfaze, "testComponent/Helloworld");
- Method m = interfaze.getMethods()[0]; // the helloworld interface just has a single method "sayHello"
- Object response = m.invoke(clientProxy, new Object[]{"Ariana"});
+ private void testService(Node node, ClassLoader classLoader) throws ClassNotFoundException, NoSuchServiceException, NoSuchDomainException, IllegalArgumentException, InvocationTargetException, IllegalAccessException {
+ Class<?> interfaze = classLoader.loadClass("sample.Helloworld");
+ Object clientProxy = node.getService(interfaze, "testComponent/Helloworld");
+ Method m = interfaze.getMethods()[0]; // the helloworld interface just has a single method "sayHello"
+ Object response = m.invoke(clientProxy, new Object[] {"Ariana"});
Assert.assertEquals("Hello Ariana", response);
- }
+ }
}