tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwilli...@apache.org
Subject svn commit: r666391 - in /incubator/tuscany/java/sca/vtest/assembly/ctypefile/src: main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/ main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/ main/resources/ main/resources/org/apache/tusc...
Date Tue, 10 Jun 2008 23:06:05 GMT
Author: kwilliams
Date: Tue Jun 10 16:06:05 2008
New Revision: 666391

URL: http://svn.apache.org/viewvc?rev=666391&view=rev
Log:
Adding vtests for component type file

Modified:
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/typefile.composite
    incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/AService.java
Tue Jun 10 16:06:05 2008
@@ -24,5 +24,7 @@
 public interface AService {
 
     public String getState();
+    public String getState2();
+    public String getBProperty();
     
 }

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/BService.java
Tue Jun 10 16:06:05 2008
@@ -24,5 +24,6 @@
 public interface BService {
 
     public String getState();
+    public String getSomeProperty();
     
 }

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/AServiceImpl.java
Tue Jun 10 16:06:05 2008
@@ -21,18 +21,33 @@
 
 import org.apache.tuscany.sca.vtest.assembly.ctypefile.AService;
 import org.apache.tuscany.sca.vtest.assembly.ctypefile.BService;
+import org.osoa.sca.annotations.Reference;
 
 public class AServiceImpl implements AService {
 
     private BService bService;
-
+    private BService b2Service;
+   
     public void setBService(BService b) {
         this.bService = b;
     }
+    
+    @Reference
+    public void setB2Service(BService b) {
+        this.b2Service = b;
+    }
 
     public String getState() {
         return bService.getState();
     }
+    
+    public String getState2() {
+        return b2Service.getState();
+    }
+
+    public String getBProperty() {
+        return bService.getSomeProperty();
+    }
 
 }
 

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.java
Tue Jun 10 16:06:05 2008
@@ -20,11 +20,19 @@
 package org.apache.tuscany.sca.vtest.assembly.ctypefile.impl;
 
 import org.apache.tuscany.sca.vtest.assembly.ctypefile.BService;
+import org.osoa.sca.annotations.Property;
 
 public class BServiceImpl implements BService {
+    
+    //@Property
+    protected String someProperty;
 
     public String getState() {
         return "SomeStateFromB";
     }
+    
+    public String getSomeProperty() {
+        return someProperty;
+    }
 
 } 

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/org/apache/tuscany/sca/vtest/assembly/ctypefile/impl/BServiceImpl.componentType
Tue Jun 10 16:06:05 2008
@@ -16,11 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
 -->
-<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
+<componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
   <service name="BService">
      <interface.java interface="org.apache.tuscany.sca.vtest.assembly.ctypefile.BService"/>

   </service>
-
+   
+  <property name="someProperty" type="xsd:string"></property>
+  
 </componentType>              
        
\ No newline at end of file

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/typefile.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/typefile.composite?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/typefile.composite
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/main/resources/typefile.composite
Tue Jun 10 16:06:05 2008
@@ -25,10 +25,12 @@
     <component name="AComponent">
 	    <implementation.java class="org.apache.tuscany.sca.vtest.assembly.ctypefile.impl.AServiceImpl"/>
 	    <reference name="bService" target="BComponent/BService"/>
+	    <reference name="b2Service" target="BComponent/BService"/>
      </component>
 
     <component name="BComponent">
         <implementation.java class="org.apache.tuscany.sca.vtest.assembly.ctypefile.impl.BServiceImpl"/>
+        <property name="someProperty">SomePropertyValue</property>
     </component>
-
+    
 </composite>

Modified: incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java?rev=666391&r1=666390&r2=666391&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java
(original)
+++ incubator/tuscany/java/sca/vtest/assembly/ctypefile/src/test/java/org/apache/tuscany/sca/vtest/assembly/ctypefile/CompomnentTypeFileTestCase.java
Tue Jun 10 16:06:05 2008
@@ -24,11 +24,11 @@
 import org.apache.tuscany.sca.vtest.utilities.ServiceFinder;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
+ *
  */
 public class CompomnentTypeFileTestCase {
 
@@ -43,7 +43,7 @@
             aService = ServiceFinder.getService(AService.class, "AComponent/AService");
         } catch (Exception ex) {
             ex.printStackTrace();
-        } 
+        }
     }
 
     @AfterClass
@@ -54,9 +54,54 @@
 
     }
 
+    /**
+     * Lines 435-439:
+     * <p>
+     * Step two covers the cases where introspection of the implementation is
+     * not possible or where it does not provide complete information and it
+     * involves looking for an SCA component type file. Component type
+     * information found in the component type file must be compatible with the
+     * equivalent information found from inspection of the implementation.
+     * <p>
+     * Lines 441-444:
+     * <p>
+     * In the ideal case, the component type information is determined by
+     * inspecting the implementation, for example as code annotations. The
+     * component type file provides a mechanism for the provision of component
+     * type information for implementation types where the information cannot be
+     * determined by inspecting the implementation.
+     */
     @Test
     public void typeFile1() throws Exception {
         Assert.assertSame("SomeStateFromB", aService.getState());
     }
 
+    /**
+     * Lines 439-449:
+     * <p>
+     * The component type file can specify partial information, with the
+     * remainder being derived from the implementation.
+     * <p>
+     * The first test makes use of the reference to b which is provided by the
+     * type file. The second test makes use of the reference to b2 which is
+     * provided via annotation
+     */
+    @Test
+    public void typeFile2() throws Exception {
+        Assert.assertSame("SomeStateFromB", aService.getState());
+        Assert.assertSame("SomeStateFromB", aService.getState2());
+    }
+
+    /**
+     * Lines 450-451:
+     * <p>
+     * The componentType element can contain Service elements, Reference
+     * elements and Property elements.
+     */
+    @Test
+    @Ignore ("TUSCANY-2383")
+    public void typeFile3() throws Exception {
+        Assert.assertEquals("SomePropertyValue", aService.getBProperty());
+    }
+
 }



Mime
View raw message