tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1133709 - in /tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start: ./ 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/java/test/ src/test/ja...
Date Thu, 09 Jun 2011 08:30:26 GMT
Author: antelder
Date: Thu Jun  9 08:30:25 2011
New Revision: 1133709

URL: http://svn.apache.org/viewvc?rev=1133709&view=rev
Log:
Add an itest for stopping and starting a composite on a remote node

Added:
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/   (with props)
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/pom.xml
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldService.java
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldServiceImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/RemoteHelloworldService.java
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/Helloworld.composite
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/META-INF/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/META-INF/sca-contribution.xml
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/scaclient/
    tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/scaclient/StopStartTestCase.java

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun  9 08:30:25 2011
@@ -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/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/pom.xml?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/pom.xml Thu Jun  9 08:30:25
2011
@@ -0,0 +1,71 @@
+<?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>itest-nodes</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-remote-stop-start</artifactId>
+    <name>Apache Tuscany SCA iTest Remote Stop Start</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-base-runtime</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-domain-hazelcast</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+       <plugins>
+           <plugin>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-maven-plugin</artifactId>
+            <version>2.0-SNAPSHOT</version>
+             <configuration>
+                <domainURI>uri:StartStopTestCase?bind=127.0.0.1:9876</domainURI>
+             </configuration>
+             <executions>
+                <execution>
+                   <phase>process-test-classes</phase>
+                   <goals>
+                       <goal>start</goal>
+                   </goals>
+                </execution>
+                <execution>
+                   <id>stop</id>
+                   <phase>prepare-package</phase>
+                   <goals>
+                       <goal>stop</goal>
+                   </goals>
+                </execution>
+             </executions>
+           </plugin>
+       </plugins>
+    </build>
+</project>

Added: tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldService.java?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldService.java
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldService.java
Thu Jun  9 08:30:25 2011
@@ -0,0 +1,28 @@
+/*
+ * 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.Remotable;
+
+@Remotable
+public interface HelloworldService {
+
+    String sayHello(String name);
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldServiceImpl.java?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldServiceImpl.java
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/HelloworldServiceImpl.java
Thu Jun  9 08:30:25 2011
@@ -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("init: " + sayHello("world"));
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/RemoteHelloworldService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/RemoteHelloworldService.java?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/RemoteHelloworldService.java
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/java/itest/RemoteHelloworldService.java
Thu Jun  9 08:30:25 2011
@@ -0,0 +1,28 @@
+/*
+ * 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.Remotable;
+
+@Remotable
+public interface RemoteHelloworldService {
+
+    String sayHelloRemote(String name);
+
+}

Added: tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/Helloworld.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/Helloworld.composite?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/Helloworld.composite
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/Helloworld.composite
Thu Jun  9 08:30:25 2011
@@ -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/200912"
+           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/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/META-INF/sca-contribution.xml?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/META-INF/sca-contribution.xml
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/main/resources/META-INF/sca-contribution.xml
Thu Jun  9 08:30:25 2011
@@ -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/200912"
+              xmlns:itest="http://itest">
+   <deployable composite="itest:Helloworld"/>
+</contribution>
\ No newline at end of file

Added: tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/scaclient/StopStartTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/scaclient/StopStartTestCase.java?rev=1133709&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/scaclient/StopStartTestCase.java
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/nodes/remote-stop-start/src/test/java/test/scaclient/StopStartTestCase.java
Thu Jun  9 08:30:25 2011
@@ -0,0 +1,61 @@
+/*
+ * 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 test.scaclient;
+
+import itest.HelloworldService;
+
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class StopStartTestCase {
+
+    @Test
+    public void startStopInstall() throws NoSuchServiceException, NoSuchDomainException,
ContributionReadException, ActivationException, ValidationException {
+        TuscanyRuntime runtime = TuscanyRuntime.newInstance();
+        Node node1 = runtime.createNode("uri:StartStopTestCase?wka=127.0.0.1:9876");
+        Assert.assertEquals("Hello Amelia", node1.getService(HelloworldService.class, "HelloworldComponent").sayHello("Amelia"));
+        
+        String curi = node1.getInstalledContributionURIs().get(0);
+        
+        node1.stopComposite(curi, "Helloworld.composite");
+        try {
+            node1.getService(HelloworldService.class, "HelloworldComponent").sayHello("Amelia");
+            Assert.fail();
+        } catch (NoSuchServiceException e) {
+            // expected
+        }
+
+        List<String> nodes = node1.getNodeNames();
+        nodes.remove(node1.getLocalNodeName());
+        String remoteNode = nodes.get(0);
+        node1.startComposite(curi, "Helloworld.composite", remoteNode);
+
+//        Assert.assertEquals("Hello Amelia", node1.getService(HelloworldService.class, "HelloworldComponent").sayHello("Amelia"));
+    }
+}



Mime
View raw message