You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2009/04/07 15:18:02 UTC
svn commit: r762761 - in /tuscany/java/sca/itest/scaclient-api: ./ src/
src/main/ src/main/java/ src/main/java/itest/ src/main/resources/
src/main/resources/META-INF/ src/test/ src/test/java/ src/test/resources/
Author: antelder
Date: Tue Apr 7 13:18:02 2009
New Revision: 762761
URL: http://svn.apache.org/viewvc?rev=762761&view=rev
Log:
Add an itest for the SCAClient API
Added:
tuscany/java/sca/itest/scaclient-api/ (with props)
tuscany/java/sca/itest/scaclient-api/pom.xml (with props)
tuscany/java/sca/itest/scaclient-api/src/
tuscany/java/sca/itest/scaclient-api/src/main/
tuscany/java/sca/itest/scaclient-api/src/main/java/
tuscany/java/sca/itest/scaclient-api/src/main/java/itest/
tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java (with props)
tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java (with props)
tuscany/java/sca/itest/scaclient-api/src/main/resources/
tuscany/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite
tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/
tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml (with props)
tuscany/java/sca/itest/scaclient-api/src/test/
tuscany/java/sca/itest/scaclient-api/src/test/java/
tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java (with props)
tuscany/java/sca/itest/scaclient-api/src/test/resources/
Propchange: tuscany/java/sca/itest/scaclient-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr 7 13:18:02 2009
@@ -0,0 +1,20 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+derby.log
+maven.log
+maven-eclipse.xml
+build.xml
+build-dependency.xml
+velocity.log*
+junit*.properties
+surefire*.properties
+.project
+.classpath
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders
Added: tuscany/java/sca/itest/scaclient-api/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scaclient-api/pom.xml?rev=762761&view=auto
==============================================================================
--- tuscany/java/sca/itest/scaclient-api/pom.xml (added)
+++ tuscany/java/sca/itest/scaclient-api/pom.xml Tue Apr 7 13:18:02 2009
@@ -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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-scaclient-api</artifactId>
+ <name>Apache Tuscany SCA iTest SCAClient API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+</project>
Propchange: tuscany/java/sca/itest/scaclient-api/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/itest/scaclient-api/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/java/sca/itest/scaclient-api/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java?rev=762761&view=auto
==============================================================================
--- tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java (added)
+++ tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java Tue Apr 7 13:18:02 2009
@@ -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 itest;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java?rev=762761&view=auto
==============================================================================
--- tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java (added)
+++ tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java Tue Apr 7 13:18:02 2009
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package itest;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+
+@EagerInit
+@Scope("COMPOSITE")
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
+
+}
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/java/itest/HelloworldServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: tuscany/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite?rev=762761&view=auto
==============================================================================
--- tuscany/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite (added)
+++ tuscany/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite Tue Apr 7 13:18:02 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="Helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="itest.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
Added: tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml?rev=762761&view=auto
==============================================================================
--- tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml (added)
+++ tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml Tue Apr 7 13:18:02 2009
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:Helloworld"/>
+</contribution>
\ No newline at end of file
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: tuscany/java/sca/itest/scaclient-api/src/main/resources/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java?rev=762761&view=auto
==============================================================================
--- tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java (added)
+++ tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java Tue Apr 7 13:18:02 2009
@@ -0,0 +1,34 @@
+
+
+import itest.HelloworldService;
+import junit.framework.TestCase;
+
+import org.oasisopen.sca.client.SCAClient;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCAClientTestCase extends TestCase {
+
+ private SCAClient scaClient;
+
+ @Override
+ protected void setUp() throws Exception {
+ scaClient = SCAClientFactory.newInstance();
+ }
+
+ public void testInvoke() throws Exception {
+ HelloworldService service = scaClient.getService(HelloworldService.class, "HelloworldComponent", null);
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ }
+
+}
Propchange: tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/java/sca/itest/scaclient-api/src/test/java/SCAClientTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date