summaryrefslogtreecommitdiffstats
path: root/sandbox/rfeng/runtime/embedded/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/rfeng/runtime/embedded/src/test')
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddService.java25
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddServiceImpl.java30
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorClient.java51
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorService.java35
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorServiceImpl.java70
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideService.java25
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideServiceImpl.java30
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyService.java25
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyServiceImpl.java30
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractService.java25
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractServiceImpl.java30
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java57
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java60
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/resources/application.composite46
-rw-r--r--sandbox/rfeng/runtime/embedded/src/test/resources/system.composite349
15 files changed, 888 insertions, 0 deletions
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddService.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddService.java
new file mode 100644
index 0000000000..4eeb30a9c2
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddService.java
@@ -0,0 +1,25 @@
+/*
+ * 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 calculator;
+
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddServiceImpl.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddServiceImpl.java
new file mode 100644
index 0000000000..8b6fe066a6
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/AddServiceImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ return n1 + n2;
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorClient.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorClient.java
new file mode 100644
index 0000000000..37231e53fe
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorClient.java
@@ -0,0 +1,51 @@
+/*
+ * 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 calculator;
+
+import org.apache.tuscany.api.SCARuntime;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CalculatorClient {
+
+ public CalculatorClient() {
+ super();
+ }
+
+ public static void main(String[] args) {
+ // Start the embedded SCA runtime
+ SCARuntime.start();
+
+ // Look up the ComponentContext by name
+ ComponentContext context = SCARuntime.getComponentContext("CalculatorServiceComponent");
+ ServiceReference<CalculatorService> self = context.createSelfReference(CalculatorService.class);
+ CalculatorService calculatorService = self.getService();
+ System.out.println("1.0 x 2.0 = " + calculatorService.multiply(1.0, 2.0));
+ AddService addService = context.getService(AddService.class, "addService");
+ System.out.println("1.0 + 2.0 = " + addService.add(1.0, 2.0));
+
+ // Stop the SCA embedded runtime
+ SCARuntime.stop();
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorService.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorService.java
new file mode 100644
index 0000000000..031fa8b912
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorService.java
@@ -0,0 +1,35 @@
+/*
+ * 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 calculator;
+
+
+/**
+ * The Calculator service interface.
+ */
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorServiceImpl.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorServiceImpl.java
new file mode 100644
index 0000000000..3d861f2018
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/CalculatorServiceImpl.java
@@ -0,0 +1,70 @@
+/*
+ * 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 calculator;
+
+import org.osoa.sca.annotations.Reference;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideService.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideService.java
new file mode 100644
index 0000000000..131c5a8014
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideService.java
@@ -0,0 +1,25 @@
+/*
+ * 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 calculator;
+
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideServiceImpl.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideServiceImpl.java
new file mode 100644
index 0000000000..f7ac0b7287
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/DivideServiceImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyService.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyService.java
new file mode 100644
index 0000000000..a917896aeb
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyService.java
@@ -0,0 +1,25 @@
+/*
+ * 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 calculator;
+
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyServiceImpl.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyServiceImpl.java
new file mode 100644
index 0000000000..b7dca792b2
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/MultiplyServiceImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ return n1 * n2;
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractService.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractService.java
new file mode 100644
index 0000000000..e328f024ea
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractService.java
@@ -0,0 +1,25 @@
+/*
+ * 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 calculator;
+
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractServiceImpl.java b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractServiceImpl.java
new file mode 100644
index 0000000000..77b128ab8d
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/calculator/SubtractServiceImpl.java
@@ -0,0 +1,30 @@
+/*
+ * 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 calculator;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ return n1 - n2;
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java b/sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java
new file mode 100644
index 0000000000..cacbb7162c
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/api/SCARuntimeTestCase.java
@@ -0,0 +1,57 @@
+/*
+ * 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.api;
+
+import junit.framework.TestCase;
+
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+
+import calculator.AddService;
+import calculator.CalculatorService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SCARuntimeTestCase extends TestCase {
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void setUp() throws Exception {
+ SCARuntime.start();
+ }
+
+ public void testStart() throws Exception {
+ ComponentContext context = SCARuntime.getComponentContext("CalculatorServiceComponent");
+ assertNotNull(context);
+ ServiceReference<CalculatorService> self = context.createSelfReference(CalculatorService.class);
+ assertEquals(2.0, self.getService().multiply(1.0, 2.0));
+ AddService service = context.getService(AddService.class, "addService");
+ assertEquals(3.0, service.add(1.0, 2.0));
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void tearDown() throws Exception {
+ SCARuntime.stop();
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java b/sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java
new file mode 100644
index 0000000000..1c4b04600d
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/java/org/apache/tuscany/runtime/embedded/SimpleRuntimeImplTestCase.java
@@ -0,0 +1,60 @@
+/*
+ * 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.runtime.embedded;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.osoa.sca.ComponentContext;
+
+import calculator.AddService;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SimpleRuntimeImplTestCase extends TestCase {
+ private SimpleRuntime runtime;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void setUp() throws Exception {
+ SimpleRuntimeInfo runtimeInfo = new SimpleRuntimeInfoImpl(getClass().getClassLoader(), "application.composite");
+ runtime = new SimpleRuntimeImpl(runtimeInfo);
+ runtime.start();
+ }
+
+ public void testStart() throws Exception {
+ ComponentContext context = runtime.getComponentContext(URI
+ .create("sca://root.application/default/CalculatorServiceComponent"));
+ assertNotNull(context);
+ AddService service = context.getService(AddService.class, "addService");
+ assertEquals(3.0, service.add(1.0, 2.0));
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ protected void tearDown() throws Exception {
+ runtime.destroy();
+ }
+
+}
diff --git a/sandbox/rfeng/runtime/embedded/src/test/resources/application.composite b/sandbox/rfeng/runtime/embedded/src/test/resources/application.composite
new file mode 100644
index 0000000000..55d4ca889b
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/resources/application.composite
@@ -0,0 +1,46 @@
+<?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://www.osoa.org/xmlns/sca/1.0" name="CalculatorComposite">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl" />
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl" />
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl" />
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl" />
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl" />
+ </component>
+
+</composite>
diff --git a/sandbox/rfeng/runtime/embedded/src/test/resources/system.composite b/sandbox/rfeng/runtime/embedded/src/test/resources/system.composite
new file mode 100644
index 0000000000..3974e06dd1
--- /dev/null
+++ b/sandbox/rfeng/runtime/embedded/src/test/resources/system.composite
@@ -0,0 +1,349 @@
+<?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.
+-->
+<!--
+ Default system configuration for the launcher environment.
+
+ $Rev: 520623 $ $Date: 2007-03-20 15:17:36 -0700 (Tue, 20 Mar 2007) $
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:system="http://tuscany.apache.org/xmlns/sca/system/2.0-alpha"
+ name="org.apache.tuscany.launcher.System" autowire="true">
+
+ <!-- Work manager -->
+ <component name="workManager">
+ <system:implementation.system class="org.apache.tuscany.core.services.work.jsr237.workmanager.ThreadPoolWorkManager" />
+ <property name="poolSize">10</property>
+ </component>
+
+ <component name="workScheduler">
+ <system:implementation.system class="org.apache.tuscany.core.services.work.jsr237.Jsr237WorkScheduler" />
+ </component>
+ <!-- Generator Registry -->
+ <component name="generatorRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.generator.GeneratorRegistryImpl" />
+ </component>
+
+ <component name="javaGenerator">
+ <system:implementation.system class="org.apache.tuscany.core.implementation.java.JavaPhysicalComponentGenerator" />
+ </component>
+
+
+ <!-- JXTA network configurator -->
+ <!-- component name="networkConfigurator">
+ <system:implementation.system
+ class="net.jxta.platform.NetworkConfigurator"/>
+ <property name="principal">principal</property>
+ <property name="password">password</property>
+ </component-->
+
+ <!-- Discovery service -->
+ <!--component name="discoveryService">
+ <system:implementation.system
+ class="org.apache.tuscany.service.discovery.jxta.JxtaDiscoveryService"/>
+ <property name="interval">5000</property>
+ <reference name="configurator" target="networkConfigurator"/>
+ <reference name="workScheduler" target="workScheduler"/>
+ </component-->
+
+ <!-- JMS discovery service -->
+ <!--
+ <component name="discoveryService">
+ <system:implementation.system
+ class="org.apache.tuscany.service.discovery.jms.JmsDiscoveryService"/>
+ <property name="topic">tuscany.federation</property>
+ </component>
+ -->
+
+ <!-- Marshaller registry -->
+ <component name="marshallerRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.marshaller.DefaultModelMarshallerRegistry" />
+ </component>
+
+ <!-- Changeset marshaller -->
+ <component name="changeSetMarshaller">
+ <system:implementation.system class="org.apache.tuscany.core.marshaller.PhysicalChangeSetMarshaller" />
+ </component>
+
+ <!-- Wide definition marshaller -->
+ <component name="wireDefinitionMarshaller">
+ <system:implementation.system class="org.apache.tuscany.core.marshaller.PhysicalWireDefinitionMarshaller" />
+ </component>
+
+ <!-- Operation definition marshaller -->
+ <component name="operationMarshaller">
+ <system:implementation.system class="org.apache.tuscany.core.marshaller.PhysicalOperationDefinitionMarshaller" />
+ </component>
+
+ <!-- Java component definition marshaller -->
+ <component name="javaComponentDefinitionMarshaller">
+ <system:implementation.system
+ class="org.apache.tuscany.core.marshaller.extensions.java.JavaPhysicalComponentDefinitionMarshaller" />
+ </component>
+
+ <!-- Reflective IF provider definition marshaller -->
+ <component name="reflectiveIfProviderDefinitionMarshaller">
+ <system:implementation.system
+ class="org.apache.tuscany.core.marshaller.extensions.instancefactory.ReflectiveIFProviderDefinitionMarshaller" />
+ </component>
+
+ <!-- Java physical wire source definition marshaller -->
+ <component name="javaWireSourceDefinitionMarshaller">
+ <system:implementation.system
+ class="org.apache.tuscany.core.marshaller.extensions.java.JavaPhysicalWireSourceDefinitionMarshaller" />
+ </component>
+
+ <!-- Java physical wire target definition marshaller -->
+ <component name="javaWireTargetDefinitionMarshaller">
+ <system:implementation.system
+ class="org.apache.tuscany.core.marshaller.extensions.java.JavaPhysicalWireTargetDefinitionMarshaller" />
+ </component>
+
+ <!-- Builder registry -->
+ <component name="builderRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.builder.physical.DefaultPhysicalComponentBuilderRegistry" />
+ </component>
+ <component name="wireAttacherRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.builder.physical.WireAttacherRegistryImpl" />
+ </component>
+ <component name="providerBuilderRegistry">
+ <system:implementation.system
+ class="org.apache.tuscany.core.component.instancefactory.impl.DefaultIFProviderBuilderRegistry" />
+ </component>
+
+ <component name="reflectiveIFProviderBuilder">
+ <system:implementation.system
+ class="org.apache.tuscany.core.component.instancefactory.impl.ReflectiveIFProviderBuilder" />
+ </component>
+
+ <!-- Java physical component builder -->
+ <component name="javaPhysicalComponentBuilder">
+ <system:implementation.system class="org.apache.tuscany.core.implementation.java.JavaPhysicalComponentBuilder" />
+ </component>
+
+ <!-- Classloader registry -->
+ <!--
+ <component name="classLoaderRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.services.classloading.ClassLoaderRegistryImpl" />
+ </component>
+ -->
+
+ <!-- Federated deployer -->
+ <component name="federateDeployer">
+ <system:implementation.system class="org.apache.tuscany.core.deployer.federation.FederatedDeployer" />
+ </component>
+
+ <!-- Component manager -->
+ <!--
+ <component name="componentManager">
+ <system:implementation.system
+ class="org.apache.tuscany.core.component.ComponentManagerImpl"/>
+ </component>
+ -->
+
+ <!-- Connector -->
+ <!--
+ <component name="connector">
+ <system:implementation.system class="org.apache.tuscany.core.builder.ConnectorImpl" />
+ </component>
+ -->
+
+ <!-- Jetty HTTP service -->
+ <!--
+ <component name="httpService">
+ <system:implementation.system
+ class="org.apache.tuscany.service.jetty.JettyServiceImpl"/>
+ <property name="httpPort">7000</property>
+ </component>
+ -->
+
+ <!-- Console -->
+ <!--
+ <include name="org.apache.tuscany.sca.console"
+ scdlResource="org/apache/tuscany/console/console.scdl"/>
+ -->
+
+ <!-- Assembly service -->
+ <component name="assemblyService">
+ <system:implementation.system class="org.apache.tuscany.core.services.deployment.AssemblyServiceImpl" />
+ </component>
+
+
+ <!--_________________________________________________________________________________________-->
+
+ <!--__________________________Legacy from launcher SCDL _____________________________________-->
+
+ <!--_________________________________________________________________________________________-->
+
+ <!-- Component that provides the Deployer service -->
+ <component name="deployer">
+ <system:implementation.system class="org.apache.tuscany.core.deployer.DeployerImpl" />
+ </component>
+
+ <!-- Work management -->
+ <component name="WorkContext">
+ <system:implementation.system class="org.apache.tuscany.core.component.WorkContextImpl" />
+ </component>
+
+ <!-- Wire service -->
+ <component name="proxyService">
+ <system:implementation.system class="org.apache.tuscany.core.wire.jdk.JDKProxyService" />
+ </component>
+
+ <!-- Store infrastructure -->
+ <component name="store">
+ <system:implementation.system class="org.apache.tuscany.core.services.store.memory.MemoryStore" />
+ </component>
+
+ <!-- Builder and BuilderRegistry -->
+ <component name="builder">
+ <system:implementation.system class="org.apache.tuscany.core.builder.BuilderRegistryImpl" />
+ </component>
+
+ <!-- Resource host registry -->
+ <component name="resourceHostRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.services.host.DelegatingResourceHostRegistry" />
+ </component>
+
+ <!-- Loader and LoaderRegistry -->
+ <component name="loader">
+ <system:implementation.system class="org.apache.tuscany.core.loader.LoaderRegistryImpl" />
+ </component>
+
+ <!-- Introspector and IntrospectionRegistry -->
+ <component name="interfaceProcessorRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.implementation.IntrospectionRegistryImpl" />
+ </component>
+
+ <!-- Connector infrastructure -->
+ <component name="connector">
+ <system:implementation.system class="org.apache.tuscany.core.builder.ConnectorImpl" />
+ </component>
+
+ <component name="wirePostProcessorRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.builder.WirePostProcessorRegistryImpl" />
+ </component>
+
+ <!-- Default scopes -->
+ <component name="scope.stateless">
+ <system:implementation.system class="org.apache.tuscany.core.component.scope.StatelessScopeContainer" />
+ </component>
+ <!--
+ <component name="scope.request">
+ <system:implementation.system class="org.apache.tuscany.core.component.scope.RequestScopeContainer"/>
+ </component>
+ -->
+ <!--
+ <component name="scope.conversational">
+ <system:implementation.system class="org.apache.tuscany.core.component.scope.ConversationalScopeContainer"/>
+ </component>
+ -->
+
+ <!-- include loader configuration -->
+ <include name="org.apache.tuscany.core.Loader" scdlResource="org/apache/tuscany/core/loader.scdl" />
+
+ <!-- include databinding configuration -->
+ <include name="org.apache.tuscany.core.DataBinding" scdlResource="org/apache/tuscany/core/databinding.scdl" />
+
+ <!-- include implementation processor configuration -->
+ <include name="org.apache.tuscany.core.Implementation" scdlResource="org/apache/tuscany/core/implementation.scdl" />
+
+ <!-- Java interface definition language -->
+ <include name="org.apache.tuscany.core.InterfaceJava" scdlResource="org/apache/tuscany/core/interfaceJava.scdl" />
+
+ <!-- include omposite implementation type -->
+ <include name="org.apache.tuscany.core.Composite" scdlResource="org/apache/tuscany/core/composite.scdl" />
+
+ <!-- System implementation type -->
+ <include name="org.apache.tuscany.core.SystemImplementation"
+ scdlResource="org/apache/tuscany/core/systemImplementation.scdl" />
+
+ <!-- Java implementation type -->
+ <include name="org.apache.tuscany.core.JavaImplementation" scdlResource="org/apache/tuscany/core/javaImplementation.scdl" />
+
+ <!-- service for resolving artifacts using Maven repositories -->
+ <!--
+ <component name="artifactRepository">
+ <system:implementation.system
+ class="org.apache.tuscany.services.maven.MavenArtifactRepository"/>
+ <property name="remoteRepoUrl">
+ http://repo1.maven.org/maven2/,http://people.apache.org/repo/m2-snapshot-repository,http://people.apache.org/repo/m2-incubating-repository/,http://people.apache.org/repo/m1-snapshot-repository/</property>
+ </component>
+ -->
+
+ <component name="policyBuilderRegistry">
+ <system:implementation.system class="org.apache.tuscany.core.policy.PolicyBuilderRegistryImpl" />
+ </component>
+
+ <component name="propertyFactory">
+ <system:implementation.system class="org.apache.tuscany.core.property.PropertyObjectFactoryImpl" />
+ </component>
+
+ <!-- component that scans the extension directory -->
+ <!--
+ <component name="directoryScanExtender" initLevel="90">
+ <system:implementation.system
+ class="org.apache.tuscany.runtime.standalone.host.DirectoryScanExtender"/>
+ <property name="path">extensions</property>
+ </component>
+ -->
+
+ <!-- the local binding -->
+ <component name="localBindingLoader">
+ <system:implementation.system class="org.apache.tuscany.core.binding.local.LocalBindingLoader" />
+ </component>
+
+ <component name="localBindingBuilder">
+ <system:implementation.system class="org.apache.tuscany.core.binding.local.LocalBindingBuilder" />
+ </component>
+
+ <component name="artifactRepository">
+ <system:implementation.system class="org.apache.tuscany.core.services.artifact.LocalMavenRepository" />
+ <property name="repository">.m2/repository</property>
+ </component>
+
+ <!--
+ <component name="launchedLoader">
+ <system:implementation.system
+ class="org.apache.tuscany.runtime.standalone.host.implementation.launched.LaunchedLoader"/>
+ </component>
+
+ <component name="launchedComponentLoader">
+ <system:implementation.system
+ class="org.apache.tuscany.runtime.standalone.host.implementation.launched.LaunchedComponentTypeLoader"/>
+ </component>
+
+ <component name="launchedComponentBuilder">
+ <system:implementation.system
+ class="org.apache.tuscany.runtime.standalone.host.implementation.launched.LaunchedComponentBuilder"/>
+ </component>
+ -->
+
+ <component name="wiringExceptionFormatter">
+ <system:implementation.system class="org.apache.tuscany.core.builder.WiringExceptionFormatter" />
+ </component>
+
+ <component name="loaderExceptionFormatter">
+ <system:implementation.system class="org.apache.tuscany.core.loader.LoaderExceptionFormatter" />
+ </component>
+
+ <component name="incompatibleServiceContractExceptionFormatter">
+ <system:implementation.system class="org.apache.tuscany.core.wire.IncompatibleServiceContractExceptionFormatter" />
+ </component>
+
+</composite> \ No newline at end of file