You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rs...@apache.org on 2008/04/13 21:24:47 UTC
svn commit: r647615 - in
/incubator/tuscany/java/sca/itest/osgi-implementation: ./
src/main/java/helloworld/sdo/ src/main/java/helloworld/sdo/client/
src/main/resources/osgi/sdo/ src/main/resources/osgi/sdo/ds/
src/main/resources/sdo/ src/main/resource...
Author: rsivaram
Date: Sun Apr 13 12:24:44 2008
New Revision: 647615
URL: http://svn.apache.org/viewvc?rev=647615&view=rev
Log:
Add test for Java<->OSGi services and references using SDO parameters
Added:
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.mf
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.mf
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldClient.componentType
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldService.componentType
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml (with props)
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworld.wsdl
incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworldsdo.composite
incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/
incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java (with props)
Modified:
incubator/tuscany/java/sca/itest/osgi-implementation/build-bundles.xml
incubator/tuscany/java/sca/itest/osgi-implementation/pom.xml
Modified: incubator/tuscany/java/sca/itest/osgi-implementation/build-bundles.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/build-bundles.xml?rev=647615&r1=647614&r2=647615&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/build-bundles.xml (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/build-bundles.xml Sun Apr 13 12:24:44 2008
@@ -30,5 +30,19 @@
</jar>
</target>
+ <!-- Add a file to a jar file, into a different path in the jar file -->
+ <target name="update-bundle">
+
+ <copy overwrite="true" todir="${files.dir}/${target.dir}" >
+ <fileset dir="${files.dir}/${source.dir}" includes="${files.list}" />
+ </copy>
+ <jar update="true" jarfile="${jar.dir}/${jar.file.name}" >
+ <fileset dir="${files.dir}" includes="${files.list}" />
+ </jar>
+ <delete>
+ <fileset dir="${files.dir}/${target.dir}" includes="${files.list}" />
+ </delete>
+ </target>
+
</project>
Modified: incubator/tuscany/java/sca/itest/osgi-implementation/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/pom.xml?rev=647615&r1=647614&r2=647615&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/pom.xml (original)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/pom.xml Sun Apr 13 12:24:44 2008
@@ -116,6 +116,25 @@
</dependency>
<dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-lib</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-impl</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.2</version>
@@ -126,17 +145,59 @@
<finalName>itest-osgi-implementation</finalName>
<plugins>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>target/sdo-source</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>1.0-incubating-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>generate-helloworld-sdo</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/sdo/ds/helloworld.wsdl</schemaFile>
+ <javaPackage>helloworld.sdo</javaPackage>
+ <prefix>Helloworld</prefix>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.6.5</version>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ </dependencies>
<executions>
<execution>
@@ -1098,7 +1159,63 @@
osgi/properties/ds/StockQuoteFactory.xml \
stockquote/OSGiStockQuoteComponentImpl.class" />
- </ant>
+ </ant>
+ <ant antfile="./build-bundles.xml"
+ target="create-bundles">
+ <property name="jar.dir"
+ value="target/classes/sdo/ds" />
+ <property name="files.dir"
+ value="target/classes" />
+ <property name="jar.file.name"
+ value="HelloWorldService.jar" />
+ <property name="manifest.file.name"
+ value="osgi/sdo/ds/HelloWorldService.mf" />
+ <property name="files.list"
+ value="helloworld/sdo/HelloWorldService.class \
+ osgi/sdo/ds/HelloWorldService.xml \
+ helloworld/sdo/impl/* \
+ helloworld/sdo/Name.class \
+ helloworld/sdo/getGreetings* \
+ helloworld/sdo/HelloworldFactory.class \
+ helloworld/sdo/HelloWorldServiceComponent.class" />
+
+ </ant>
+ <ant antfile="./build-bundles.xml"
+ target="create-bundles">
+ <property name="jar.dir"
+ value="target/classes/sdo/ds" />
+ <property name="files.dir"
+ value="target/classes" />
+ <property name="jar.file.name"
+ value="HelloWorldClient.jar" />
+ <property name="manifest.file.name"
+ value="osgi/sdo/ds/HelloWorldClient.mf" />
+ <property name="files.list"
+ value="helloworld/sdo/client/HelloWorldClient.class \
+ osgi/sdo/ds/HelloWorldClient.xml \
+ sdo/ds/helloworldsdo.composite \
+ helloworld/sdo/client/HelloWorldClientComponent.class" />
+
+ </ant>
+ <ant antfile="./build-bundles.xml"
+ target="update-bundle">
+ <property name="jar.dir"
+ value="target/classes/sdo/ds" />
+ <property name="files.dir"
+ value="target/classes" />
+ <property name="jar.file.name"
+ value="HelloWorldClient.jar" />
+ <property name="source.dir"
+ value="sdo/ds" />
+ <property name="target.dir"
+ value="." />
+ <property name="files.list"
+ value="HelloWorldClient.componentType \
+ HelloWorldService.componentType \
+ META-INF/sca-contribution.xml" />
+
+ </ant>
+
</tasks>
</configuration>
</execution>
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java Sun Apr 13 12:24:44 2008
@@ -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 helloworld.sdo;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the helloworld service
+ */
+@Remotable
+public interface HelloWorldService {
+
+ public String getGreetings(Name name);
+}
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java Sun Apr 13 12:24:44 2008
@@ -0,0 +1,33 @@
+/*
+ * 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 helloworld.sdo;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(HelloWorldService.class)
+public class HelloWorldServiceComponent implements HelloWorldService {
+
+ public String getGreetings(Name name) {
+ return "Hello " + name.getFirst() + " " + name.getLast();
+ }
+
+}
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/HelloWorldServiceComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java Sun Apr 13 12:24:44 2008
@@ -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 helloworld.sdo.client;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the helloworld client
+ */
+@Remotable
+public interface HelloWorldClient {
+
+ public String getGreetings(String firstName, String lastName);
+}
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java Sun Apr 13 12:24:44 2008
@@ -0,0 +1,50 @@
+/*
+ * 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 helloworld.sdo.client;
+
+import helloworld.sdo.HelloWorldService;
+import helloworld.sdo.HelloworldFactory;
+import helloworld.sdo.Name;
+
+/**
+ * The HelloWorld client implementation
+ */
+public class HelloWorldClientComponent implements HelloWorldClient {
+
+ HelloWorldService helloWorldService;
+
+ public String getGreetings(String firstName, String lastName) {
+ Name name = HelloworldFactory.INSTANCE.createName();
+ name.setFirst(firstName);
+ name.setLast(lastName);
+ return helloWorldService.getGreetings(name);
+ }
+
+ public HelloWorldService getHelloWorldService() {
+ return helloWorldService;
+ }
+
+ public void setHelloWorldService(HelloWorldService helloWorldService) {
+ this.helloWorldService = helloWorldService;
+ }
+
+ public void unsetHelloWorldService(HelloWorldService helloWorldService) {
+ this.helloWorldService = null;
+ }
+}
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/java/helloworld/sdo/client/HelloWorldClientComponent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.mf
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.mf?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.mf (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.mf Sun Apr 13 12:24:44 2008
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: HelloWorldClient
+Bundle-SymbolicName: ds.helloworld.sdo.HelloWorldClient
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Import-Package: org.osgi.framework, org.osgi.service.component,
+ org.osoa.sca, org.osoa.sca.annotations,
+ commonj.sdo, commonj.sdo.helper,
+ org.apache.tuscany.sdo.helper, org.apache.tuscany.sdo.impl, org.apache.tuscany.sdo.model, org.apache.tuscany.sdo.model.impl,
+ org.eclipse.emf.ecore.util, org.eclipse.emf.ecore.impl,
+ helloworld.sdo
+Export-Package: helloworld.sdo.client
+Service-Component: osgi/sdo/ds/HelloWorldClient.xml
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml Sun Apr 13 12:24:44 2008
@@ -0,0 +1,33 @@
+<?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.
+-->
+<component name="HelloWorldClientComponent" immediate="true">
+ <implementation class="helloworld.sdo.client.HelloWorldClientComponent" />
+ <service>
+ <provide interface="helloworld.sdo.client.HelloWorldClient"/>
+ </service>
+ <reference
+ name="helloWorldService"
+ interface="helloworld.sdo.HelloWorldService"
+ bind="setHelloWorldService"
+ unbind="unsetHelloWorldService"
+ target="(component.service.name=JavaHelloWorldServiceComponent/HelloWorldService)"
+ policy="dynamic"
+ />
+</component>
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldClient.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.mf
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.mf?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.mf (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.mf Sun Apr 13 12:24:44 2008
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: HelloWorldService
+Bundle-SymbolicName: ds.helloworld.sdo.HelloWorldService
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Import-Package: org.osgi.framework, org.osgi.service.component,
+ org.osoa.sca, org.osoa.sca.annotations,
+ commonj.sdo, commonj.sdo.helper,
+ org.apache.tuscany.sdo.helper, org.apache.tuscany.sdo.impl, org.apache.tuscany.sdo.model, org.apache.tuscany.sdo.model.impl,
+ org.eclipse.emf.ecore.util, org.eclipse.emf.ecore.impl
+Export-Package: helloworld.sdo
+Service-Component: osgi/sdo/ds/HelloWorldService.xml
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml Sun Apr 13 12:24:44 2008
@@ -0,0 +1,25 @@
+<?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.
+-->
+<component name="HelloWorldServiceComponent" immediate="true">
+ <implementation class="helloworld.sdo.HelloWorldServiceComponent" />
+ <service>
+ <provide interface="helloworld.sdo.HelloWorldService"/>
+ </service>
+</component>
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/osgi/sdo/ds/HelloWorldService.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldClient.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldClient.componentType?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldClient.componentType (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldClient.componentType Sun Apr 13 12:24:44 2008
@@ -0,0 +1,30 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+
+ <service name="HelloWorldClient">
+ <interface.java interface="helloworld.sdo.client.HelloWorldClient"/>
+ </service>
+
+ <reference name="helloWorldService" >
+ <interface.java interface="helloworld.sdo.HelloWorldService" />
+ </reference>
+
+</componentType>
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldService.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldService.componentType?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldService.componentType (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/HelloWorldService.componentType Sun Apr 13 12:24:44 2008
@@ -0,0 +1,25 @@
+<?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.
+-->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+ <service name="HelloWorldService">
+ <interface.java interface="helloworld.sdo.HelloWorldService"/>
+ </service>
+
+</componentType>
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml Sun Apr 13 12:24:44 2008
@@ -0,0 +1,26 @@
+<?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://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <deployable composite="helloworld:helloworldsdo"/>
+
+ <import.java package="helloworld.sdo"/>
+</contribution>
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworld.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworld.wsdl?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworld.wsdl (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworld.wsdl Sun Apr 13 12:24:44 2008
@@ -0,0 +1,88 @@
+<?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.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="tns:Name" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <complexType name="Name">
+ <sequence>
+ <element name="first" type="xsd:string" />
+ <element name="last" type="xsd:string" />
+ </sequence>
+ </complexType>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction="" />
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/HelloWorldService" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworldsdo.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworldsdo.composite?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworldsdo.composite (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/main/resources/sdo/ds/helloworldsdo.composite Sun Apr 13 12:24:44 2008
@@ -0,0 +1,47 @@
+<?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" targetNamespace="http://helloworld"
+ xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0" xmlns:hw="http://helloworld"
+ name="helloworldsdo">
+
+ <component name="JavaHelloWorldServiceComponent">
+ <implementation.java class="helloworld.sdo.HelloWorldServiceComponent" />
+ </component>
+
+ <component name="JavaHelloWorldClientComponent">
+ <implementation.java class="helloworld.sdo.client.HelloWorldClientComponent" />
+ <reference name="helloWorldService" target="OSGiHelloWorldServiceComponent" />
+ </component>
+
+ <component name="OSGiHelloWorldServiceComponent">
+ <implementation.osgi xmlns="http://tuscany.apache.org/xmlns/sca/1.0"
+ bundleSymbolicName="ds.helloworld.sdo.HelloWorldService"
+ />
+ </component>
+
+ <component name="OSGiHelloWorldClientComponent">
+ <implementation.osgi xmlns="http://tuscany.apache.org/xmlns/sca/1.0"
+ bundleSymbolicName="ds.helloworld.sdo.HelloWorldClient"
+ />
+
+ <reference name="helloWorldService" target="JavaHelloWorldServiceComponent" />
+ </component>
+
+</composite>
Added: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java?rev=647615&view=auto
==============================================================================
--- incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java (added)
+++ incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java Sun Apr 13 12:24:44 2008
@@ -0,0 +1,95 @@
+/*
+ * 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 helloworld.sdo;
+
+import helloworld.sdo.client.HelloWorldClient;
+
+import java.io.File;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+
+import util.OSGiTestUtil;
+
+
+public class SdoTestCase extends TestCase {
+
+
+ private EmbeddedSCADomain scaDomain;
+
+
+ protected void setUp() throws Exception {
+
+ OSGiTestUtil.setUpOSGiTestRuntime();
+
+ scaDomain = new EmbeddedSCADomain(this.getClass().getClassLoader(), "http://localhost");
+ scaDomain.start();
+ ContributionService contributionService = scaDomain.getContributionService();
+
+ URL serviceURL = new File("./target/classes/sdo/ds/HelloWorldService.jar").toURI().toURL();
+ URL clientURL = new File("./target/classes/sdo/ds/HelloWorldClient.jar").toURI().toURL();
+
+ Contribution serviceContribution = contributionService.contribute("HelloWorldService", serviceURL, true);
+ Contribution clientContribution = contributionService.contribute("HelloWorldClient", clientURL, true);
+
+ for (Composite deployable : serviceContribution.getDeployables()) {
+ scaDomain.getDomainComposite().getIncludes().add(deployable);
+ scaDomain.buildComposite(deployable);
+ }
+ for (Composite deployable : clientContribution.getDeployables()) {
+ scaDomain.getDomainComposite().getIncludes().add(deployable);
+ scaDomain.buildComposite(deployable);
+ }
+ for (Composite deployable : clientContribution.getDeployables() ) {
+ scaDomain.getCompositeActivator().activate(deployable);
+ scaDomain.getCompositeActivator().start(deployable);
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ scaDomain.close();
+
+ OSGiTestUtil.shutdownOSGiRuntime();
+ }
+
+
+ public void testJavaToOSGi() throws Exception {
+
+ HelloWorldClient helloWorldClient = scaDomain.getService(HelloWorldClient.class, "JavaHelloWorldClientComponent");
+ String greetings = helloWorldClient.getGreetings("Apache", "Tuscany");
+ System.out.println(greetings);
+ assertEquals("Hello Apache Tuscany", greetings);
+ }
+
+ public void testOSGiToJava() throws Exception {
+
+ HelloWorldClient helloWorldClient = scaDomain.getService(HelloWorldClient.class, "OSGiHelloWorldClientComponent");
+ String greetings = helloWorldClient.getGreetings("Apache", "Tuscany");
+ System.out.println(greetings);
+ assertEquals("Hello Apache Tuscany", greetings);
+ }
+
+
+}
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/itest/osgi-implementation/src/test/java/helloworld/sdo/SdoTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org