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 2006/10/26 10:09:38 UTC

svn commit: r467907 [2/2] - in /incubator/tuscany/java/samples/sca/helloworldRuby: ./ src/ src/main/ src/main/java/ src/main/java/helloworld/ src/main/resources/ src/main/resources/META-INF/ src/main/resources/META-INF/sca/ src/test/ src/test/java/ src...

Added: incubator/tuscany/java/samples/sca/helloworldRuby/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldRuby/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=467907
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldRuby/src/main/resources/META-INF/sca/default.scdl (added)
+++ incubator/tuscany/java/samples/sca/helloworldRuby/src/main/resources/META-INF/sca/default.scdl Thu Oct 26 01:09:37 2006
@@ -0,0 +1,28 @@
+<?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"
+           xmlns:rb="http://tuscany.apache.org/xmlns/rb/1.0"
+           name="HelloWorldComposite">
+
+    <component name="HelloWorldComponent">
+		<rb:implementation.rb script="HelloWorld.rb" class="Helloworld"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/java/samples/sca/helloworldRuby/src/test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Oct 26 01:09:37 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/samples/sca/helloworldRuby/src/test/java/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Oct 26 01:09:37 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Propchange: incubator/tuscany/java/samples/sca/helloworldRuby/src/test/java/helloworld/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Oct 26 01:09:37 2006
@@ -0,0 +1,14 @@
+target
+*.iws
+*.ipr
+*.iml
+.project
+.classpath
+maven.log
+velocity.log*
+junit*.properties
+surefire*.properties
+.settings
+.deployables
+.wtpmodules
+

Added: incubator/tuscany/java/samples/sca/helloworldRuby/src/test/java/helloworld/HelloWorldTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/samples/sca/helloworldRuby/src/test/java/helloworld/HelloWorldTestCase.java?view=auto&rev=467907
==============================================================================
--- incubator/tuscany/java/samples/sca/helloworldRuby/src/test/java/helloworld/HelloWorldTestCase.java (added)
+++ incubator/tuscany/java/samples/sca/helloworldRuby/src/test/java/helloworld/HelloWorldTestCase.java Thu Oct 26 01:09:37 2006
@@ -0,0 +1,47 @@
+/*
+ * 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;
+
+import java.net.URL;
+
+import org.apache.tuscany.test.SCATestCase;
+import org.osoa.sca.CompositeContext;
+import org.osoa.sca.CurrentCompositeContext;
+
+/**
+ * This shows how to test the HelloWorld service component.
+ */
+public class HelloWorldTestCase extends SCATestCase {
+
+    private HelloWorldService helloWorldService;
+
+    protected void setUp() throws Exception {
+        URL scdl = getClass().getClassLoader().getResource("META-INF/sca/ruby.system.scdl");
+        addExtension("RubyContainer", scdl);
+        setApplicationSCDL(HelloWorldService.class, "META-INF/sca/default.scdl");
+        super.setUp();
+
+        CompositeContext context = CurrentCompositeContext.getContext();
+        helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldComponent");
+    }
+
+    public void testHelloWorld() throws Exception {
+        assertEquals("Hello to petra from the Ruby World!", helloWorldService.sayHello("petra"));
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org