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 2008/08/26 16:54:20 UTC

svn commit: r689102 - in /tuscany/java/sca: itest/validation/src/test/java/calculator/warning/ modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementatio...

Author: slaws
Date: Tue Aug 26 07:54:18 2008
New Revision: 689102

URL: http://svn.apache.org/viewvc?rev=689102&view=rev
Log:
TUSCANY-2501 reference should either be all annotated or all not annotated. Here change the vtests to test these cases separately. Currently mixing annotated and unannotated fields as references causes any unannotated reference to be overlooked. Change the reference not found warning to an error to catch cases where they are mixed by accident. Changes to other tests to take account of this. Also change implementation.widget to pick up the string name of the reference in javascript rather than the name of the variable to which the reference is assigned.  

Added:
    tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java   (with props)
    tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java   (with props)
Removed:
    tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AnotherAServiceImpl.java
Modified:
    tuscany/java/sca/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java
    tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
    tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java
    tuscany/java/sca/vtest/assembly/component/src/main/resources/zeroimplelements.composite
    tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java
    tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java
    tuscany/java/sca/vtest/java-api/annotations/reference/src/main/resources/ab.composite
    tuscany/java/sca/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java
    tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java
    tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java
    tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
    tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
    tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
    tuscany/java/sca/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite

Modified: tuscany/java/sca/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java (original)
+++ tuscany/java/sca/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java Tue Aug 26 07:54:18 2008
@@ -34,34 +34,45 @@
 import org.apache.tuscany.sca.node.SCANodeFactory;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
 
+import domain.CustomCompositeBuilder;
+
 /**
  * This shows how to test the Calculator service component.
  */
 public class ReferenceNotFoundTestCase extends TestCase {
 
-    private CalculatorService calculatorService;
-    private SCANode node;
+    private CustomCompositeBuilder customDomain;
 
     @Override
     protected void setUp() throws Exception {
+        customDomain = CustomCompositeBuilder.getInstance();
+        try {
+            customDomain.loadContribution("src/main/resources/ReferenceNotFound/Calculator.composite", 
+                                          "TestContribution", 
+                                          "src/main/resources/ReferenceNotFound/");
+            customDomain.buildContribution();
+        } catch (Exception ex){
+            throw ex;
+        }   
+        
+        
+        /*
         SCANodeFactory nodeFactory = SCANodeFactory.newInstance();
         node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceNotFound/Calculator.composite").toURL().toString(),
         		                 new SCAContribution("TestContribution", 
         		                                     new File("src/main/resources/ReferenceNotFound").toURL().toString()));
         node.start();
         calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+        */
     }
 
     @Override
     protected void tearDown() throws Exception {
-        node.stop();
+        //node.stop();
     }
 
     public void testCalculator() throws Exception {
-        ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
-        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
-        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
-        Monitor monitor = monitorFactory.createMonitor();
+        Monitor monitor = customDomain.getMonitorInstance();
         Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
         
         assertNotNull(problem);

Modified: tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java (original)
+++ tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseConfigurationBuilderImpl.java Tue Aug 26 07:54:18 2008
@@ -441,7 +441,7 @@
                 componentReference.setReference(reference);
             } else {
                 if (!componentReference.getName().startsWith("$self$.")) {
-                    warning("ReferenceNotFound", component, component.getName(), componentReference.getName());
+                    error("ReferenceNotFound", component, component.getName(), componentReference.getName());
                 }
             }
         }

Modified: tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java (original)
+++ tuscany/java/sca/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationIntrospector.java Tue Aug 26 07:54:18 2008
@@ -130,8 +130,10 @@
         String referenceName = null;
         
         String tokens[] = scriptContent.split("=");
-        tokens = tokens[0].split(" ");
-        referenceName = tokens[tokens.length -1];
+        
+        // find the string between the quotes
+        tokens = tokens[1].split("\"");
+        referenceName = tokens[1];
         
         if(referenceName != null) {
             reference = assemblyFactory.createReference();

Modified: tuscany/java/sca/vtest/assembly/component/src/main/resources/zeroimplelements.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/assembly/component/src/main/resources/zeroimplelements.composite?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/assembly/component/src/main/resources/zeroimplelements.composite (original)
+++ tuscany/java/sca/vtest/assembly/component/src/main/resources/zeroimplelements.composite Tue Aug 26 07:54:18 2008
@@ -23,8 +23,6 @@
 	name="Assemby-component-zeroimplelements-Composite">
 
     <component name="AComponent">
-	    <reference name="b" target="BComponent"/>
-	    <reference name="b2" target="B2Component"/>
     </component>
 
     <component name="BComponent">

Modified: tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java (original)
+++ tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/AService.java Tue Aug 26 07:54:18 2008
@@ -48,4 +48,8 @@
     public boolean isB7SetterCalled();
     public boolean isB16Null();
     public boolean isB17Null();
+    
+    public boolean isB4Null(); 
+    public boolean isB5Null();
+    public boolean isB6Null();
 }

Modified: tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java (original)
+++ tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AServiceImpl.java Tue Aug 26 07:54:18 2008
@@ -201,4 +201,15 @@
         return b17 == null;
     }
 
+    public boolean isB4Null() {
+        return b4 == null;
+    }
+    
+    public boolean isB5Null() {
+        return b5 == null;
+    }
+    
+    public boolean isB6Null() {
+        return b6 == null;
+    }    
 }

Added: tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java?rev=689102&view=auto
==============================================================================
--- tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java (added)
+++ tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java Tue Aug 26 07:54:18 2008
@@ -0,0 +1,141 @@
+/*
+ * 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.vtest.javaapi.annotations.reference.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.reference.BService;
+import org.osoa.sca.annotations.Service;
+
+@Service(AService.class)
+public class AUnannotatedServiceImpl implements AService {
+
+    public BService b4; // field injection (public, un-annotated)
+
+    protected BService b5; // field injection (non-public, un-annotated)
+    
+    public BService b6; // setter injection (public, un-annotated)
+
+    public AUnannotatedServiceImpl() {
+    }
+
+    public String getName() {
+        return "AService";
+    }
+
+    public String getB4Name() {
+        return b4.getName();
+    }
+
+    public String getB5Name() {
+        return b5.getName();
+    }
+
+    public void setB6(BService b6) {
+        this.b6 = b6;
+    }
+
+    public String getB6Name() {
+        return b6.getName();
+    }
+
+    public String getB1Name() {
+        return null;
+    }
+
+    public String getB2Name() {
+        return null;
+    }
+
+    public String getB3Name() {
+        return null;
+    }
+
+    public String getB7Name() {
+        return null;
+    }
+
+    public String getB8Name() {
+        return null;
+    }
+
+    public String getB9Name() {
+        return null;
+    }
+
+    public boolean isB7SetterCalled() {
+        return false;
+    }
+
+    public String getB10Name() {
+        return null;
+    }
+
+    public String getB11Name() {
+        return null;
+    }
+
+    public String getB12Name() {
+        return null;
+    }
+
+    public String getB13Name(int i) {
+        return null;
+    }
+
+    public int getB13Size() {
+        return 0;
+    }
+
+    public String getB14Name(int i) {
+        return null;
+    }
+
+    public int getB14Size() {
+        return 0;
+    }
+
+    public String getB15Name(int i) {
+        return null;
+    }
+
+    public int getB15Size() {
+        return 0;
+    }
+    
+    public boolean isB16Null() {
+        return true;
+    }
+
+    public boolean isB17Null() {
+        return true;
+    }
+    
+    public boolean isB4Null() {
+        return b4 == null;
+    }
+    
+    public boolean isB5Null() {
+        return b5 == null;
+    }
+    
+    public boolean isB6Null() {
+        return b6 == null;
+    }     
+}

Propchange: tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/vtest/java-api/annotations/reference/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/impl/AUnannotatedServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/vtest/java-api/annotations/reference/src/main/resources/ab.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/annotations/reference/src/main/resources/ab.composite?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/annotations/reference/src/main/resources/ab.composite (original)
+++ tuscany/java/sca/vtest/java-api/annotations/reference/src/main/resources/ab.composite Tue Aug 26 07:54:18 2008
@@ -26,9 +26,6 @@
         <reference name="b1" target="BComponent"/>		
         <reference name="b2" target="BComponent"/>		
         <reference name="b3" target="BComponent"/>
-        <reference name="b4" target="BComponent"/>
-        <reference name="b5" target="BComponent"/>
-        <reference name="b6" target="BComponent"/>
         <reference name="b7" target="BComponent"/>
         <reference name="b8" target="BComponent"/>
         <reference name="b9" target="BComponent"/>
@@ -40,8 +37,8 @@
         <reference name="b15" multiplicity="1..n" target="BComponent BComponent"/>
     </component>   
     
-    <component name="AnotherAComponent">
-        <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl.AnotherAServiceImpl"/>
+    <component name="AUnannotatedComponent">
+        <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.reference.impl.AUnannotatedServiceImpl"/>
         <reference name="b4" target="BComponent"/>
         <reference name="b5" target="BComponent"/>
         <reference name="b6" target="BComponent"/>

Modified: tuscany/java/sca/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java (original)
+++ tuscany/java/sca/vtest/java-api/annotations/reference/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/reference/ReferenceAnnotationTestCase.java Tue Aug 26 07:54:18 2008
@@ -110,7 +110,12 @@
      */
     @Test
     public void atReference2() throws Exception {
-        AService anotherA = ServiceFinder.getService(AService.class, "AnotherAComponent");
+        AService anotherA = ServiceFinder.getService(AService.class, "AUnannotatedComponent");
+        
+        Assert.assertFalse(anotherA.isB4Null());
+        Assert.assertTrue(anotherA.isB5Null());
+        Assert.assertFalse(anotherA.isB6Null());
+        
         Assert.assertEquals("BService", anotherA.getB4Name());
         try {
             anotherA.getB5Name();
@@ -208,4 +213,17 @@
         Assert.assertTrue(a.isB16Null());
         Assert.assertTrue(a.isB17Null());
     }
+    
+    /**
+     * Java Component Implementation Spec
+     * Section 1.2.7
+     * Line 361 when @Property and @Reference annotations are present
+     * then unannotated fields are ignored
+     */
+    @Test
+    public void atReference8() throws Exception {
+        Assert.assertTrue(a.isB4Null());
+        Assert.assertTrue(a.isB5Null());
+        Assert.assertTrue(a.isB6Null());
+    }
 }

Modified: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java (original)
+++ tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java Tue Aug 26 07:54:18 2008
@@ -19,9 +19,12 @@
 
 package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
 
+import org.osoa.sca.annotations.Remotable;
+
 /**
  * Simple Service B.
  */
+@Remotable
 public interface BService {
 
     String getBName();

Modified: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java (original)
+++ tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java Tue Aug 26 07:54:18 2008
@@ -19,6 +19,9 @@
 
 package org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext;
 
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
 public interface DComponent {
 
     public String getName();

Modified: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java (original)
+++ tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java Tue Aug 26 07:54:18 2008
@@ -45,6 +45,9 @@
     
     @Reference
     protected BService bReference;
+    
+    @Reference
+    protected DComponent dReference;    
 
     @Property(name="aProperty", required=true)
     protected String aProperty;

Added: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java?rev=689102&view=auto
==============================================================================
--- tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java (added)
+++ tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java Tue Aug 26 07:54:18 2008
@@ -0,0 +1,121 @@
+/*
+ * 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.vtest.javaapi.apis.componentcontext.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent;
+import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService;
+import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.EagerInit;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+@Service(AComponent.class)
+@Scope("COMPOSITE")
+@EagerInit
+public class AUnannotatedComponentImpl implements AComponent {
+
+    public static String rcContent = null;
+
+    protected ComponentContext componentContext;
+    
+    protected BService bReference;
+    
+    protected DComponent dReference;    
+
+    protected String aProperty;
+
+    public String getName() {
+        return "ComponentA";
+    }
+
+    @Context
+    public void setComponentContext(ComponentContext context) {
+        this.componentContext = context;
+    }
+
+    @Init
+    public void init() {
+        RequestContext rc = componentContext.getRequestContext();
+        if (rc != null) {
+            rcContent = "NotNull";
+        } else {
+            rcContent = "Null";
+        }
+    }
+
+    public String getContextURI() {
+        return componentContext.getURI();
+    }
+
+    public String getServiceBName() {
+        return componentContext.getService(BService.class, "bReference").getBName();
+    }
+
+    public String getServiceReferenceBName() {
+        ServiceReference<BService> bSR = componentContext.getServiceReference(BService.class, "bReference");
+        return bSR.getService().getBName();
+    }
+
+    public String getSelfReferenceName() {
+        ServiceReference<AComponent> aSR = componentContext.createSelfReference(AComponent.class);
+        return aSR.getService().getName();
+    }
+
+    public String getProperty() {
+        return componentContext.getProperty(String.class, "aProperty");
+    }
+
+    public String getRequestContextServiceName() {
+        return componentContext.getRequestContext().getServiceName();
+    }
+
+    public String getCastCallableReferenceServiceName() {
+        BService b = componentContext.getService(BService.class, "bReference");
+        CallableReference<BService> bCR = componentContext.cast(b);
+        return bCR.getService().getBName();
+    }
+
+    public String getCastServiceReferenceServiceName() {
+        BService b = componentContext.getService(BService.class, "bReference");
+        ServiceReference<BService> bSR = componentContext.cast(b);
+        return bSR.getService().getBName();
+    }
+
+    public void illegalCast() {
+        componentContext.cast("");
+    }
+
+    public String testServiceLookup() {
+        return componentContext.getService(DComponent.class, "dReference").getName();
+    }
+
+    public String getRequestContextContent() {
+        return rcContent;
+    }
+
+}

Propchange: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite (original)
+++ tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite Tue Aug 26 07:54:18 2008
@@ -28,6 +28,13 @@
 	    <reference name="dReference" target="DComponent"/>
 	    <property name="aProperty" type="xsd:string">PropertyA</property>
      </component>
+     
+    <component name="AUnannotatedComponent">
+        <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.AUnannotatedComponentImpl"/>
+        <reference name="bReference" target="BComponent/BService"/>
+        <reference name="dReference" target="DComponent"/>
+        <property name="aProperty" type="xsd:string">PropertyA</property>
+     </component>     
 
     <component name="BComponent">
         <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.BComponentImpl"/>

Modified: tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java (original)
+++ tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java Tue Aug 26 07:54:18 2008
@@ -35,6 +35,7 @@
 
     protected static String compositeName = "ab.composite";
     protected static AComponent a;
+    protected static AComponent aUnannotated;
     protected static BService b;
 
     @BeforeClass
@@ -43,6 +44,7 @@
             System.out.println("Setting up");
             ServiceFinder.init(compositeName);
             a = ServiceFinder.getService(AComponent.class, "AComponent");
+            aUnannotated = ServiceFinder.getService(AComponent.class, "AUnannotatedComponent");
             b = ServiceFinder.getService(BService.class, "BComponent/BService");
         } catch (Exception e) {
             e.printStackTrace();
@@ -65,6 +67,7 @@
     @Test
     public void testGetURI() throws Exception {
         Assert.assertEquals("AComponent", a.getContextURI());
+        Assert.assertEquals("AUnannotatedComponent", aUnannotated.getContextURI());
     }
 
     /**

Modified: tuscany/java/sca/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite?rev=689102&r1=689101&r2=689102&view=diff
==============================================================================
--- tuscany/java/sca/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite (original)
+++ tuscany/java/sca/vtest/java-api/conversation/lifetime/src/main/resources/lifetime.composite Tue Aug 26 07:54:18 2008
@@ -24,7 +24,6 @@
 		<implementation.java
 			class="org.apache.tuscany.sca.vtest.javaapi.conversation.lifetime.impl.AServiceImpl" />
 		<reference name="b" target="BComponent" />
-		<reference name="c" target="CComponent" />
 		<reference name="d" target="DComponent" />
 	</component>