summaryrefslogtreecommitdiffstats
path: root/java/sca/itest
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-04 02:57:15 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-08-04 02:57:15 +0000
commit3c9d2af34b24232d3cf460daa4f8c4e10df1e1e0 (patch)
tree1f3f63cd0858e84a2b497fe0f389166edbd81178 /java/sca/itest
parentdda25533ee5b7ff828eb216f64c14ce401ed6a60 (diff)
Start to fix the itest/properties
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@800662 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/itest')
-rw-r--r--java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java21
-rw-r--r--java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java46
-rw-r--r--java/sca/itest/properties/src/main/resources/OuterPropertyTest.composite40
-rw-r--r--java/sca/itest/properties/src/main/resources/PropertyTest.composite83
-rw-r--r--java/sca/itest/properties/src/main/resources/manyValuesFileProperty.txt8
-rw-r--r--java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java47
6 files changed, 69 insertions, 176 deletions
diff --git a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
index 616d59bd50..9c7e8c3447 100644
--- a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
+++ b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
@@ -23,8 +23,6 @@ import java.util.Collection;
import test.jaxb.props.ReturnCodeProperties;
-import commonj.sdo.DataObject;
-
/**
* It is an Interface which has method declarations. Methods which are to be accessed as a service are declared in this
* interface. Implementation for these methods is provided in PropertyComponentImpl Class
@@ -65,13 +63,6 @@ public interface PropertyComponent {
public int[] getIntNumbers();
/**
- * This method is used to test injecting an Object Array
- *
- * @return The injected array
- */
- public DataObject[] getSdoArrayProperty();
-
- /**
* This is a method to get a property value from the SCA runtime environment. It is implemented in the class
* PropertyComponentImpl
*/
@@ -107,18 +98,6 @@ public interface PropertyComponent {
* This is a method to get a property value from the SCA runtime environment. It is implemented in the class
* PropertyComponentImpl
*/
- public DataObject getSdoProperty();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public DataObject getCustomerSdo();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
public ReturnCodeProperties getComplexJAXBPropertyOne();
/**
diff --git a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
index da04b1b12a..64ca749e9f 100644
--- a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
+++ b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
@@ -27,9 +27,6 @@ import org.oasisopen.sca.annotation.Property;
import test.jaxb.props.ReturnCodeProperties;
-import com.example.customer.sdo.impl.CustomerImpl;
-import commonj.sdo.DataObject;
-
/**
* This class Implements the interface PropertyComponent and gives implementation for all methods which are declared in
* that interface.
@@ -39,12 +36,6 @@ public class PropertyComponentImpl implements PropertyComponent {
protected ComponentContext context;
@Property
- protected CustomerImpl customerSdo;
-
- @Property
- protected DataObject sdoProperty;
-
- @Property
protected ComplexPropertyBean complexPropertyOne;
@Property
@@ -73,10 +64,7 @@ public class PropertyComponentImpl implements PropertyComponent {
@Property(name = "intNumbers")
protected int[] intNumbers;
-
- @Property(name = "sdoArray")
- protected DataObject[] sdoArray;
-
+
@Property
protected ReturnCodeProperties complexJAXBPropertyOne;
@@ -115,29 +103,6 @@ public class PropertyComponentImpl implements PropertyComponent {
return complexPropertyFive;
}
- public DataObject getSdoProperty() {
- return sdoProperty;
- }
-
- /**
- * It is a method which injects the property value to the variable 'sdoProperty' from the SCA runtime environment.
- */
- public void setSdoProperty(DataObject sdoProperty) {
- System.out.println("Reached here da machi");
- this.sdoProperty = sdoProperty;
- }
-
- public CustomerImpl getCustomerSdo() {
- return customerSdo;
- }
-
- /**
- * It is a method which injects the property value to the variable 'customerSdo' from the SCA runtime environment.
- */
- public void setCustomerSdo(CustomerImpl customerSdo) {
- this.customerSdo = customerSdo;
- }
-
/**
* This method is used to test injecting an Array
*
@@ -165,15 +130,6 @@ public class PropertyComponentImpl implements PropertyComponent {
return intNumbers;
}
- /**
- * This method is used to test injecting an Object Array
- *
- * @return The injected array
- */
- public DataObject[] getSdoArrayProperty() {
- return sdoArray;
- }
-
public String getLocationFromComponentContext() {
return context.getProperty(String.class, "location");
}
diff --git a/java/sca/itest/properties/src/main/resources/OuterPropertyTest.composite b/java/sca/itest/properties/src/main/resources/OuterPropertyTest.composite
index 75fa0aaa81..95ee1157bf 100644
--- a/java/sca/itest/properties/src/main/resources/OuterPropertyTest.composite
+++ b/java/sca/itest/properties/src/main/resources/OuterPropertyTest.composite
@@ -16,27 +16,27 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:foo="http://foo"
- targetNamespace="http://foo"
- name="OuterPropertyTest"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <component name="OuterComponent">
- <implementation.composite name="foo:PropertyTest"/>
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo"
+ targetNamespace="http://foo"
+ name="OuterPropertyTest"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <component name="OuterComponent">
+ <implementation.composite name="foo:PropertyTest" />
<property name="number">125</property>
<property name="complex" type="foo:MyComplexType">
- <foo:MyComplexValue xsi:type="foo:MyComplexType" >
- <foo:a>Overriden A</foo:a>
- <foo:b>Overriden B</foo:b>
- <foo:c>Overriden C</foo:c>
- <foo:d>Overriden D</foo:d>
- <foo:x>
- <foo:y>Overriden Y</foo:y>
- <foo:z>Overriden Z</foo:z>
- </foo:x>
- </foo:MyComplexValue>
- </property>
- </component>
+ <foo:MyComplexValue xsi:type="foo:MyComplexType">
+ <foo:a>Overriden A</foo:a>
+ <foo:b>Overriden B</foo:b>
+ <foo:c>Overriden C</foo:c>
+ <foo:d>Overriden D</foo:d>
+ <foo:x>
+ <foo:y>Overriden Y</foo:y>
+ <foo:z>Overriden Z</foo:z>
+ </foo:x>
+ </foo:MyComplexValue>
+ </property>
+ </component>
</composite>
diff --git a/java/sca/itest/properties/src/main/resources/PropertyTest.composite b/java/sca/itest/properties/src/main/resources/PropertyTest.composite
index 4d3715dba6..36f75d52a1 100644
--- a/java/sca/itest/properties/src/main/resources/PropertyTest.composite
+++ b/java/sca/itest/properties/src/main/resources/PropertyTest.composite
@@ -19,7 +19,6 @@
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
xmlns:foo="http://foo"
xmlns:cust="http://www.example.com/Customer"
- xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:rcp="http://test.sca.jaxb/rcprops"
targetNamespace="http://foo"
@@ -29,9 +28,6 @@
<service name="ProperterTestService" promote="ABComponent">
<interface.java interface="org.apache.tuscany.sca.itest.ABComponent"/>
</service>
-
- <dbsdo:import.sdo location="customer.xsd" />
- <!-- dbsdo:import.sdo factory="com.example.customer.sdo.SdoFactory" / -->
<property name="number" type="xsd:int">1</property>
<property name="complex" type="foo:MyComplexType" >
@@ -98,8 +94,16 @@
<property name="f" source="$complex/foo:MyComplexValue/foo:a">f</property>
<property name="xpath" source="$complex/foo:MyComplexValue/foo:x/*[local-name()='z']"/>
<property name="one" source="$number"/>
- <property name="foobar" many="true">"Apache" "Tuscany" "Java SCA"</property>
- <property name="fooInts" many="true">123 456 789</property>
+ <property name="foobar" many="true">
+ <value>Apache</value>
+ <value>Tuscany</value>
+ <value>Java SCA</value>
+ </property>
+ <property name="fooInts" many="true">
+ <value>123</value>
+ <value>456</value>
+ <value>789</value>
+ </property>
</component>
@@ -206,42 +210,43 @@
</PropertyFourElement>
</property>
<property name="complexPropertyFive" source="$complexFoo"/>
- <property name="sdoProperty" type="cust:Customer">
- <value>
- <cust:firstName>Firstly Name</cust:firstName>
- <cust:middleName>Middler Name</cust:middleName>
- <cust:lastName>Lasting Name</cust:lastName>
- </value>
- </property>
- <property name="customerSdo" type="cust:Customer">
- <value>
- <cust:firstName>Sdo Firstly Name</cust:firstName>
- <cust:middleName>Sdo Middler Name</cust:middleName>
- <cust:lastName>Sdo Lasting Name</cust:lastName>
- </value>
- </property>
<property name="location" type="xsd:string">RTP</property>
<property name="year" type="xsd:string">2006</property>
- <property name="daysOfTheWeek" many="true" type="xsd:string">"Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"</property>
- <property name="integerNumbers" many="true" type="xsd:int">1 2 3 4 5 6 7 8 9 10</property>
- <property name="intNumbers" many="true" type="xsd:int">10 9 8 7 6 5 4 3 2 1 0</property>
- <property name="sdoArray" many="true" type="cust:Customer">
- <value>
- <cust:firstName>Firstly Name 1</cust:firstName>
- <cust:middleName>Middler Name 1</cust:middleName>
- <cust:lastName>Lasting Name 1</cust:lastName>
- </value>
- <value>
- <cust:firstName>Firstly Name 2</cust:firstName>
- <cust:middleName>Middler Name 2</cust:middleName>
- <cust:lastName>Lasting Name 2</cust:lastName>
- </value>
- <value>
- <cust:firstName>Firstly Name 3</cust:firstName>
- <cust:middleName>Middler Name 3</cust:middleName>
- <cust:lastName>Lasting Name 3</cust:lastName>
- </value>
+ <property name="daysOfTheWeek" many="true" type="xsd:string">
+ <value>Monday</value>
+ <value>Tuesday</value>
+ <value>Wednesday</value>
+ <value>Thursday</value>
+ <value>Friday</value>
+ <value>Saturday</value>
+ <value>Sunday</value>
</property>
+ <property name="integerNumbers" many="true" type="xsd:int">
+ <value>1</value>
+ <value>2</value>
+ <value>3</value>
+ <value>4</value>
+ <value>5</value>
+ <value>6</value>
+ <value>7</value>
+ <value>8</value>
+ <value>9</value>
+ <value>10</value>
+ </property>
+ <property name="intNumbers" many="true" type="xsd:int">
+ <value>10</value>
+ <value>9</value>
+ <value>8</value>
+ <value>7</value>
+ <value>6</value>
+ <value>5</value>
+ <value>4</value>
+ <value>3</value>
+ <value>2</value>
+ <value>1</value>
+ <value>0</value>
+ </property>
+
<property name="complexJAXBPropertyOne" type="rcp:ReturnCodeProperties">
<MyRCProps xmlns="http://test.sca.jaxb/rcprops">
<AInt>10</AInt>
diff --git a/java/sca/itest/properties/src/main/resources/manyValuesFileProperty.txt b/java/sca/itest/properties/src/main/resources/manyValuesFileProperty.txt
index 450f397b30..6d4180ee2f 100644
--- a/java/sca/itest/properties/src/main/resources/manyValuesFileProperty.txt
+++ b/java/sca/itest/properties/src/main/resources/manyValuesFileProperty.txt
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-
-<manyFilePropertyValues>
- "fileValueOne" "fileValueTwo" "fileValueThree" "fileValueFour"
-</manyFilePropertyValues>
+<manyFilePropertyValues>fileValueOne</<manyFilePropertyValues>
+<manyFilePropertyValues>fileValueTwo</<manyFilePropertyValues>
+<manyFilePropertyValues>fileValueThree</<manyFilePropertyValues>
+<manyFilePropertyValues>fileValueFour</<manyFilePropertyValues>
diff --git a/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java b/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
index caf5a5e052..eb217600db 100644
--- a/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
+++ b/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
@@ -37,8 +37,6 @@ import org.junit.Test;
import test.jaxb.props.ReturnCodeProperties;
-import commonj.sdo.DataObject;
-
/**
* This is a class which makes user of JUnit Framework, all tests are written using JUnit notation. These tests are used
* to test different property values returned from the SCA Runtime Environment which is initialized with the composite
@@ -337,38 +335,6 @@ public class PropertyTestCase {
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
- */
- @Test
- public void testSDOProperty1() {
- DataObject dataObject = propertyService.getSdoProperty();
- assertNotNull(dataObject);
- assertEquals("Firstly Name", dataObject.get("firstName"));
- assertEquals("Middler Name", dataObject.getString("middleName"));
- assertEquals("Lasting Name", dataObject.getString("lastName"));
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected string values
- * 'Sdo Firstly Name', 'Sdo Middler Name' and 'Sdo Lasting Name' respectively
- */
- @Test
- public void testSDOProperty2() {
- DataObject dataObject = propertyService.getCustomerSdo();
- assertNotNull(dataObject);
- assertEquals("Sdo Firstly Name", dataObject.get("firstName"));
- assertEquals("Sdo Middler Name", dataObject.getString("middleName"));
- assertEquals("Sdo Lasting Name", dataObject.getString("lastName"));
- }
-
@Test
public void testGetLocationFromComponentContext() {
String location = propertyService.getLocation();
@@ -406,19 +372,6 @@ public class PropertyTestCase {
}
@Test
- public void testGetInjectedSdoArrayProperty() {
- DataObject[] sdos = propertyService.getSdoArrayProperty();
- assertNotNull(sdos);
-
- for (int i = 1; i <= 3; i++) {
- DataObject dataObject = sdos[i - 1];
- assertEquals("Firstly Name " + i, dataObject.get("firstName"));
- assertEquals("Middler Name " + i, dataObject.getString("middleName"));
- assertEquals("Lasting Name " + i, dataObject.getString("lastName"));
- }
- }
-
- @Test
public void testComplexJAXBProperty() {
ReturnCodeProperties rc = propertyService.getComplexJAXBPropertyOne();
assertEquals(10, rc.getA());