Author: antelder
Date: Tue Aug  1 03:27:28 2006
New Revision: 427516

URL: http://svn.apache.org/viewvc?rev=427516&view=rev
Log:
Get a JavaScript functional test going.
This makes use of the new support in the SCATestCase to add extensions and 
change the application SCDL location default
(More functional tests will come)

Added:
    
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.componentType
    
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.js
    
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/helloworld.scdl
Modified:
    
incubator/tuscany/java/sca/containers/container.javascript/src/test/java/org/apache/tuscany/container/javascript/function/HelloWorldTestCase.java

Modified: 
incubator/tuscany/java/sca/containers/container.javascript/src/test/java/org/apache/tuscany/container/javascript/function/HelloWorldTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.javascript/src/test/java/org/apache/tuscany/container/javascript/function/HelloWorldTestCase.java?rev=427516&r1=427515&r2=427516&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/containers/container.javascript/src/test/java/org/apache/tuscany/container/javascript/function/HelloWorldTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/containers/container.javascript/src/test/java/org/apache/tuscany/container/javascript/function/HelloWorldTestCase.java
 Tue Aug  1 03:27:28 2006
@@ -14,29 +14,28 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.tuscany.container.javascript.functional;
+package org.apache.tuscany.container.javascript.function;
 
 import helloworld.HelloWorldService;
 
-import org.apache.tuscany.container.javascript.utils.JavaScriptTestCase;
+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 JavaScriptTestCase {
+public class HelloWorldTestCase extends SCATestCase {
 
     private HelloWorldService helloWorldService;
 
     protected void setUp() throws Exception {
+        addExtension("JavaScriptContainer", 
getClass().getClassLoader().getResource("META-INF/sca/default.scdl"));
+        
setApplicationSCDL("org/apache/tuscany/container/javascript/function/helloworld.scdl");
         super.setUp();
 
         CompositeContext context = CurrentCompositeContext.getContext();
         helloWorldService = context.locateService(HelloWorldService.class, 
"HelloWorldComponent");
-    }
-
-    protected void tearDown() throws Exception {
     }
 
     public void testHelloWorld() throws Exception {

Added: 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.componentType
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.componentType?rev=427516&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.componentType
 (added)
+++ 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.componentType
 Tue Aug  1 03:27:28 2006
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ASCII"?>
+
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+
+    <service name="HelloWorldService">
+        <interface.java interface="helloworld.HelloWorldService"/>
+    </service>
+
+</componentType>
\ No newline at end of file

Added: 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.js
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.js?rev=427516&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.js
 (added)
+++ 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/HelloWorld.js
 Tue Aug  1 03:27:28 2006
@@ -0,0 +1,3 @@
+function sayHello(s) {
+       return "Hello " + s;
+}

Added: 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/helloworld.scdl
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/helloworld.scdl?rev=427516&view=auto
==============================================================================
--- 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/helloworld.scdl
 (added)
+++ 
incubator/tuscany/java/sca/containers/container.javascript/src/test/resources/org/apache/tuscany/container/javascript/functional/helloworld.scdl
 Tue Aug  1 03:27:28 2006
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *  Copyright (c) 2006 The Apache Software Foundation or its licensors, as 
applicable.
+ *
+ *  Licensed 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:js="http://tuscany.apache.org/xmlns/js/1.0";
+
+           name="HelloWorldComposite">
+
+    <component name="HelloWorldComponent">
+               <js:implementation.js 
script="org/apache/tuscany/container/javascript/function/HelloWorld.js"/>
+    </component>
+
+</composite>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to