Author: antelder
Date: Thu Mar 13 03:17:14 2008
New Revision: 636701

URL: http://svn.apache.org/viewvc?rev=636701&view=rev
Log:
Apply patch for TUSCANY-2075 from Vamsavardhana Reddy to add a Test for setting 
a property value of a complex type within a component

Modified:
    
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
    
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
    
incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite
    
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java

Modified: 
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java?rev=636701&r1=636700&r2=636701&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
 (original)
+++ 
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
 Thu Mar 13 03:17:14 2008
@@ -98,6 +98,13 @@
      * This is a method to get a property value from the sca runtime 
environment. It is implemented in the class
      * PropertyComponentImpl
      */
+
+    public ComplexPropertyBean getComplexPropertyFive();
+
+    /**
+     * This is a method to get a property value from the sca runtime 
environment. It is implemented in the class
+     * PropertyComponentImpl
+     */
     public DataObject getSdoProperty();
 
     /**

Modified: 
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java?rev=636701&r1=636700&r2=636701&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
 Thu Mar 13 03:17:14 2008
@@ -54,6 +54,9 @@
     @Property
     protected Collection<ComplexPropertyBean> complexPropertyFour;
 
+    @Property
+    protected ComplexPropertyBean complexPropertyFive;
+
     @Property(name = "location")
     protected String location;
 
@@ -98,6 +101,10 @@
     public Collection<ComplexPropertyBean> getComplexPropertyFour() {
         //System.out.println(complexPropertyThree);
         return complexPropertyFour;
+    }
+
+    public ComplexPropertyBean getComplexPropertyFive() {
+        return complexPropertyFive;
     }
 
     public DataObject getSdoProperty() {

Modified: 
incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite?rev=636701&r1=636700&r2=636701&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite
 (original)
+++ 
incubator/tuscany/java/sca/itest/properties/src/main/resources/PropertyTest.composite
 Thu Mar 13 03:17:14 2008
@@ -74,6 +74,15 @@
             </numberSet>
         </MyMoreComplexValue>
     </property>
+    
+    <property name="complexFoo" type="foo:MyMoreComplexType">
+        <MyMoreComplexValue xmlns="">
+            <stringArray>TestString_3</stringArray>
+            <stringArray>TestString_4</stringArray>
+            <intArray>100</intArray>
+            <intArray>200</intArray>
+        </MyMoreComplexValue>
+    </property>
 
     <component name="ABCDComponent">
         <implementation.java 
class="org.apache.tuscany.sca.itest.ABCDComponentImpl"/>
@@ -195,6 +204,7 @@
                 </numberSet>
             </PropertyFourElement>
         </property>
+        <property name="complexPropertyFive" source="$complexFoo"/>
         <property name="sdoProperty" type="cust:Customer">     
                <cust:customer>
                        <cust:firstName>Firstly Name</cust:firstName>

Modified: 
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java?rev=636701&r1=636700&r2=636701&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
 Thu Mar 13 03:17:14 2008
@@ -319,6 +319,23 @@
      * Method annotated with
      * 
      * @Test is a test method where testing logic is written using various 
assert methods. This test verifies the
+     *       property values obtained using a service from the SCA runtime 
environment with the expected values
+     *       'TestString_3', 'TestString_4', 100 and 200.
+     */
+    @Test
+    public void testComplexPropertyFive() {
+        ComplexPropertyBean propBean = 
propertyService.getComplexPropertyFive();
+        assertNotNull(propBean);
+        assertEquals("TestString_3", propBean.getStringArray()[0]);
+        assertEquals("TestString_4", propBean.getStringArray()[1]);
+        assertEquals(100, propBean.getIntArray()[0]);
+        assertEquals(200, propBean.getIntArray()[1]);
+    }
+
+    /**
+     * Method annotated with
+     * 
+     * @Test is a test method where testing logic is written using various 
assert methods. This test verifies the
      *       property values obtained using a service from the SCA runtime 
environment with the expected string values
      *       'Firstly Name' , 'Middler Name' and 'Lasting Name' respectively
      */



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

Reply via email to