You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/11/01 14:13:26 UTC
svn commit: r1029640 - in
/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started:
helloworld-contribution/ helloworld-contribution/src/main/resources/
helloworld-contribution/src/main/resources/META-INF/
helloworld-contribution/src/test/java/...
Author: slaws
Date: Mon Nov 1 13:13:25 2010
New Revision: 1029640
URL: http://svn.apache.org/viewvc?rev=1029640&view=rev
Log:
TUSCANY-3674 - Add some rudimentary function to the helloworld apps so that the very first time user at least has a chance of working out what's going on.
Added:
tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html
Modified:
tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/pom.xml
tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml
tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite
tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java
tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/pom.xml
Modified: tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/pom.xml?rev=1029640&r1=1029639&r2=1029640&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/pom.xml (original)
+++ tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/pom.xml Mon Nov 1 13:13:25 2010
@@ -33,9 +33,9 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
<version>2.0-Beta1-SNAPSHOT</version>
- <scope>provided</scope>
+ <type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
Modified: tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml?rev=1029640&r1=1029639&r2=1029640&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml (original)
+++ tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml Mon Nov 1 13:13:25 2010
@@ -21,5 +21,6 @@
xmlns:sample="http://sample">
<deployable composite="sample:helloworld"/>
+ <deployable composite="sample:helloworldws"/>
</contribution>
Modified: tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite?rev=1029640&r1=1029639&r2=1029640&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite (original)
+++ tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite Mon Nov 1 13:13:25 2010
@@ -22,7 +22,7 @@
targetNamespace="http://sample"
name="helloworldws">
- <component name="HelloworldComponent">
+ <component name="HelloworldWSComponent">
<implementation.java class="sample.HelloworldImpl"/>
<service name="Helloworld">
<binding.ws />
Modified: tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java?rev=1029640&r1=1029639&r2=1029640&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java (original)
+++ tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java Mon Nov 1 13:13:25 2010
@@ -20,14 +20,29 @@ package sample;
import static org.junit.Assert.assertEquals;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.Test;
public class HelloworldTestCase {
@Test
public void testSayHello() {
- HelloworldImpl helloworld = new HelloworldImpl();
- assertEquals("Hello Petra", helloworld.sayHello("Petra"));
+ // Start up the Tuscany runtime with this modules as the contribution
+ Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "target/classes"));
+ node.start();
+
+ // This contribution is configured to deploy the helloworld.composite file
+ // automatically. This defines the HelloworldComponent. Get a local proxy to it
+ // and call the sayHello service operation.
+ Helloworld helloworld = node.getService(Helloworld.class, "HelloworldComponent");
+ String response = helloworld.sayHello("Petra");
+ System.out.println("Response from helloworld.sayHello(\"Petra\") = " + response);
+ assertEquals("Hello Petra", response);
+
+ // Stop the Tuscany runtime
+ node.stop();
}
}
Modified: tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/pom.xml?rev=1029640&r1=1029639&r2=1029640&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/pom.xml (original)
+++ tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/pom.xml Mon Nov 1 13:13:25 2010
@@ -34,9 +34,10 @@
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-base-runtime</artifactId>
+ <artifactId>tuscany-base-runtime-pom</artifactId>
<version>2.0-Beta1-SNAPSHOT</version>
- </dependency>
+ <type>pom</type>
+ </dependency>
<dependency>
<groupId>junit</groupId>
Added: tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html?rev=1029640&view=auto
==============================================================================
--- tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html (added)
+++ tuscany/sca-java-2.x/branches/2.0-Beta1/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html Mon Nov 1 13:13:25 2010
@@ -0,0 +1,32 @@
+<!--
+ * 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.
+-->
+<html>
+
+<head>
+<title>Apache Tuscany Helloworld Servlet Sample</title>
+</head>
+
+<body>
+
+<h2>Apache Tuscany Helloworld Servlet Sample</h2>
+
+<a href="http://localhost:8085/HelloworldWSComponent/Helloworld?wsdl">WSDL for binding.ws of the Helloworld service of the HelloWorldWS component</a>
+
+</body>
+</html>
\ No newline at end of file