You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/02/29 20:27:33 UTC
svn commit: r632415 [1/2] - in /incubator/tuscany/java/sca/itest:
callback-api/src/main/java/org/apache/tuscany/sca/test/
callback-api/src/test/java/org/apache/tuscany/sca/test/
contribution/src/main/java/calculator/ contribution/src/test/java/org/apac...
Author: rfeng
Date: Fri Feb 29 11:27:18 2008
New Revision: 632415
URL: http://svn.apache.org/viewvc?rev=632415&view=rev
Log:
Apply the javadoc patch from Naveen for TUSCANY-1771. I did some refotmatting. Thank you for the contribution.
Modified:
incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
incubator/tuscany/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/AddService.java
incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/CalculatorService.java
incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/DivideService.java
incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/MultiplyService.java
incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/SubtractService.java
incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java
incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
incubator/tuscany/java/sca/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
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/java/org/apache/tuscany/sca/itest/PropertyService.java
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/PropertyTestCase.java
Modified: incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java (original)
+++ incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiCallBack.java Fri Feb 29 11:27:18 2008
@@ -25,9 +25,14 @@
*
*/
public interface CallBackApiCallBack {
-
+ /**
+ * This function is defined in CallBackApiClientImpl
+ */
public void callBackMessage(String aString);
+ /**
+ * This function is defined in CallBackApiClientImpl
+ */
public void callBackIncrement(String aString);
}
Modified: incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java (original)
+++ incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClient.java Fri Feb 29 11:27:18 2008
@@ -22,7 +22,9 @@
@Remotable
public interface CallBackApiClient {
-
+ /**
+ * This function is defined in CallBackApiClientImpl
+ */
public void run();
}
Modified: incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java (original)
+++ incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiClientImpl.java Fri Feb 29 11:27:18 2008
@@ -28,11 +28,14 @@
@Reference
protected CallBackApiService aCallBackService;
-
+
private static String returnMessage = null;
private static int callBackCount = 0;
private static Object monitor = new Object();
+ /**
+ * This test calls function test 3a,3a1,3b,3c
+ */
public void run() {
// This tests basic callback patterns.
@@ -40,7 +43,7 @@
// Test3a is the basic callback where the target calls back prior to
// returning to the client.
test3a();
-
+
test3a1();
// Test3b is where the target does not call back to the client.
@@ -52,6 +55,10 @@
return;
}
+ /**
+ * This test is the basic callback where the target calls back prior to returning to the client.
+ */
+
private void test3a() {
aCallBackService.knockKnock("Knock Knock");
int count = 0;
@@ -73,7 +80,10 @@
Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage());
}
-
+
+ /**
+ * This test is the basic callback where the target calls back prior to returning to the client.
+ */
private void test3a1() {
aCallBackService.knockKnockByRef("Knock Knock");
int count = 0;
@@ -94,14 +104,21 @@
Assert.assertEquals("CallBackApiITest - test3a", "Who's There", this.getReturnMessage());
- }
+ }
+ /**
+ * This test is the basic callback where the target does not call back to the client
+ */
private void test3b() {
aCallBackService.noCallBack("No Reply Desired");
Assert.assertEquals("CallBackApiITest - test3b", 1, 1);
return;
}
+ /**
+ * This test is the basic callback where the target calls back multiple times to the client
+ */
+
private void test3c() {
aCallBackService.multiCallBack("Call me back 3 times");
int count = 0;
@@ -124,22 +141,47 @@
return;
}
+ /**
+ * This function returns a string
+ *
+ * @param void
+ * @return String result string
+ */
+
public String getReturnMessage() {
return returnMessage;
}
+ /**
+ * This function set the returnMessage string
+ *
+ * @param String
+ */
public void setReturnMessage(String aReturnMessage) {
returnMessage = aReturnMessage;
}
+ /**
+ * This function returns the callBackCount variable
+ *
+ * @return Integer callBackCount variable
+ */
public int getCallBackCount() {
return callBackCount;
}
+ /**
+ * This function increments callBackCount variable by 1
+ */
public void incrementCallBackCount() {
callBackCount++;
}
+ /**
+ * This function prints a message synched with setReturnMessage function
+ *
+ * @param String
+ */
public void callBackMessage(String aString) {
System.out.println("Entering callback callBackMessage: " + aString);
synchronized (monitor) {
@@ -148,6 +190,11 @@
}
}
+ /**
+ * This function prints a message synched with incrementCallBackCount function
+ *
+ * @param String
+ */
public void callBackIncrement(String aString) {
System.out.println("Entering callback increment: " + aString);
synchronized (monitor) {
Modified: incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java (original)
+++ incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiService.java Fri Feb 29 11:27:18 2008
@@ -27,11 +27,24 @@
*
*/
public interface CallBackApiService {
-
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
public void knockKnock(String aString);
+
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
public void knockKnockByRef(String aString);
+
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
public void noCallBack(String aString);
+ /**
+ * This function is defined in CallBackApiServiceImpl
+ */
public void multiCallBack(String aString);
}
Modified: incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java (original)
+++ incubator/tuscany/java/sca/itest/callback-api/src/main/java/org/apache/tuscany/sca/test/CallBackApiServiceImpl.java Fri Feb 29 11:27:18 2008
@@ -30,12 +30,21 @@
@Context
protected ComponentContext componentContext;
-
+ /**
+ * Object of CallBackApiCallBack class
+ */
private CallBackApiCallBack callback;
-
+
@Callback
protected CallableReference<CallBackApiCallBack> callbackRef;
+ /**
+ * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function and calls the
+ * callBackMessage function.
+ *
+ * @param aString String passed by a function call
+ */
+
public void knockKnock(String aString) {
System.out.println("CallBackApiServiceImpl message received: " + aString);
@@ -45,7 +54,13 @@
return;
}
-
+
+ /**
+ * This function calls the callBackMessage function. <br>
+ * The reference to this function is recieved from Call back reference to the class CallBackApiService.
+ *
+ * @param aString String passed by a function call
+ */
public void knockKnockByRef(String aString) {
System.out.println("CallBackApiServiceImpl message received: " + aString);
@@ -53,8 +68,15 @@
System.out.println("CallBackApiServiceImpl response sent");
return;
- }
+ }
+ /**
+ * This function get an object of CallBackApiServiceImpl by calling getCallBackInterface function. <br>
+ * This function then places multiple callBack using the callbackIncrement function defined in
+ * callBack.ApiServiceImpl
+ *
+ * @param aString String passed by a function call
+ */
public void multiCallBack(String aString) {
callback = this.getCallBackInterface();
@@ -70,6 +92,11 @@
}
+ /**
+ * This function does not callBack any function.
+ *
+ * @param aString String passed by a function call
+ */
public void noCallBack(String aString) {
System.out.println("CallBackApiServiceImpl message received: " + aString);
@@ -78,6 +105,11 @@
}
+ /**
+ * This function get an object of CallBackApiServiceImpl from the present componentContext
+ *
+ * @param void
+ */
private CallBackApiCallBack getCallBackInterface() {
System.out.println("CallBackApiServiceImpl getting request context");
RequestContext rc = componentContext.getRequestContext();
Modified: incubator/tuscany/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/callback-api/src/test/java/org/apache/tuscany/sca/test/CallBackApiTestCase.java Fri Feb 29 11:27:18 2008
@@ -27,19 +27,33 @@
private static SCADomain domain;
private CallBackApiClient aCallBackClient;
+ /**
+ * This function uses the Instance of CallBackApiClient.class <br>
+ * This function calls the run function defined in the CallBackApiClinet Interface <br>
+ * which in turn executes the following test cases. <br>
+ * 1. Basic callback patterns <br>
+ * 2. Test in which the target does not call back to the client <br>
+ * 3. Test in which the target calls back multiple times to the client.
+ */
public void testCallBackBasic() {
aCallBackClient.run();
}
+ /**
+ * This function creates the SCADomain instance and gets an Instance of CallBackApiClient.class
+ */
@Override
protected void setUp() throws Exception {
- if( domain==null ) {
- domain = SCADomain.newInstance("CallBackApiTest.composite");
- }
+ if (domain == null) {
+ domain = SCADomain.newInstance("CallBackApiTest.composite");
+ }
aCallBackClient = domain.getService(CallBackApiClient.class, "CallBackApiClient");
}
+ /**
+ * This function destroys the SCADomain instance that was created in setUp()
+ */
@Override
protected void tearDown() throws Exception {
domain.close();
Modified: incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/AddService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/AddService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/AddService.java (original)
+++ incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/AddService.java Fri Feb 29 11:27:18 2008
@@ -18,8 +18,15 @@
*/
package calculator;
+/**
+ * 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 AddServiceImpl Class
+ */
public interface AddService {
+ /**
+ * This is an add method which takes 2 parameters of double type and returns the sum of two parameters
+ */
double add(double n1, double n2);
}
Modified: incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/CalculatorService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/CalculatorService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/CalculatorService.java (original)
+++ incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/CalculatorService.java Fri Feb 29 11:27:18 2008
@@ -18,9 +18,9 @@
*/
package calculator;
-
/**
- * The Calculator service interface.
+ * This is a Calculator service interface. All the methods which are to be accessed as a service are declared in this
+ * interface but not the implementation of those methods.
*/
public interface CalculatorService {
Modified: incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/DivideService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/DivideService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/DivideService.java (original)
+++ incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/DivideService.java Fri Feb 29 11:27:18 2008
@@ -18,8 +18,15 @@
*/
package calculator;
+/**
+ * This is an interface for Divide Service which has divide method declared which is implemented in DivideServiceImpl
+ * class
+ */
public interface DivideService {
+ /**
+ * This is a divide method which takes 2 parameters of double type and returns the result of division
+ */
double divide(double n1, double n2);
}
Modified: incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/MultiplyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/MultiplyService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/MultiplyService.java (original)
+++ incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/MultiplyService.java Fri Feb 29 11:27:18 2008
@@ -18,8 +18,16 @@
*/
package calculator;
+/**
+ * This is an interface for Multiply Service which has multiply method declared which is implemented in
+ * MultiplyServiceImpl class
+ */
public interface MultiplyService {
+ /**
+ * This is a multiply method which takes 2 parameters of double type and returns the result of multiplication of the
+ * two parameters
+ */
double multiply(double n1, double n2);
}
Modified: incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/SubtractService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/SubtractService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/SubtractService.java (original)
+++ incubator/tuscany/java/sca/itest/contribution/src/main/java/calculator/SubtractService.java Fri Feb 29 11:27:18 2008
@@ -18,8 +18,16 @@
*/
package calculator;
+/**
+ * This is an interface for Subtract Service which has subtract method declared which is implemented in
+ * SubtractServiceImpl class
+ */
+
public interface SubtractService {
+ /**
+ * This is a subtract method which takes 2 parameters of double type and returns the result of subtraction.
+ */
double subtract(double n1, double n2);
}
Modified: incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/contribution/src/test/java/org/apache/tuscany/sca/test/contribution/ContributionServiceTestCase.java Fri Feb 29 11:27:18 2008
@@ -50,12 +50,18 @@
private EmbeddedSCADomain domain;
private ContributionService contributionService;
+ /**
+ * setUp() is a method in JUnit Frame Work which is executed before all others methods in the class extending
+ * unit.framework.TestCase. So this method is used to create a test Embedded SCA Domain, to start the SCA Domain and
+ * to get a reference to the contribution service
+ */
+
@Override
protected void setUp() throws Exception {
//Create a test embedded SCA domain
cl = getClass().getClassLoader();
domain = new EmbeddedSCADomain(cl, "http://localhost");
-
+
//Start the domain
domain.start();
@@ -63,6 +69,10 @@
contributionService = domain.getContributionService();
}
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the string assigned to contrututionId with the value retrieved from the SCA runtime.
+ */
public void testContributeJAR() throws Exception {
URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
//URL contributionLocation = new URL("file:/D:/dev/Opensource/Apache/Tuscany/source/java/sca/samples/calculator/target/sample-calculator.jar");
@@ -71,6 +81,11 @@
assertNotNull(contributionService.getContribution(contributionId));
}
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the string assigned to contrututionId with the value retrieved from the SCA runtime using
+ * contributionService.
+ */
public void testStoreContributionPackageInRepository() throws Exception {
URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
String contributionId = CONTRIBUTION_001_ID;
@@ -87,6 +102,11 @@
assertTrue(contributionFile.exists());
}
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the string assigned to contrututionId with the value retrieved from the SCA runtime using
+ * contributionService.
+ */
public void testStoreContributionStreamInRepository() throws Exception {
URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
String contributionId = CONTRIBUTION_001_ID;
@@ -109,6 +129,11 @@
assertTrue(contributionFile.exists());
}
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the string assigned to contributionId1,contributionId2 with the value retrieved from the SCA
+ * runtime using contributionService.
+ */
public void testStoreDuplicatedContributionInRepository() throws Exception {
URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
String contributionId1 = CONTRIBUTION_001_ID;
@@ -119,20 +144,30 @@
assertNotNull(contributionService.getContribution(contributionId2));
}
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the string assigned to contributionId with the value retrieved from the SCA runtime using
+ * contributionService.
+ */
public void testContributeFolder() throws Exception {
- File rootContributionFolder = new File(FOLDER_CONTRIBUTION);
- String contributionId = CONTRIBUTION_001_ID;
- //first rename the sca-contribution metadata file
- //File calculatorMetadataFile = new File("target/classes/calculator/sca-contribution.xml");
- //File metadataDirectory = new File("target/classes/META-INF/");
- //if (!metadataDirectory.exists()) {
- // FileHelper.forceMkdir(metadataDirectory);
- //}
- //FileHelper.copyFileToDirectory(calculatorMetadataFile, metadataDirectory);
- contributionService.contribute(contributionId, rootContributionFolder.toURL(), false);
- assertNotNull(contributionService.getContribution(contributionId));
+ File rootContributionFolder = new File(FOLDER_CONTRIBUTION);
+ String contributionId = CONTRIBUTION_001_ID;
+ //first rename the sca-contribution metadata file
+ //File calculatorMetadataFile = new File("target/classes/calculator/sca-contribution.xml");
+ //File metadataDirectory = new File("target/classes/META-INF/");
+ //if (!metadataDirectory.exists()) {
+ // FileHelper.forceMkdir(metadataDirectory);
+ //}
+ //FileHelper.copyFileToDirectory(calculatorMetadataFile, metadataDirectory);
+ contributionService.contribute(contributionId, rootContributionFolder.toURL(), false);
+ assertNotNull(contributionService.getContribution(contributionId));
}
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the string assigned to contributionId, artifactId with the value retrieved from the SCA runtime
+ * using contributionService.
+ */
public void testAddDeploymentComposites() throws Exception {
URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
String contributionId = CONTRIBUTION_001_ID;
Modified: incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java (original)
+++ incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/OverloadASourceTarget.java Fri Feb 29 11:27:18 2008
@@ -19,24 +19,43 @@
package org.apache.tuscany.sca.test.opoverload;
-
/**
- *
+ * This is an Interface which has methods declared but not implemented, These methods will be implemented in
+ * OverloadATarget Class and OverloadASource This class has methods with overloaded parameters.
*/
+
//@AllowsPassByReference
public interface OverloadASourceTarget {
final String opName = "operationA:";
-
+
+ /**
+ * Method with no parameters
+ */
String operationA();
-
+
+ /**
+ * Method with one integer parameter
+ */
String operationA(int parm1);
-
+
+ /**
+ * Method with one integer parameter and one string parameter
+ */
String operationA(int parm1, String parm2);
-
+
+ /**
+ * Method with one one string parameter and one integer parameter
+ */
String operationA(String parm1, int parm2);
+ /**
+ * Method with one string parameter
+ */
String operationA(String string);
+ /**
+ * Method which throws an illegal argument exception in case of any exceptions.
+ */
String[] operationAall();
-}
\ No newline at end of file
+}
Modified: incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java (original)
+++ incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadASource.java Fri Feb 29 11:27:18 2008
@@ -26,17 +26,20 @@
import org.osoa.sca.annotations.Service;
/**
- *
+ * This class Implements the interface OverloadASourceTarget, and gives implementation for all methods which are
+ * declared in the OverloadASourceTarget interface.
*/
@Service(OverloadASourceTarget.class)
-public class OverloadASource implements OverloadASourceTarget{
+public class OverloadASource implements OverloadASourceTarget {
public OverloadASourceTarget overloadASourceTarget;
+
/**
- *
+ * This is a default constructor
*/
- public OverloadASource() {
-
+ public OverloadASource() {
+
}
+
/**
* @return
* @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
@@ -47,20 +50,20 @@
ret.add(overloadASourceTarget.operationA());
ret.add(overloadASourceTarget.operationA(11));
ret.add(overloadASourceTarget.operationA("eleven"));
- ret.add(overloadASourceTarget.operationA(3,"three"));
- ret.add(overloadASourceTarget.operationA("four",4));
- return (String[]) ret.toArray(new String[ret.size()]);
+ ret.add(overloadASourceTarget.operationA(3, "three"));
+ ret.add(overloadASourceTarget.operationA("four", 4));
+ return (String[])ret.toArray(new String[ret.size()]);
}
-
-
+
/**
* @return
* @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA()
*/
public String operationA() {
assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
- return overloadASourceTarget.operationA();
+ return overloadASourceTarget.operationA();
}
+
/**
* @param parm1
* @return
@@ -70,6 +73,7 @@
assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
return overloadASourceTarget.operationA(parm1);
}
+
/**
* @param parm1
* @param parm2
@@ -80,10 +84,12 @@
assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
return overloadASourceTarget.operationA(parm1, parm2);
}
+
public String operationA(String string) {
assert overloadASourceTarget != null : "reference overloadASourceTarget is null";
return overloadASourceTarget.operationA(string);
}
+
/**
* @param parm1
* @param parm2
@@ -95,6 +101,9 @@
return overloadASourceTarget.operationA(parm1, parm2);
}
+ /**
+ * This method which is used by all the overloaded functions to set the source target
+ */
@Reference
public void setOverloadASourceTarget(OverloadASourceTarget overloadASourceTarget) {
assert overloadASourceTarget != null : "reference overloadASourceTarget is set tonull";
Modified: incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java (original)
+++ incubator/tuscany/java/sca/itest/operation-overloading/src/main/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATarget.java Fri Feb 29 11:27:18 2008
@@ -23,13 +23,14 @@
import org.osoa.sca.annotations.Service;
/**
- *
+ * This class Implements the interface OverloadASourceTarget, and gives implementation for all methods which are
+ * declared in the OverloadASourceTarget interface.
*/
@Service(OverloadASourceTarget.class)
public class OverloadATarget implements OverloadASourceTarget {
/**
- *
+ * This is a default Constructor
*/
public OverloadATarget() {
@@ -50,8 +51,7 @@
/*
* (non-Javadoc)
*
- * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int,
- * java.lang.String)
+ * @see org.apache.tuscany.sca.test.opoverload.OverloadASourceTarget#operationA(int, java.lang.String)
*/
public String operationA(int parm1, String parm2) {
final String ret = opName + parm1 + parm2;
@@ -83,6 +83,9 @@
return ret;
}
+ /**
+ * This method is used to print the message returned by all the overloaded functions
+ */
private void out(String msg) {
java.lang.System.out.println(msg);
@@ -90,7 +93,7 @@
public String[] operationAall() {
throw new IllegalArgumentException("not supported");
-
+
}
}
Modified: incubator/tuscany/java/sca/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java (original)
+++ incubator/tuscany/java/sca/itest/operation-overloading/src/test/java/org/apache/tuscany/sca/test/opoverload/impl/OverloadATestCase.java Fri Feb 29 11:27:18 2008
@@ -28,43 +28,55 @@
private SCADomain domain;
private OverloadASourceTarget overloadA;
+ /**
+ * Method prefixed with 'test' is a test method where testing logic is written using various assert methods. This
+ * test verifies the values compared are same as the values retrieved from the SCA runtime.
+ */
public void testOperationAall() {
- String[] result= overloadA.operationAall();
- assertEquals(5, result.length);
- assertEquals(OverloadASourceTarget.opName , result[0]);
- assertEquals(OverloadASourceTarget.opName + 11, result[1]);
- assertEquals(OverloadASourceTarget.opName + "eleven", result[2]);
- assertEquals(OverloadASourceTarget.opName + 3 + "three", result[3]);
- assertEquals(OverloadASourceTarget.opName + "four" + 4, result[4]);
- }
-
-// public void testOperationAInt() {
-// String result= overloadA.operationA(29);
-// assertEquals(OverloadASourceTarget.opName + 29, result);
-// }
-//
-// public void testOperationAString() {
-// String result= overloadA.operationA("rick:-)");
-// assertEquals(OverloadASourceTarget.opName + "rick:-)", result);
-// }
-//
-// public void testOperationAIntString() {
-// String result= overloadA.operationA(123, "Tuscany");
-// assertEquals(OverloadASourceTarget.opName +123+ "Tuscany", result);
-// }
-//
-// public void testOperationStringInt() {
-// String result= overloadA.operationA("StringInt", 77);
-// assertEquals(OverloadASourceTarget.opName + "StringInt" + 77, result);
-// }
-//
-
+ String[] result = overloadA.operationAall();
+ assertEquals(5, result.length);
+ assertEquals(OverloadASourceTarget.opName, result[0]);
+ assertEquals(OverloadASourceTarget.opName + 11, result[1]);
+ assertEquals(OverloadASourceTarget.opName + "eleven", result[2]);
+ assertEquals(OverloadASourceTarget.opName + 3 + "three", result[3]);
+ assertEquals(OverloadASourceTarget.opName + "four" + 4, result[4]);
+ }
+
+ public void testOperationAInt() {
+ String result = overloadA.operationA(29);
+ assertEquals(OverloadASourceTarget.opName + 29, result);
+ }
+
+ public void testOperationAString() {
+ String result = overloadA.operationA("rick:-)");
+ assertEquals(OverloadASourceTarget.opName + "rick:-)", result);
+ }
+
+ public void testOperationAIntString() {
+ String result = overloadA.operationA(123, "Tuscany");
+ assertEquals(OverloadASourceTarget.opName + 123 + "Tuscany", result);
+ }
+
+ public void testOperationStringInt() {
+ String result = overloadA.operationA("StringInt", 77);
+ assertEquals(OverloadASourceTarget.opName + "StringInt" + 77, result);
+ }
+
+ /**
+ * setUp() is a method in JUnit Frame Work which is executed before all others methods in the class extending
+ * unit.framework.TestCase. So this method is used to create a test Embedded SCA Domain, to start the SCA Domain and
+ * to get a reference to the contribution service
+ */
@Override
protected void setUp() throws Exception {
domain = SCADomain.newInstance("OperationOverload.composite");
overloadA = domain.getService(OverloadASourceTarget.class, "OverloadASourceComponent");
}
-
+
+ /**
+ * tearDown() is a method in JUnit Frame Work which is executed after all other methods in the class extending
+ * unit.framework.TestCase. So this method is used to close the SCA domain.
+ */
@Override
protected void tearDown() throws Exception {
domain.close();
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyService.java Fri Feb 29 11:27:18 2008
@@ -16,11 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package mysca.test.myservice.impl;
+package mysca.test.myservice.impl;
public interface MyService {
+ /**
+ * This is a method to get the location property value from the sca runtime environment. It is implemented in the
+ * class MyServiceImpl
+ */
String getLocation();
+ /**
+ * This is a method to get the year property value from the sca runtime environment. It is implemented in the class
+ * MyServiceImpl
+ */
String getYear();
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyServiceImpl.java Fri Feb 29 11:27:18 2008
@@ -27,6 +27,13 @@
import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Service;
+/**
+ * This class Implements the interface MyService and gives implementation for all methods which are declared in that
+ * interface. scope is specified as Composite using
+ *
+ * @scope annotaiton.
+ */
+
@Service(MyService.class)
public class MyServiceImpl implements MyService {
@@ -39,19 +46,27 @@
@ComponentName
protected String componentName;
-
private Logger logger;
+ /**
+ * @ to print the message in the log
+ */
public MyServiceImpl() {
logger = Logger.getAnonymousLogger();
logger.info("creating service instance...");
}
+ /**
+ * @Init annotation to Start the service. Which is executed all the time
+ */
@Init
public void start() {
logger.info("Start service..");
}
+ /**
+ * @Destroy annotation to stop the service. Which is executed in the end
+ */
@Destroy
public void stop() {
logger.info("Stop service..");
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/mysca/test/myservice/impl/MyTotalServiceImpl.java Fri Feb 29 11:27:18 2008
@@ -21,6 +21,13 @@
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
+/**
+ * This class Implements the interface MyService and gives implementation for all methods which are declared in that
+ * interface. scope is specified as Composite using
+ *
+ * @scope annotaiton.
+ */
+
@Service(MyService.class)
public class MyTotalServiceImpl implements MyService {
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponent.java Fri Feb 29 11:27:18 2008
@@ -18,10 +18,33 @@
*/
package org.apache.tuscany.sca.itest;
+/**
+ * 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 ABCDComponentImpl Class
+ */
public interface ABCDComponent {
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
String getA();
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
String getB();
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
String getC();
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABCDComponentImpl
+ */
String getD();
}
-
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABCDComponentImpl.java Fri Feb 29 11:27:18 2008
@@ -22,33 +22,51 @@
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
+/**
+ * This class Implements the interface ABCDComponent and gives implementation for all methods which are declared in that
+ * interface. scope is specified as Composite using
+ *
+ * @scope annotaiton.
+ */
@Scope("COMPOSITE")
public class ABCDComponentImpl implements ABCDComponent {
private ABComponent abComponent;
private CDComponent cdComponent;
-
+
+ /**
+ * It is a method which injects the property value to the variable 'abComponent' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
@Reference
public void setAb(ABComponent component) {
this.abComponent = component;
}
-
+
+ /**
+ * It is a method which injects the property value to the variable 'cdComponent' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
@Reference
public void setCd(CDComponent component) {
this.cdComponent = component;
}
-
+
public String getA() {
return this.abComponent.getA();
}
-
+
public String getB() {
- return this.abComponent.getB();
+ return this.abComponent.getB();
}
-
+
public String getC() {
return this.cdComponent.getC();
}
-
+
public String getD() {
return this.cdComponent.getD();
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponent.java Fri Feb 29 11:27:18 2008
@@ -22,14 +22,54 @@
import java.util.Collection;
import org.osoa.sca.annotations.Remotable;
+
+/**
+ * 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 ABComponentImpl Class
+ */
@Remotable
-public interface ABComponent {
+public interface ABComponent {
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
String getA();
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
String getB();
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
String getZ();
+
+ /**
+ * This is a method to get an integer property value from the sca runtime environment. It is implemented in the
+ * class ABComponentImpl
+ */
int getIntValue();
+
+ /**
+ * This is a method to get a string property value from the sca runtime environment. It is implemented in the class
+ * ABComponentImpl
+ */
String getF();
+
+ /**
+ * This is a method to get collectioon of property values from the sca runtime environment. It is implemented in the
+ * class ABComponentImpl
+ */
Collection<String> getManyStringValues();
+
+ /**
+ * This is a method to get collection of property value from the sca runtime environment. It is implemented in the
+ * class ABComponentImpl
+ */
Collection<Integer> getManyIntegers();
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ABComponentImpl.java Fri Feb 29 11:27:18 2008
@@ -23,6 +23,11 @@
import org.osoa.sca.annotations.Property;
+/**
+ * This class Implements the interface ABComponent and gives implementation for all methods which are declared in that
+ * interface.
+ */
+
public class ABComponentImpl implements ABComponent {
private String aProperty;
@@ -33,66 +38,94 @@
private String zProperty;
private String fProperty;
- @Property(name="xpath")
+ /**
+ * It is a method which injects the property value to the variable 'zProperty' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property(name = "xpath")
public void setZProperty(final String value) {
this.zProperty = value;
}
-
- @Property(name="foobar")
+
+ /**
+ * It is a method which injects collection of property values to the variable 'manyStringValues' from the SCA
+ * runtime environment using Annotations.
+ */
+ @Property(name = "foobar")
public void setManyStringValues(final Collection<String> value) {
this.manyStringValues = value;
}
-
- @Property(name="fooInts")
+
+ /**
+ * It is a method which injects collection of integer property values to the variable 'manyIntegerValues' from the
+ * SCA runtime environment using Annotations.
+ */
+ @Property(name = "fooInts")
public void setManyIntegers(final Collection<Integer> value) {
this.manyIntegerValues = value;
}
-
+
+ /**
+ * It is a method which injects the property value to the variable 'aProperty' from the SCA runtime environment
+ * using Annotations.
+ */
@Property
public void setA(final String A) {
this.aProperty = A;
}
+ /**
+ * It is a method which injects the property value to the variable 'bProperty' from the SCA runtime environment
+ * using Annotations.
+ */
@Property
public void setB(final String B) {
this.bProperty = B;
}
-
- @Property
+
+ /**
+ * It is a method which injects the property value to the variable 'fProperty' from the SCA runtime environment
+ * using Annotations.
+ */
+ @Property
public void setF(final String F) {
this.fProperty = F;
}
-
+
+ /**
+ * It is a method which injects integer property value to the variable 'intValue' from the SCA runtime environment
+ * using Annotations.
+ */
@Property
public void setOne(final int value) {
this.intValue = value;
}
-
+
public String getA() {
return this.aProperty;
}
-
+
public String getB() {
return this.bProperty;
}
-
+
public int getIntValue() {
return this.intValue;
}
-
+
public String getZ() {
return this.zProperty;
}
-
+
public String getF() {
return this.fProperty;
}
- public Collection<String> getManyStringValues() {
- return manyStringValues;
- }
-
- public Collection<Integer> getManyIntegers() {
- return manyIntegerValues;
- }
+ public Collection<String> getManyStringValues() {
+ return manyStringValues;
+ }
+
+ public Collection<Integer> getManyIntegers() {
+ return manyIntegerValues;
+ }
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponent.java Fri Feb 29 11:27:18 2008
@@ -21,13 +21,51 @@
import java.util.Collection;
-public interface CDComponent {
+/**
+ * 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 CDComponentImpl Class
+ */
+public interface CDComponent {
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
String getC();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
String getC2();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
String getD();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
String getNoSource();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
String getFileProperty();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
Collection<String> getManyValuesFileProperty();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * CDComponentImpl Class
+ */
int getOverrideValue();
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/CDComponentImpl.java Fri Feb 29 11:27:18 2008
@@ -23,6 +23,10 @@
import org.osoa.sca.annotations.Property;
+/**
+ * This class Implements the interface CDComponent and gives implementation for all methods which are declared in that
+ * interface.
+ */
public class CDComponentImpl implements CDComponent {
private String cProperty;
@@ -33,65 +37,107 @@
private int overrideNumber;
private String cProperty2;
- @Property(name="nonFileProperty")
+ /**
+ * It is a method which injects the property value to the variable 'cProperty2' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "nonFileProperty")
public void setC2(final String value) {
this.cProperty2 = value;
}
- @Property(name="two")
+
+ /**
+ * It is a method which injects the property value to the variable 'overrideNumber' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "two")
public void setOverrideNumber(final int value) {
this.overrideNumber = value;
}
-
- @Property(name="fileProperty")
+
+ /**
+ * It is a method which injects the property value to the variable 'fileProperty' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "fileProperty")
public void setFileProp(final String value) {
this.fileProperty = value;
}
-
- @Property(name="manyValuesFileProperty")
+
+ /**
+ * It is a method which injects the property value to the variable 'manyValuesFileProperty' from the SCA runtime
+ * environment using
+ *
+ * @Property Annotations.
+ */
+ @Property(name = "manyValuesFileProperty")
public void setFileManyValueProp(final Collection<String> values) {
this.manyValuesFileProperty = values;
}
-
+
+ /**
+ * It is a method which injects the property value to the variable 'cProperty' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
@Property
public void setC(final String C) {
this.cProperty = C;
}
+ /**
+ * It is a method which injects the property value to the variable 'dProperty' from the SCA runtime environment
+ * using
+ *
+ * @Property Annotations.
+ */
@Property
public void setD(final String D) {
this.dProperty = D;
}
-
+
+ /**
+ * It is a method which injects the property value to the variable 'nosource' from the SCA runtime environment using
+ *
+ * @Property Annotations.
+ */
@Property
public void setNosource(final String value) {
this.nosource = value;
}
-
+
public String getFileProperty() {
return this.fileProperty;
}
-
+
public String getC() {
return this.cProperty;
}
-
+
public String getC2() {
return this.cProperty2;
}
-
+
public String getD() {
return this.dProperty;
}
public String getNoSource() {
- return this.nosource;
+ return this.nosource;
}
public int getOverrideValue() {
return this.overrideNumber;
}
- public Collection<String> getManyValuesFileProperty() {
- return this.manyValuesFileProperty;
- }
-}
+ public Collection<String> getManyValuesFileProperty() {
+ return this.manyValuesFileProperty;
+ }
+}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java Fri Feb 29 11:27:18 2008
@@ -19,70 +19,108 @@
package org.apache.tuscany.sca.itest;
+/**
+ * This is a Java Bean which has setter and getter methods for for the variables used in the property tests.
+ */
public class ComplexPropertyBean {
+ /**
+ * Variable declarations
+ */
protected int integerNumber = 25;
protected float floatNumber = 50;
protected double doubleNumber = 75;
protected int[] intArray = null;
protected double[] doubleArray = null;
protected String[] stringArray = null;
-
+
ComplexPropertyBean numberSet;
protected ComplexPropertyBean[] numberSetArray = null;
-
+
public ComplexPropertyBean() {
-
+
}
public double getDoubleNumber() {
return doubleNumber;
}
+ /**
+ * It is a setter method to set a value for the variable doubleNumber
+ */
public void setDoubleNumber(double doubleNumber) {
this.doubleNumber = doubleNumber;
}
+ /**
+ * It is a getter method to get a value for the variable floatNumber
+ */
public float getFloatNumber() {
return floatNumber;
}
+ /**
+ * It is a setter method to set a value for the variable floatNumber
+ */
public void setFloatNumber(float floatNumber) {
this.floatNumber = floatNumber;
}
+ /**
+ * It is a getter method to get a value for the variable floatNumber
+ */
public int getIntegerNumber() {
return integerNumber;
}
+ /**
+ * It is a getter method to get a value for the variable integerNumber
+ */
public void setIntegerNumber(int integerNumber) {
this.integerNumber = integerNumber;
}
+ /**
+ * It is a getter method to set a value for the variable numberSet
+ */
public ComplexPropertyBean getNumberSet() {
return numberSet;
}
+ /**
+ * It is a setter method to set a value for the variable numberSet
+ */
public void setNumberSet(ComplexPropertyBean numberSet) {
this.numberSet = numberSet;
}
-
+
+ /**
+ * It is a method which implements toString() function
+ */
@Override
public String toString() {
- return Double.toString(integerNumber) + " - " +
- Double.toString(floatNumber) + " - " +
- Double.toString(doubleNumber) + " \n" +
- ((intArray == null ) ? "" : intArray[0] + " - " + intArray[1] + " \n " ) +
- ((doubleArray == null ) ? "" : doubleArray[0] + " - " + doubleArray[1] + " \n " ) +
- ((stringArray == null ) ? "" : stringArray[0] + " - " + stringArray[1] + " \n " ) +
- ((numberSetArray == null ) ? "" : numberSetArray[0] + " - " + numberSetArray[1] + " \n " ) +
- ((numberSet == null ) ? "" : numberSet.toString());
+ return Double.toString(integerNumber) + " - "
+ + Double.toString(floatNumber)
+ + " - "
+ + Double.toString(doubleNumber)
+ + " \n"
+ + ((intArray == null) ? "" : intArray[0] + " - " + intArray[1] + " \n ")
+ + ((doubleArray == null) ? "" : doubleArray[0] + " - " + doubleArray[1] + " \n ")
+ + ((stringArray == null) ? "" : stringArray[0] + " - " + stringArray[1] + " \n ")
+ + ((numberSetArray == null) ? "" : numberSetArray[0] + " - " + numberSetArray[1] + " \n ")
+ + ((numberSet == null) ? "" : numberSet.toString());
}
+ /**
+ * It is a setter method to set values for the variable stringArray
+ */
public String[] getStringArray() {
return stringArray;
}
+ /**
+ * It is a setter method to set values for the variable stringArray
+ */
public void setStringArray(String[] stringArray) {
this.stringArray = stringArray;
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideService.java Fri Feb 29 11:27:18 2008
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -20,6 +19,9 @@
package org.apache.tuscany.sca.itest;
+/**
+ * This is an Interface for the services
+ */
public interface OverrideService {
}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/OverrideServiceImpl.java Fri Feb 29 11:27:18 2008
@@ -19,6 +19,10 @@
package org.apache.tuscany.sca.itest;
+/**
+ * An implementation for the interface OverrideService.
+ */
+
public class OverrideServiceImpl implements OverrideService {
}
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=632415&r1=632414&r2=632415&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 Fri Feb 29 11:27:18 2008
@@ -1,62 +1,113 @@
-/*
- * 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.itest;
-
-import java.util.Collection;
-
-import commonj.sdo.DataObject;
-
-
-public interface PropertyComponent {
- public String getLocation();
- public String getLocationFromComponentContext();
- public String getYear();
-
- /**
- * This method is used to test injecting a primitive String Array
- * @return The injected array
- */
- public String[] getDaysOfTheWeek();
-
- /**
- * This method is used to test injecting an Object Integer Array
- * @return The injected array
- */
- public Integer[] getIntegerNumbers();
-
- /**
- * This method is used to test injecting an int Array
- * @return The injected array
- */
- public int[] getIntNumbers();
-
- /**
- * This method is used to test injecting an Object Array
- * @return The injected array
- */
- public DataObject[] getSdoArrayProperty();
-
- public ComplexPropertyBean getComplexPropertyOne();
- public ComplexPropertyBean getComplexPropertyTwo();
- public ComplexPropertyBean getComplexPropertyThree();
- public Collection<ComplexPropertyBean> getComplexPropertyFour();
- public DataObject getSdoProperty();
- public DataObject getCustomerSdo();
-}
+/*
+ * 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.itest;
+
+import java.util.Collection;
+
+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
+ */
+public interface PropertyComponent {
+
+ /**
+ * This is a method to get a value for a property name 'location' from the sca runtime environment. It is
+ * implemented in the class PropertyComponentImpl
+ */
+ public String getLocation();
+
+ /**
+ * This is a method to get a value for a property name 'year' from the sca runtime environment. It is implemented in
+ * the class PropertyComponentImpl
+ */
+ public String getYear();
+
+ /**
+ * This method is used to test injecting a primitive String Array
+ *
+ * @return The injected array
+ */
+ public String[] getDaysOfTheWeek();
+
+ /**
+ * This method is used to test injecting an Object Integer Array
+ *
+ * @return The injected array
+ */
+ public Integer[] getIntegerNumbers();
+
+ /**
+ * This method is used to test injecting an int Array
+ *
+ * @return The injected array
+ */
+ 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
+ */
+
+ public ComplexPropertyBean getComplexPropertyOne();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ComplexPropertyBean getComplexPropertyTwo();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ComplexPropertyBean getComplexPropertyThree();
+
+ /**
+ * This is a method to get a property value from the sca runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public Collection<ComplexPropertyBean> getComplexPropertyFour();
+
+ /**
+ * 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();
+
+ /**
+ * @return
+ */
+ public String getLocationFromComponentContext();
+}
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=632415&r1=632414&r2=632415&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 Fri Feb 29 11:27:18 2008
@@ -1,152 +1,165 @@
-/*
- * 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.itest;
-
-import java.util.Collection;
-
-import org.osoa.sca.ComponentContext;
-import org.osoa.sca.annotations.Context;
-import org.osoa.sca.annotations.Property;
-
-import com.example.customer.sdo.impl.CustomerImpl;
-import commonj.sdo.DataObject;
-
-public class PropertyComponentImpl implements PropertyComponent {
-
- @Context
- protected ComponentContext context;
-
- @Property
- protected CustomerImpl customerSdo;
-
- @Property
- protected DataObject sdoProperty;
-
- @Property
- protected ComplexPropertyBean complexPropertyOne;
-
- @Property
- protected ComplexPropertyBean complexPropertyTwo;
-
- @Property
- protected ComplexPropertyBean complexPropertyThree;
-
- @Property
- protected Collection<ComplexPropertyBean> complexPropertyFour;
-
- @Property(name = "location")
- protected String location;
-
- @Property(name = "year")
- protected String year;
-
- @Property(name = "daysOfTheWeek")
- protected String[] daysOfTheWeek;
-
- @Property(name = "integerNumbers")
- protected Integer[] integerNumbers;
-
- @Property(name = "intNumbers")
- protected int[] intNumbers;
-
- @Property(name = "sdoArray")
- protected DataObject[] sdoArray;
-
- public String getLocation(){
- return location;
- }
-
- public String getLocationFromComponentContext() {
- return context.getProperty(String.class, "location");
- }
-
- public String getYear(){
- return year;
- }
-
- public ComplexPropertyBean getComplexPropertyOne() {
- //System.out.println(complexPropertyOne);
- return complexPropertyOne;
- }
-
- public ComplexPropertyBean getComplexPropertyTwo() {
- //System.out.println(complexPropertyTwo);
- return complexPropertyTwo;
- }
-
- public ComplexPropertyBean getComplexPropertyThree() {
- //System.out.println(complexPropertyThree);
- return complexPropertyThree;
- }
-
- public Collection<ComplexPropertyBean> getComplexPropertyFour() {
- //System.out.println(complexPropertyThree);
- return complexPropertyFour;
- }
-
- public DataObject getSdoProperty() {
- return sdoProperty;
- }
-
- public void setSdoProperty(DataObject sdoProperty) {
- System.out.println("Reached here da machi");
- this.sdoProperty = sdoProperty;
- }
-
- public CustomerImpl getCustomerSdo() {
- return customerSdo;
- }
-
- public void setCustomerSdo(CustomerImpl customerSdo) {
- this.customerSdo = customerSdo;
- }
-
- /**
- * This method is used to test injecting an Array
- * @return The injected array
- */
- public String[] getDaysOfTheWeek() {
- return daysOfTheWeek;
- }
-
- /**
- * This method is used to test injecting an Object Integer Array
- * @return The injected array
- */
- public Integer[] getIntegerNumbers() {
- return integerNumbers;
- }
-
- /**
- * This method is used to test injecting an int Array
- * @return The injected array
- */
- public int[] getIntNumbers() {
- return intNumbers;
- }
-
- /**
- * This method is used to test injecting an Object Array
- * @return The injected array
- */
- public DataObject[] getSdoArrayProperty() {
- return sdoArray;
- }
-}
+/*
+ * 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.itest;
+
+import java.util.Collection;
+
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Property;
+
+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.
+ */
+public class PropertyComponentImpl implements PropertyComponent {
+ @Context
+ protected ComponentContext context;
+
+ @Property
+ protected CustomerImpl customerSdo;
+
+ @Property
+ protected DataObject sdoProperty;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyOne;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyTwo;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyThree;
+
+ @Property
+ protected Collection<ComplexPropertyBean> complexPropertyFour;
+
+ @Property(name = "location")
+ protected String location;
+
+ @Property(name = "year")
+ protected String year;
+
+ @Property(name = "daysOfTheWeek")
+ protected String[] daysOfTheWeek;
+
+ @Property(name = "integerNumbers")
+ protected Integer[] integerNumbers;
+
+ @Property(name = "intNumbers")
+ protected int[] intNumbers;
+
+ @Property(name = "sdoArray")
+ protected DataObject[] sdoArray;
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+ public ComplexPropertyBean getComplexPropertyOne() {
+ //System.out.println(complexPropertyOne);
+ return complexPropertyOne;
+ }
+
+ public ComplexPropertyBean getComplexPropertyTwo() {
+ //System.out.println(complexPropertyTwo);
+ return complexPropertyTwo;
+ }
+
+ public ComplexPropertyBean getComplexPropertyThree() {
+ //System.out.println(complexPropertyThree);
+ return complexPropertyThree;
+ }
+
+ public Collection<ComplexPropertyBean> getComplexPropertyFour() {
+ //System.out.println(complexPropertyThree);
+ return complexPropertyFour;
+ }
+
+ 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
+ *
+ * @return The injected array
+ */
+ public String[] getDaysOfTheWeek() {
+ return daysOfTheWeek;
+ }
+
+ /**
+ * This method is used to test injecting an Object Integer Array
+ *
+ * @return The injected array
+ */
+ public Integer[] getIntegerNumbers() {
+ return integerNumbers;
+ }
+
+ /**
+ * This method is used to test injecting an int Array
+ *
+ * @return The injected array
+ */
+ public int[] getIntNumbers() {
+ 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");
+ }
+}
Modified: incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyService.java Fri Feb 29 11:27:18 2008
@@ -19,6 +19,9 @@
package org.apache.tuscany.sca.itest;
+/**
+ * This is an Interface for the services.
+ */
public interface PropertyService {
}
Modified: incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java?rev=632415&r1=632414&r2=632415&view=diff
==============================================================================
--- incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/MyTotalServiceTestCase.java Fri Feb 29 11:27:18 2008
@@ -1,5 +1,5 @@
-
package org.apache.tuscany.sca.itest;
+
import static junit.framework.Assert.assertEquals;
import mysca.test.myservice.impl.MyService;
@@ -15,36 +15,65 @@
private static SCADomain domain;
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the local
+ * property variables defined in the implementation file with the expected values 'RTP' and '2006'
+ */
@Test
public void testPropertyDefault() {
assertEquals("RTP", service1.getLocation());
assertEquals("2006", service1.getYear());
}
-
+
+ /**
+ * 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 service2 from the SCA runtime environment with the expected values 'Raleigh'
+ * and '2008'. This overrides the local property values
+ */
@Test
public void testPropertyOverride() {
assertEquals("Raleigh", service2.getLocation());
assertEquals("2008", service2.getYear());
- }
+ }
+ /**
+ * 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 service3 from the SCA runtime environment with the expected values 'Durham'
+ * and '2009'
+ */
@Test
public void testPropertyNestedOverride() {
assertEquals("Durham", service3.getLocation());
assertEquals("2009", service3.getYear());
}
- @BeforeClass
/**
- * Sets up for the test case execution such as locating services.
+ * Method annotated with
+ *
+ * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
+ * Embedded SCA Domain, to start the SCA Domain and to get a reference to the 'outerABService' service
*/
+ @BeforeClass
public static void setUp() throws Exception {
-
+
domain = SCADomain.newInstance("Outer.composite");
service1 = domain.getService(MyService.class, "MyServiceComponent/MyService");
service2 = domain.getService(MyService.class, "MyServiceComponentNew/MyService");
service3 = domain.getService(MyService.class, "MySimpleServiceInRecursiveAnother");
}
-
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * domain, close any previously opened connections etc
+ */
@AfterClass
public static void tearDown() {
domain.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org