summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-07-04 17:27:55 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-07-04 17:27:55 +0000
commit37f723b991d3d05ab878aa8934ca57287bc2da0f (patch)
tree313a659bbd34211168ef5ef66353b37d2c801c1e
parentba1633c629aaf1740fc5c36bb728d9c01276464c (diff)
Add 3 additional scenarios
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@674100 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml (renamed from java/sca/itest/builder/src/main/resources/META-INF/sca-contribution.xml)4
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario1/scenario1.composite (renamed from java/sca/itest/builder/src/main/resources/scenario1.composite)0
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario1/scenario1a.composite (renamed from java/sca/itest/builder/src/main/resources/scenario1a.composite)0
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml24
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario2/scenario2.composite21
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario2/scenario2a.composite25
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml24
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario3/scenario3.composite22
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario3/scenario3a.composite24
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml24
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario4/scenario4.composite21
-rw-r--r--java/sca/itest/builder/src/main/resources/scenario4/scenario4a.composite25
-rw-r--r--java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java29
13 files changed, 239 insertions, 4 deletions
diff --git a/java/sca/itest/builder/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
index bd565753b3..256d01be58 100644
--- a/java/sca/itest/builder/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/builder/src/main/resources/scenario1/META-INF/sca-contribution.xml
@@ -19,6 +19,6 @@
-->
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://scenario1"
- xmlns:tns="http://scenario1">
- <deployable composite="tns:CompositeA" />
+ xmlns:ns1="http://scenario1">
+ <deployable composite="ns1:CompositeA" />
</contribution>
diff --git a/java/sca/itest/builder/src/main/resources/scenario1.composite b/java/sca/itest/builder/src/main/resources/scenario1/scenario1.composite
index 4339681fa4..4339681fa4 100644
--- a/java/sca/itest/builder/src/main/resources/scenario1.composite
+++ b/java/sca/itest/builder/src/main/resources/scenario1/scenario1.composite
diff --git a/java/sca/itest/builder/src/main/resources/scenario1a.composite b/java/sca/itest/builder/src/main/resources/scenario1/scenario1a.composite
index 2379a1ffa8..2379a1ffa8 100644
--- a/java/sca/itest/builder/src/main/resources/scenario1a.composite
+++ b/java/sca/itest/builder/src/main/resources/scenario1/scenario1a.composite
diff --git a/java/sca/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml b/java/sca/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..6fa901c4df
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario2/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario2"
+ xmlns:ns2="http://scenario2">
+ <deployable composite="ns2:CompositeA" />
+</contribution>
diff --git a/java/sca/itest/builder/src/main/resources/scenario2/scenario2.composite b/java/sca/itest/builder/src/main/resources/scenario2/scenario2.composite
new file mode 100644
index 0000000000..dc225f3d8f
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario2/scenario2.composite
@@ -0,0 +1,21 @@
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario2"
+ xmlns:tns="http://scenario2"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ </component>
+
+</composite>
+
diff --git a/java/sca/itest/builder/src/main/resources/scenario2/scenario2a.composite b/java/sca/itest/builder/src/main/resources/scenario2/scenario2a.composite
new file mode 100644
index 0000000000..505a3d14bb
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario2/scenario2a.composite
@@ -0,0 +1,25 @@
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario2"
+ xmlns:tns="http://scenario2"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ </component>
+</composite>
+
+
diff --git a/java/sca/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml b/java/sca/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..f5899ab1f0
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario3/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario3"
+ xmlns:ns3="http://scenario3">
+ <deployable composite="ns3:CompositeA" />
+</contribution>
diff --git a/java/sca/itest/builder/src/main/resources/scenario3/scenario3.composite b/java/sca/itest/builder/src/main/resources/scenario3/scenario3.composite
new file mode 100644
index 0000000000..c537ec7b30
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario3/scenario3.composite
@@ -0,0 +1,22 @@
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario3"
+ xmlns:tns="http://scenario3"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ </component>
+
+</composite>
+
diff --git a/java/sca/itest/builder/src/main/resources/scenario3/scenario3a.composite b/java/sca/itest/builder/src/main/resources/scenario3/scenario3a.composite
new file mode 100644
index 0000000000..27a76148b6
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario3/scenario3a.composite
@@ -0,0 +1,24 @@
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario3"
+ xmlns:tns="http://scenario3"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ </component>
+</composite>
+
+
diff --git a/java/sca/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml b/java/sca/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..642245ea7e
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario4/META-INF/sca-contribution.xml
@@ -0,0 +1,24 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario4"
+ xmlns:ns4="http://scenario4">
+ <deployable composite="ns4:CompositeA" />
+</contribution>
diff --git a/java/sca/itest/builder/src/main/resources/scenario4/scenario4.composite b/java/sca/itest/builder/src/main/resources/scenario4/scenario4.composite
new file mode 100644
index 0000000000..cfd4c537b3
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario4/scenario4.composite
@@ -0,0 +1,21 @@
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario4"
+ xmlns:tns="http://scenario4"
+ name="CompositeA">
+
+ <service name="Service1" promote="ComponentB/Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+
+ <component name="ComponentB">
+ <implementation.composite name="tns:CompositeC" />
+ <service name="Service2">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ </component>
+
+</composite>
+
diff --git a/java/sca/itest/builder/src/main/resources/scenario4/scenario4a.composite b/java/sca/itest/builder/src/main/resources/scenario4/scenario4a.composite
new file mode 100644
index 0000000000..affa80afb3
--- /dev/null
+++ b/java/sca/itest/builder/src/main/resources/scenario4/scenario4a.composite
@@ -0,0 +1,25 @@
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://scenario4"
+ xmlns:tns="http://scenario4"
+ name="CompositeC">
+
+ <service name="Service2" promote="ComponentD/Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ <service name="Service2a" promote="ComponentD/Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+
+ <component name="ComponentD">
+ <implementation.java class="org.apache.tuscany.sca.itest.builder.ComponentDImpl"/>
+ <service name="Service3">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ <binding.ws />
+ </service>
+ <service name="Service3a">
+ <!-- bindings and/or interfaces may or may not be specified explicitly here -->
+ </service>
+ </component>
+</composite>
+
+
diff --git a/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java b/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
index 9862825ca1..9e17db4646 100644
--- a/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
+++ b/java/sca/itest/builder/src/test/java/org/apache/tuscany/sca/itest/builder/BuilderTestCase.java
@@ -58,9 +58,34 @@ public class BuilderTestCase extends TestCase {
}
public void testScenario1() throws Exception {
+ System.out.println("====>Running testScenario1");
customBuilder = new CustomCompositeBuilder();
- customBuilder.loadContribution("src/main/resources/scenario1.composite",
- "TestContribution", "src/main/resources/");
+ customBuilder.loadContribution("src/main/resources/scenario1/scenario1.composite",
+ "TestContribution", "src/main/resources/scenario1/");
+ printResults();
+ }
+
+ public void testScenario2() throws Exception {
+ System.out.println("====>Running testScenario2");
+ customBuilder = new CustomCompositeBuilder();
+ customBuilder.loadContribution("src/main/resources/scenario2/scenario2.composite",
+ "TestContribution", "src/main/resources/scenario2/");
+ printResults();
+ }
+
+ public void testScenario3() throws Exception {
+ System.out.println("====>Running testScenario3");
+ customBuilder = new CustomCompositeBuilder();
+ customBuilder.loadContribution("src/main/resources/scenario3/scenario3.composite",
+ "TestContribution", "src/main/resources/scenario3/");
+ printResults();
+ }
+
+ public void testScenario4() throws Exception {
+ System.out.println("====>Running testScenario4");
+ customBuilder = new CustomCompositeBuilder();
+ customBuilder.loadContribution("src/main/resources/scenario4/scenario4.composite",
+ "TestContribution", "src/main/resources/scenario4/");
printResults();
}