summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test')
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/itest/nodes/Helloworld.java29
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java84
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/MultipleNodesPerJVMTestCase.java87
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/OneNodeTestCase.java105
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/StopStartNodesTestCase.java82
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java78
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java45
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java188
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java46
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/sample/Helloworld.java27
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworld2.composite29
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworldNode.xml27
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jarbin4779 -> 0 bytes
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jarbin4586 -> 0 bytes
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld-nodeployable.jarbin4761 -> 0 bytes
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld.jarbin4753 -> 0 bytes
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sca-contribution-generated.xml23
17 files changed, 0 insertions, 850 deletions
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/itest/nodes/Helloworld.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/itest/nodes/Helloworld.java
deleted file mode 100644
index 76f8d4400d..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/itest/nodes/Helloworld.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest.nodes;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Helloworld {
-
- String sayHello(String name);
-
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java
deleted file mode 100644
index 0a5d99ae7c..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/GetServiceTestCase.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.domain.node;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-import itest.nodes.Helloworld;
-
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-
-/**
- * This shows how to test the Calculator service component.
- */
-@Ignore("TUSCANY-3391")
-public class GetServiceTestCase{
-
- private static DomainNode clientNode;
- private static DomainNode serviceNode;
-
- @Test
- public void testTwoNodesSameDomain() throws Exception {
- serviceNode = new DomainNode("target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar");
- clientNode = new DomainNode("target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar");
-
- Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @Test
- public void testTwoNodesDifferentDomains() throws Exception {
- serviceNode = new DomainNode("vm://fooDomain", new String[]{"target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar"});
- Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- clientNode = new DomainNode("vm://barDomain", new String[] {"target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"});
- Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
-
- try {
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- fail();
- } catch (ServiceRuntimeException e) {
- // FIXME: this gives an SCARuntimeException, would be better to be something like ServiceNotFoundException?
- // expected
- }
- }
-
- @After
- public void tearDownAfterClass() throws Exception {
- if (clientNode != null) {
- clientNode.stop();
- }
- if (serviceNode != null) {
- serviceNode.stop();
- }
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/MultipleNodesPerJVMTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/MultipleNodesPerJVMTestCase.java
deleted file mode 100644
index 617876586b..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/MultipleNodesPerJVMTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.domain.node;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-import itest.nodes.Helloworld;
-
-import java.net.URI;
-
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-/**
- * This shows how to test the Calculator service component.
- */
-@Ignore("TUSCANY-3391")
-public class MultipleNodesPerJVMTestCase{
-
- private static DomainNode clientNode;
- private static DomainNode serviceNode;
-
- @Test
- public void testTwoNodesSameDomain() throws Exception {
- serviceNode = new DomainNode("target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar");
- clientNode = new DomainNode("target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar");
-
- Helloworld service = SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @Test
- public void testTwoNodesDifferentDomains() throws Exception {
- serviceNode = new DomainNode("vm://fooDomain", new String[]{"target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar"});
- Helloworld service = SCAClientFactory.newInstance(URI.create("vm://fooDomain")).getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- clientNode = new DomainNode("vm://barDomain", new String[]{"target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"});
- Helloworld client = SCAClientFactory.newInstance(URI.create("vm://barDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
-
- try {
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- fail();
- } catch (ServiceRuntimeException e) {
- // FIXME: this gives an SCARuntimeException, would be better to be something like ServiceNotFoundException?
- // expected
- }
- }
-
- @After
- public void tearDownAfterClass() throws Exception {
- if (clientNode != null) {
- clientNode.stop();
- }
- if (serviceNode != null) {
- serviceNode.stop();
- }
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/OneNodeTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/OneNodeTestCase.java
deleted file mode 100644
index 10803cd880..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/OneNodeTestCase.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.domain.node;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-import itest.nodes.Helloworld;
-
-import java.net.URI;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-/**
- * This shows how to test the Calculator service component.
- */
-@Ignore("TUSCANY-3391")
-public class OneNodeTestCase{
-
- private static DomainNode domain;
- private static String serviceContributionUri;
-
- @Before
- public void setUpBeforeClass() throws Exception {
- domain = new DomainNode();
- serviceContributionUri = domain.addContribution("target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar");
- domain.addContribution("target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar");
- }
-
- @Test
- public void testService() throws Exception {
- Helloworld service = SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
- }
-
- @Test
- public void testClient() throws Exception {
- Helloworld client = SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @Test
- public void testRemovingServiceContribution() throws Exception {
- domain.removeContribution(serviceContributionUri);
- try {
- SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldService");
- // FIXME: should this be NoSuchServiceException or ServiceNotFoundException?
- } catch (NoSuchServiceException e) {
- // expected
- }
-
- Helloworld client = SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- try {
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- fail();
- } catch (Exception e) {
- // FIXME: this gives an NPE, would be better to be something like ServiceNotFoundException
- // expected
- }
- }
-
- @Test
- public void testStoppingDomainNode() throws Exception {
- domain.stop();
- try {
- SCAClientFactory.newInstance(URI.create("vm://defaultDomain")).getService(Helloworld.class, "HelloworldClient");
- fail();
- } catch (NoSuchDomainException e) {
- // expected
- }
- }
-
- @After
- public void tearDownAfterClass() throws Exception {
- if (domain != null) {
- domain.stop();
- }
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/StopStartNodesTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/StopStartNodesTestCase.java
deleted file mode 100644
index 4a29822069..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/domain/node/StopStartNodesTestCase.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.domain.node;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-import itest.nodes.Helloworld;
-
-import java.net.URI;
-
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-/**
- * This shows how to test the Calculator service component.
- */
-@Ignore("TUSCANY-3391")
-public class StopStartNodesTestCase{
-
- private static DomainNode clientNode;
- private static DomainNode serviceNode;
-
- @Test
- public void testTwoNodesSameDomain() throws Exception {
- serviceNode = new DomainNode("vm://fooDomain", new String[]{"target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar"});
- clientNode = new DomainNode("vm://fooDomain", new String[]{"target/test-classes/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar"});
-
- Helloworld service = SCAClientFactory.newInstance(URI.create("vm://fooDomain")).getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = SCAClientFactory.newInstance(URI.create("vm://fooDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
-
- serviceNode.stop();
-
- client = SCAClientFactory.newInstance(URI.create("vm://fooDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- try {
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- fail();
- } catch (Exception e) {
- // expected
- }
-
- serviceNode = new DomainNode("vm://fooDomain", new String[]{"target/test-classes/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar"});
- client = SCAClientFactory.newInstance(URI.create("vm://fooDomain")).getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @After
- public void tearDownAfterClass() throws Exception {
- if (clientNode != null) {
- clientNode.stop();
- }
- if (serviceNode != null) {
- serviceNode.stop();
- }
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
deleted file mode 100644
index 12204883f8..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/DeployerTestCase.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.Node;
-import org.apache.tuscany.sca.TuscanyRuntime;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.deployment.Deployer;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-
-public class DeployerTestCase {
-
- @Test
- public void testInstalledContribution() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException {
- TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
- Node node = tuscanyRuntime.createNode("myDomain");
-
- Deployer deployer = tuscanyRuntime.getDeployer();
- Monitor monitor = deployer.createMonitor();
- Contribution contribution = deployer.loadContribution(URI.create("foo"), new File("src/test/resources/sample-helloworld-nodeployable.jar").toURI().toURL(), monitor);
- monitor.analyzeProblems();
-
- node.installContribution(contribution, null, true);
- List<String> ics = node.getInstalledContributionURIs();
- Assert.assertEquals(1, ics.size());
- Assert.assertEquals("foo", ics.get(0));
- }
-
- @Test
- public void testAddDeploymentComposite() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException, XMLStreamException {
- TuscanyRuntime tuscanyRuntime = TuscanyRuntime.newInstance();
- Node node = tuscanyRuntime.createNode("myDomain");
-
- node.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
-
- Deployer deployer = tuscanyRuntime.getDeployer();
- Monitor monitor = deployer.createMonitor();
- Composite composite = deployer.loadXMLDocument(new File("src/test/resources/helloworld2.composite").toURI().toURL(), monitor);
- monitor.analyzeProblems();
- composite.setURI("helloworld2.composite");
- node.start("foo", composite);
- List<String> dcs = node.getStartedCompositeURIs("foo");
- Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld2.composite", dcs.get(0));
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
deleted file mode 100644
index d245ea2ec6..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/NodeXMLTestCase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.Node;
-import org.apache.tuscany.sca.TuscanyRuntime;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.junit.Test;
-
-public class NodeXMLTestCase {
-
- @Test
- public void testHelloworldXML() throws ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNodeFromXML("src/test/resources/helloworldNode.xml");
- Assert.assertEquals("helloworld", node.getDomainName());
- List<String> cs = node.getInstalledContributionURIs();
- Assert.assertEquals(1, cs.size());
- Assert.assertEquals("sample-helloworld", cs.get(0));
- List<String> compsoites = node.getStartedCompositeURIs("sample-helloworld");
- Assert.assertEquals(1, compsoites.size());
- Assert.assertEquals("helloworld.composite", compsoites.get(0));
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
deleted file mode 100644
index d588f91d6a..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TuscanyRuntimeTestCase.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-import java.net.MalformedURLException;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.Node;
-import org.apache.tuscany.sca.TuscanyRuntime;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.impl.NodeImpl;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-
-import sample.Helloworld;
-
-public class TuscanyRuntimeTestCase {
-
- @Test
- public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null, true);
-
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- }
-
- @Test
- public void testStopStart() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null, true);
- String ci = node.getStartedCompositeURIs("helloworld").get(0);
-
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
-
- node.stop("helloworld", ci);
- try {
- node.getService(Helloworld.class, "HelloworldComponent");
- Assert.fail();
- } catch (NoSuchServiceException e) {
- // expected as there is no deployables
- }
-
- node.start("helloworld", ci);
- helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- }
-
- @Test
- @Ignore("Depdends on itest/T3558 which isn't in the build?")
- public void testInstallWithDependent() throws NoSuchServiceException, ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("store", "../../itest/T3558/src/test/resources/sample-store.jar", null, null, true);
- node.installContribution("store-client", "../../itest/T3558/src/test/resources/sample-store-client.jar", null, null, true);
-
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- }
-
- @Test
- public void testInstallNoDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
-
- try {
- node.getService(Helloworld.class, "HelloworldComponent");
- Assert.fail();
- } catch (NoSuchServiceException e) {
- // expected as there is no deployables
- }
-
- node.start("helloworld", "helloworld.composite");
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- }
-
- @Test
- public void testGetInstalledContributions() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
- List<String> ics = node.getInstalledContributionURIs();
- Assert.assertEquals(1, ics.size());
- Assert.assertEquals("foo", ics.get(0));
- }
-
- @Test
- public void testGetDeployedCompostes() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
- List<String> dcs = node.getStartedCompositeURIs("foo");
- Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld.composite", dcs.get(0));
- }
-
- @Test
- public void testRemoveComposte() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- node.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
- node.stop("foo", "helloworld.composite");
- List<String> dcs = node.getStartedCompositeURIs("foo");
- Assert.assertEquals(0, dcs.size());
- }
-
- @Test
- public void testInstallWithMetaData() throws ContributionReadException, ActivationException, ValidationException, NoSuchServiceException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- ((NodeImpl)node).installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", "src/test/resources/sca-contribution-generated.xml", null, true);
-
- List<String> dcs = node.getStartedCompositeURIs("helloworld");
- Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld.composite", dcs.get(0));
-
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- }
-
- @Test
- public void testURI() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
- Node node = TuscanyRuntime.newInstance().createNode("default");
- String uri = node.installContribution("src/test/resources/sample-helloworld.jar");
- Assert.assertEquals("sample-helloworld", uri);
- }
-
- @Test
- public void testStaticCreate() {
- Node node = TuscanyRuntime.runComposite("helloworld.composite", "src/test/resources/sample-helloworld.jar");
- List<String> cs = node.getInstalledContributionURIs();
- Assert.assertEquals(1, cs.size());
- List<String> dcs = node.getStartedCompositeURIs(cs.get(0));
- Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld.composite", dcs.get(0));
- }
-
- @Test
- public void testStaticCreateWithNullComposite() {
- Node node = TuscanyRuntime.runComposite(null, "src/test/resources/sample-helloworld.jar");
- List<String> cs = node.getInstalledContributionURIs();
- Assert.assertEquals(1, cs.size());
- List<String> dcs = node.getStartedCompositeURIs(cs.get(0));
- Assert.assertEquals(1, dcs.size());
- Assert.assertEquals("helloworld.composite", dcs.get(0));
- }
- @Test
- public void testRunComposite() throws NoSuchServiceException {
- Node node = TuscanyRuntime.runComposite("helloworld.composite", "src/test/resources/sample-helloworld.jar");
- try {
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- } finally {
- node.stop();
- }
- }
-
- @Test
- public void testRunCompositeSharedRuntime() throws NoSuchServiceException {
- TuscanyRuntime runtime = TuscanyRuntime.newInstance();
- Node node = TuscanyRuntime.runComposite(runtime, "helloworld.composite", "src/test/resources/sample-helloworld.jar");
- try {
- Helloworld helloworldService = node.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- } finally {
- node.stop();
- }
- runtime.stop();
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java
deleted file mode 100644
index 6205b26a8a..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/org/apache/tuscany/sca/runtime/TwoNodesTestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.runtime;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.Node;
-import org.apache.tuscany.sca.TuscanyRuntime;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-
-import sample.Helloworld;
-
-public class TwoNodesTestCase {
-
- @Test
- public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
- Node node1 = TuscanyRuntime.newInstance().createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44331");
- node1.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null, true);
-
- Node node2 = TuscanyRuntime.newInstance().createNode("uri:TwoNodesTestCase?multicast=off&bind=127.0.0.1:44332&wka=127.0.0.1:44331");
-
- Helloworld helloworldService = node2.getService(Helloworld.class, "HelloworldComponent");
- Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
- }
-
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/sample/Helloworld.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/sample/Helloworld.java
deleted file mode 100644
index b67efbb485..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/java/sample/Helloworld.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sample;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Helloworld {
- String sayHello(String name);
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworld2.composite b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworld2.composite
deleted file mode 100644
index 8c7a789380..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworld2.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://sample"
- name="helloworld2">
-
- <component name="Helloworld2Component">
- <implementation.java class="sample.HelloworldImpl"/>
- </component>
-
-</composite>
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworldNode.xml b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworldNode.xml
deleted file mode 100644
index ea2f577139..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/helloworldNode.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- domain="helloworld">
-
- <contribution location="sample-helloworld.jar" startDeployables="true" />
-
-</node> \ No newline at end of file
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar
deleted file mode 100644
index 7f6073ce7f..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-client-2.0-SNAPSHOT.jar
+++ /dev/null
Binary files differ
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar
deleted file mode 100644
index 2306ce4d1a..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/itest-nodes-helloworld-service-2.0-SNAPSHOT.jar
+++ /dev/null
Binary files differ
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld-nodeployable.jar b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld-nodeployable.jar
deleted file mode 100644
index 16dde03858..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld-nodeployable.jar
+++ /dev/null
Binary files differ
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld.jar b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld.jar
deleted file mode 100644
index 50e732d50b..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sample-helloworld.jar
+++ /dev/null
Binary files differ
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sca-contribution-generated.xml b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sca-contribution-generated.xml
deleted file mode 100644
index 8e20561dc3..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/domain-node/src/test/resources/sca-contribution-generated.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sample="http://sample">
- <deployable composite="sample:helloworld"/>
-</contribution>