Author: antelder
Date: Wed Nov 25 14:16:34 2009
New Revision: 884111

URL: http://svn.apache.org/viewvc?rev=884111&view=rev
Log:
Add a new helloworld sample as a plain sca contribution, and itest for the 
helloworld sample, and a fix to DomainNode so it works with that in a 
standalone domain

Added:
    tuscany/sca-java-2.x/trunk/itest/samples/   (with props)
    tuscany/sca-java-2.x/trunk/itest/samples/helloworld/   (with props)
    tuscany/sca-java-2.x/trunk/itest/samples/helloworld/pom.xml
    tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/
    tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/
    tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/
    tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/
    
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/
    
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
    
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
    
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
    tuscany/sca-java-2.x/trunk/samples/helloworld/   (with props)
    tuscany/sca-java-2.x/trunk/samples/helloworld/pom.xml
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/
    
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/Helloworld.java
    
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/HelloworldImpl.java
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/META-INF/
    
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml
    
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/helloworld.composite
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/
    tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/sample/
    
tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/sample/HelloworldTestCase.java
Modified:
    tuscany/sca-java-2.x/trunk/modules/domain-node/pom.xml
    
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java

Propchange: tuscany/sca-java-2.x/trunk/itest/samples/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Nov 25 14:16:34 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

Propchange: tuscany/sca-java-2.x/trunk/itest/samples/helloworld/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Nov 25 14:16:34 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/sca-java-2.x/trunk/itest/samples/helloworld/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/samples/helloworld/pom.xml?rev=884111&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/itest/samples/helloworld/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/itest/samples/helloworld/pom.xml Wed Nov 25 
14:16:34 2009
@@ -0,0 +1,38 @@
+<?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-samples-helloworld</artifactId>
+    <name>Apache Tuscany SCA iTest Samples Helloworld</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-domain-node</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>

Added: 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/Helloworld.java
 Wed Nov 25 14:16:34 2009
@@ -0,0 +1,27 @@
+/*
+ * 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.helloworld;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+...@remotable
+public interface Helloworld {
+    String sayHello(String name);
+}

Added: 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldDomainNodeTestCase.java
 Wed Nov 25 14:16:34 2009
@@ -0,0 +1,33 @@
+package itest.helloworld;
+
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.domain.node.DomainNode;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class HelloworldDomainNodeTestCase {
+
+    DomainNode node;
+    
+    @Before
+    public void setUp() throws Exception {
+        node = new 
DomainNode("../../../samples/helloworld/target/sample-helloworld.jar");
+    }
+
+    @Test
+    public void testHelloworld() throws NoSuchServiceException {
+        assertEquals(1, node.getServiceNames().size());
+        assertEquals("HelloworldComponent/Helloworld", 
node.getServiceNames().get(0));
+        Helloworld service = node.getService(Helloworld.class, 
"HelloworldComponent");
+        assertEquals("Hello petra", service.sayHello("petra"));
+    }
+
+    @After
+    public void stop() {
+        node.stop();
+    }
+}

Added: 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/itest/samples/helloworld/src/test/java/itest/helloworld/HelloworldNodeTestCase.java
 Wed Nov 25 14:16:34 2009
@@ -0,0 +1,31 @@
+package itest.helloworld;
+
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class HelloworldNodeTestCase {
+
+    Node node;
+    
+    @Before
+    public void setUp() throws Exception {
+        node = NodeFactory.newInstance().createNode(null, new 
String[]{"../../../samples/helloworld/target/sample-helloworld.jar"}).start();
+    }
+
+    @Test
+    public void testHelloworld() {
+        Helloworld service = node.getService(Helloworld.class, 
"HelloworldComponent");
+        assertEquals("Hello petra", service.sayHello("petra"));
+    }
+
+    @After
+    public void stop() {
+        node.stop();
+    }
+}

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/pom.xml?rev=884111&r1=884110&r2=884111&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/pom.xml Wed Nov 25 14:16:34 
2009
@@ -48,7 +48,6 @@
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-sca-client-impl</artifactId>
             <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
         </dependency>
 
          <dependency>

Modified: 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java?rev=884111&r1=884110&r2=884111&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/domain/node/DomainNode.java
 Wed Nov 25 14:16:34 2009
@@ -30,6 +30,7 @@
 import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
 import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
 import org.apache.tuscany.sca.runtime.EndpointRegistry;
@@ -60,7 +61,7 @@
     public DomainNode(String configURI, String[] contributionLocations) {
         this.domainRegistryURI = configURI;
         initDomainName(configURI);
-        nodeFactory = NodeFactory.getInstance(domainRegistryURI);
+        nodeFactory = NodeFactory.getInstance(domainName);
         for (String loc : contributionLocations) {
             addContribution(loc);
         }
@@ -82,7 +83,12 @@
         if (nodes.containsKey(uri)) {
             throw new IllegalArgumentException("contribution already added: " 
+ uri);
         }
-        Node node = nodeFactory.createNode((String)null, new String[] {uri}, 
new String[] {location}).start();
+        NodeConfiguration configuration = 
nodeFactory.createNodeConfiguration();
+        configuration.addContribution(uri, location);
+        configuration.setDomainRegistryURI(domainRegistryURI);
+        configuration.setDomainURI(domainName);
+        configuration.setURI(uri); //???
+        Node node = nodeFactory.createNode(configuration).start();
         nodes.put(uri, node);
     }
 
@@ -127,19 +133,19 @@
 
     public <T> T getService(Class<T> interfaze, String uri) throws 
NoSuchServiceException {
         try {
-            return 
SCAClientFactory.newInstance(URI.create(getDomainConfigURI())).getService(interfaze,
 uri);
+            return 
SCAClientFactory.newInstance(URI.create(getDomainName())).getService(interfaze, 
uri);
         } catch (NoSuchDomainException e) {
             throw new IllegalStateException(e);
         }
     }
 
     protected void initDomainName(String configURI) {
-        URI uri = URI.create(fixScheme(configURI));
-        String dn = uri.getHost();
-        if (dn == null || dn.length() < 1) {
-            dn = DEFAULT_DOMAIN_NAME;
-        }
-        domainName = dn;  
+//        URI uri = URI.create(fixScheme(configURI));
+//        String dn = uri.getHost();
+//        if (dn == null || dn.length() < 1) {
+//            dn = DEFAULT_DOMAIN_NAME;
+//        }
+        domainName = configURI;  
     }
     
     /**

Propchange: tuscany/sca-java-2.x/trunk/samples/helloworld/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Nov 25 14:16:34 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/sca-java-2.x/trunk/samples/helloworld/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/helloworld/pom.xml?rev=884111&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/helloworld/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/helloworld/pom.xml Wed Nov 25 14:16:34 
2009
@@ -0,0 +1,50 @@
+<?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-sca</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>sample-helloworld</artifactId>
+    <name>Apache Tuscany SCA Sample Helloworld</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.5</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>${artifactId}</finalName>
+    </build>
+</project>

Added: 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/Helloworld.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/Helloworld.java?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/Helloworld.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/Helloworld.java
 Wed Nov 25 14:16:34 2009
@@ -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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+...@remotable
+public interface Helloworld {
+
+    String sayHello(String name);
+
+}

Added: 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/HelloworldImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/HelloworldImpl.java?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/HelloworldImpl.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/java/sample/HelloworldImpl.java
 Wed Nov 25 14:16:34 2009
@@ -0,0 +1,27 @@
+/*
+ * 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 sample;
+
+public class HelloworldImpl implements Helloworld {
+
+    public String sayHello(String name) {
+        return "Hello " + name;
+    }
+
+}

Added: 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml
 (added)
+++ 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/META-INF/sca-contribution.xml
 Wed Nov 25 14:16:34 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:sample="http://sample";>
+   <deployable composite="sample:helloworld"/>
+</contribution>
\ No newline at end of file

Added: 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/helloworld.composite
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/helloworld.composite?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/helloworld.composite
 (added)
+++ 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/main/resources/helloworld.composite
 Wed Nov 25 14:16:34 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://sample";
+           name="helloworld">
+
+    <component name="HelloworldComponent">
+        <implementation.java class="sample.HelloworldImpl"/>
+    </component>
+
+</composite>

Added: 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/sample/HelloworldTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/sample/HelloworldTestCase.java?rev=884111&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/sample/HelloworldTestCase.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/samples/helloworld/src/test/java/sample/HelloworldTestCase.java
 Wed Nov 25 14:16:34 2009
@@ -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 sample;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class HelloworldTestCase {
+
+    @Test
+    public void testSayHello() {
+        HelloworldImpl helloworld = new HelloworldImpl();
+        assertEquals("Hello Petra", helloworld.sayHello("Petra"));
+    }
+
+}


Reply via email to