You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2007/02/13 22:49:05 UTC

svn commit: r507247 - in /incubator/tuscany/java/sca/integration-test/specTest/src: main/java/org/apache/tuscany/sca/test/spec/ main/resources/META-INF/sca/ test/java/org/apache/tuscany/sca/test/spec/ test/resources/

Author: jboynes
Date: Tue Feb 13 13:49:04 2007
New Revision: 507247

URL: http://svn.apache.org/viewvc?view=rev&rev=507247
Log:
test injection of component context

Added:
    incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java   (with props)
    incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java   (with props)
    incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java   (with props)
    incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/
    incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl   (with props)
Modified:
    incubator/tuscany/java/sca/integration-test/specTest/src/main/resources/META-INF/sca/default.scdl

Added: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java?view=auto&rev=507247
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java (added)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java Tue Feb 13 13:49:04 2007
@@ -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 org.apache.tuscany.sca.test.spec;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ComponentContextTester {
+    boolean isContextInjected();
+
+    String getURI();
+}

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTester.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java?view=auto&rev=507247
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java (added)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java Tue Feb 13 13:49:04 2007
@@ -0,0 +1,40 @@
+/*
+ * 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 org.apache.tuscany.sca.test.spec;
+
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.Context;
+
+/**
+ * Component that tests ComponentContext functions.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ComponentContextTesterImpl implements ComponentContextTester {
+    @Context
+    public ComponentContext context;
+
+    public boolean isContextInjected() {
+        return context != null;
+    }
+
+    public String getURI() {
+        return context.getURI();
+    }
+}

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/ComponentContextTesterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/integration-test/specTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/resources/META-INF/sca/default.scdl?view=diff&rev=507247&r1=507246&r2=507247
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/resources/META-INF/sca/default.scdl (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/resources/META-INF/sca/default.scdl Tue Feb 13 13:49:04 2007
@@ -18,16 +18,21 @@
  * under the License.
 -->
 <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
-	   xmlns:foo="http://foo" 
-           name="CompositeTest">
-   
-    <include name="myTotalService" scdlLocation="myTotalService.scdl"/>
-    <include name="myListService" scdlLocation="myListService.scdl"/>
-    <include name="mySimpleServiceInRecursive" scdlLocation="mySimpleServiceInRecursive.scdl"/>
-    <include name="myServiceInRecursive" scdlLocation="myServiceInRecursive.scdl"/>
-    <include name="mySimpleServiceInRecursive2" scdlLocation="mySimpleServiceInRecursive2.scdl"/>
-    <include name="MyTotalServiceInRecursive" scdlLocation="MyTotalServiceInRecursive.scdl"/>
-    <include name="MyTotalServiceInRecursiveForReferenceOverride" scdlLocation="MyTotalServiceInRecursiveForReferenceOverride.scdl"/>
-    
-    
+           name="SpecTestComposite">
+
+    <component name="ComponentContextTester">
+        <implementation.java class="org.apache.tuscany.sca.test.spec.ComponentContextTesterImpl"/>
+    </component>
+
+    <!--
+        <include name="myTotalService" scdlLocation="myTotalService.scdl"/>
+        <include name="myListService" scdlLocation="myListService.scdl"/>
+        <include name="mySimpleServiceInRecursive" scdlLocation="mySimpleServiceInRecursive.scdl"/>
+        <include name="myServiceInRecursive" scdlLocation="myServiceInRecursive.scdl"/>
+        <include name="mySimpleServiceInRecursive2" scdlLocation="mySimpleServiceInRecursive2.scdl"/>
+        <include name="MyTotalServiceInRecursive" scdlLocation="MyTotalServiceInRecursive.scdl"/>
+        <include name="MyTotalServiceInRecursiveForReferenceOverride" scdlLocation="MyTotalServiceInRecursiveForReferenceOverride.scdl"/>
+    -->
+
+
 </composite>

Added: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java?view=auto&rev=507247
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java (added)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java Tue Feb 13 13:49:04 2007
@@ -0,0 +1,34 @@
+/*
+ * 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 org.apache.tuscany.sca.test.spec;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ComponentContextTestComponent extends TestCase {
+    @Reference
+    public ComponentContextTester tester;
+
+    public void testContextWasInjected() {
+        assertTrue(tester.isContextInjected());
+    }
+}

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl?view=auto&rev=507247
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl (added)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl Tue Feb 13 13:49:04 2007
@@ -0,0 +1,30 @@
+<?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:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+           name="SpecTestHarnessComposite">
+
+    <include name="SpecTestComposite" scdlResource="META-INF/sca/default.scdl"/>
+
+    <component name="testComponentContext">
+        <tuscany:junit class="org.apache.tuscany.sca.test.spec.ComponentContextTestComponent"/>
+        <reference name="tester">ComponentContextTester</reference>
+    </component>
+</composite>

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/integration-test/specTest/src/test/resources/itest.scdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date



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