From 9425990f532b1152c2d73db96c0f07ef5216a3d1 Mon Sep 17 00:00:00 2001 From: lresende Date: Thu, 12 Nov 2009 00:43:48 +0000 Subject: Moving 2.x contribs git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835178 13f79535-47bb-0310-9956-ffa450edef68 --- sca-java-2.x/contrib/itest/admin/README | 28 +++++ sca-java-2.x/contrib/itest/admin/pom.xml | 60 +++++++++++ .../tuscany/sca/itest/admin/MyListService.java | 9 ++ .../sca/itest/admin/MyListServiceByYear.java | 8 ++ .../tuscany/sca/itest/admin/MyListServiceImpl.java | 69 +++++++++++++ .../apache/tuscany/sca/itest/admin/MyLogger.java | 17 ++++ .../apache/tuscany/sca/itest/admin/MyService.java | 9 ++ .../tuscany/sca/itest/admin/MyServiceByDate.java | 10 ++ .../tuscany/sca/itest/admin/MyServiceImpl.java | 113 +++++++++++++++++++++ .../tuscany/sca/itest/admin/MyTotalService.java | 6 ++ .../sca/itest/admin/MyTotalServiceImpl.java | 74 ++++++++++++++ .../sca/itest/admin/SCAComponentService.java | 9 ++ .../admin/MySimpleServiceInRecursiveTestCase.java | 61 +++++++++++ .../sca/itest/admin/MySimpleServiceTestCase.java | 57 +++++++++++ .../sca/itest/admin/MyTotalServiceTestCase.java | 48 +++++++++ .../test/resources/Iteration1Composite.composite | 43 ++++++++ .../test/resources/Iteration3Composite.composite | 68 +++++++++++++ .../src/test/resources/MySimpleService.composite | 59 +++++++++++ 18 files changed, 748 insertions(+) create mode 100644 sca-java-2.x/contrib/itest/admin/README create mode 100644 sca-java-2.x/contrib/itest/admin/pom.xml create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyLogger.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyService.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyServiceByDate.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyServiceImpl.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyTotalService.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceImpl.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/SCAComponentService.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java create mode 100644 sca-java-2.x/contrib/itest/admin/src/test/resources/Iteration1Composite.composite create mode 100644 sca-java-2.x/contrib/itest/admin/src/test/resources/Iteration3Composite.composite create mode 100644 sca-java-2.x/contrib/itest/admin/src/test/resources/MySimpleService.composite (limited to 'sca-java-2.x/contrib/itest/admin') diff --git a/sca-java-2.x/contrib/itest/admin/README b/sca-java-2.x/contrib/itest/admin/README new file mode 100644 index 0000000000..c4e96d7af0 --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/README @@ -0,0 +1,28 @@ +This is a simple test compiled to test simple features of SCA + +There are interfaces to different services that have been included + +1. MyListService +2. MyListServiceByYear +3. MyService +4. MyServiceByDate +5. MyTotalservice + +The service that has been used in the tests primarily is MyService/MyTotalService. +in the test cases. + +There are three test cases and three composites (MySimppleService,Iteration1,Iteration3). + +1. MySimpleServiceTestCase - Checks if the components in MySimpleService.composite are initialized properly. + It tries to call simple functions implemented in MySimpleServiceImpl. + +2. MyTotalServiceTestCase - Initializes the components in the Iteration3Composite.composite file. + tries to call simple functions implemented in MyTotalServiceImpl. + +3. MySimpleServiceInRecursiveTestCase - Initializes the components in the Iteration1Composite.composite file. + It initializes its components using implementation:composite tag in the + composite file which points to MySimpleService.composite. + The test case recursively calls functions initialized in MySimpleService.composite. + + + diff --git a/sca-java-2.x/contrib/itest/admin/pom.xml b/sca-java-2.x/contrib/itest/admin/pom.xml new file mode 100644 index 0000000000..e179926bf1 --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-SNAPSHOT + ../pom.xml + + tuscany-itest-admin + Apache Tuscany Admin Tests + + + + org.apache.tuscany.sca + tuscany-host-embedded + 2.0-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-core-databinding + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-databinding-sdo + 2.0-SNAPSHOT + compile + + + + diff --git a/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java b/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java new file mode 100644 index 0000000000..f081537dab --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListService.java @@ -0,0 +1,9 @@ +package org.apache.tuscany.sca.itest.admin; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface MyListService { + String[] getHolidays(); + String getYear(); +} diff --git a/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java b/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java new file mode 100644 index 0000000000..b4224e286e --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceByYear.java @@ -0,0 +1,8 @@ +package org.apache.tuscany.sca.itest.admin; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface MyListServiceByYear { + String[] getHolidays(int year); +} diff --git a/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java b/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java new file mode 100644 index 0000000000..550303d856 --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/src/main/java/org/apache/tuscany/sca/itest/admin/MyListServiceImpl.java @@ -0,0 +1,69 @@ +package org.apache.tuscany.sca.itest.admin; + + +import java.util.List; + +import org.oasisopen.sca.annotation.Property; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; + +import org.apache.tuscany.sca.itest.admin.MyListService; +import org.apache.tuscany.sca.itest.admin.MyListServiceByYear; + +@Service(interfaces={MyListService.class,MyListServiceByYear.class}) + +public class MyListServiceImpl implements MyListService,MyListServiceByYear +{ + + // This is multiplicity=1:n + @Reference(name="myListServiceList",required=true) + public List myListServicesList; + + // This is multiplicity=0:n + @Reference(name="myListServiceArray",required=false) + public MyListService[] myListServicesArray; + + @Property(name="serviceYear") + protected String year = "2006"; + + public String[] getHolidays() + { + return getHolidays(new Integer(year).intValue()); + } + + public String[] getHolidays(int year) + { + MyListService myService; + if (myListServicesList!=null) + { + for (int i=0; i=0 && index + + + + Raleigh + 2008 + + Durham + 2009 + + + + + + + + Durham + 2009 + + + diff --git a/sca-java-2.x/contrib/itest/admin/src/test/resources/Iteration3Composite.composite b/sca-java-2.x/contrib/itest/admin/src/test/resources/Iteration3Composite.composite new file mode 100644 index 0000000000..dd06d030d6 --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/src/test/resources/Iteration3Composite.composite @@ -0,0 +1,68 @@ + + + + + Raleigh + 2008 + + + + + + + + CARY + 2007 + + + + + + + + + + + + + + + + + + + + + Durham + 2009 + + + + + + + + Durham + 2009 + + diff --git a/sca-java-2.x/contrib/itest/admin/src/test/resources/MySimpleService.composite b/sca-java-2.x/contrib/itest/admin/src/test/resources/MySimpleService.composite new file mode 100644 index 0000000000..a1f8abb8da --- /dev/null +++ b/sca-java-2.x/contrib/itest/admin/src/test/resources/MySimpleService.composite @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + Raleigh + 2008 + + + + + + + + CARY + 2007 + + + + + + + + + -- cgit v1.2.3