summaryrefslogtreecommitdiffstats
path: root/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache')
-rw-r--r--sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java61
-rw-r--r--sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java57
-rw-r--r--sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java48
3 files changed, 166 insertions, 0 deletions
diff --git a/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java b/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java
new file mode 100644
index 0000000000..bcf4153064
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java
@@ -0,0 +1,61 @@
+package org.apache.tuscany.sca.itest.admin;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.apache.tuscany.sca.itest.admin.MyService;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+
+public class MySimpleServiceInRecursiveTestCase
+{
+ private static MyService myServiceOrg;
+ private static MyService myServiceAnother;
+ private static MyService myServiceCary;
+
+ private static SCADomain domain;
+
+
+ @Test
+ public void testPropertyDefault()
+ {
+ assertEquals("RTP",myServiceOrg.getLocation());
+ assertEquals("2006",myServiceOrg.getYear());
+ }
+
+
+ @Test
+ public void testPropertyOverrideValue()
+ {
+ assertEquals("CARY",myServiceCary.getLocation());
+ assertEquals("2007",myServiceCary.getYear());
+ }
+
+
+ @Test
+ public void testPropertyOverrideVariable()
+ {
+ assertEquals("Durham",myServiceAnother.getLocation());
+ assertEquals("2009",myServiceAnother.getYear());
+ }
+
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ domain = SCADomain.newInstance("Iteration1Composite.composite");
+ } catch ( Exception e ) { e.printStackTrace(); }
+
+ myServiceOrg = domain.getService(MyService.class, "MySimpleServiceInRecursive/MyServiceOrig1");
+ myServiceCary = domain.getService(MyService.class, "MySimpleServiceInRecursive/MyServiceCary1");
+ myServiceAnother = domain.getService(MyService.class, "MySimpleServiceInRecursiveAnother/MyServiceNew1");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ domain.close();
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java b/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java
new file mode 100644
index 0000000000..747f71576c
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java
@@ -0,0 +1,57 @@
+package org.apache.tuscany.sca.itest.admin;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.apache.tuscany.sca.itest.admin.MyService;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class MySimpleServiceTestCase
+{
+ private static SCADomain domain;
+ private static MyService myServiceOrg;
+ private static MyService myServiceNew;
+ private static MyService myServiceCary;
+
+ @Test
+ public void testPropertyDefault()
+ {
+ assertEquals("RTP",myServiceOrg.getLocation());
+ assertEquals("2006",myServiceOrg.getYear());
+ }
+
+
+ @Test
+ public void testPropertyOverrideWithValue()
+ {
+ assertEquals("CARY",myServiceCary.getLocation());
+ assertEquals("2007",myServiceCary.getYear());
+ }
+
+
+ @Test
+ public void testPropertyOverrideWithVariable()
+ {
+ assertEquals("Raleigh",myServiceNew.getLocation());
+ assertEquals("2008",myServiceNew.getYear());
+ }
+
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ domain = SCADomain.newInstance("MySimpleService.composite");
+ } catch ( Exception e ) { System.out.println("Could not initialize " + e.toString());
+ e.printStackTrace(); }
+ myServiceOrg = domain.getService(MyService.class, "MyServiceComponentOrig/MyService");
+ myServiceCary = domain.getService(MyService.class, "MyServiceComponentCary2007/MyService");
+ myServiceNew = domain.getService(MyService.class, "MyServiceComponentNew/MyService");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ domain.close();
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java b/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java
new file mode 100644
index 0000000000..6c2dffb7b4
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java
@@ -0,0 +1,48 @@
+package org.apache.tuscany.sca.itest.admin;
+
+import static junit.framework.Assert.assertEquals;
+
+import org.apache.tuscany.sca.itest.admin.MyTotalService;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class MyTotalServiceTestCase
+{
+ private static MyTotalService myTotalServiceOrg;
+ private static MyTotalService myTotalServiceNew;
+
+ private static SCADomain domain;
+
+ @Test
+ public void testPropertyDefault()
+ {
+ assertEquals("RTP",myTotalServiceOrg.getLocation());
+ assertEquals("2006",myTotalServiceOrg.getYear());
+ }
+
+
+ @Test
+ public void testPropertyOverrideVariable()
+ {
+ assertEquals("Raleigh",myTotalServiceNew.getLocation());
+ assertEquals("2008",myTotalServiceNew.getYear());
+ }
+
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ domain = SCADomain.newInstance("Iteration3Composite.composite");
+ } catch ( Exception e ) { e.printStackTrace(); }
+
+ myTotalServiceOrg =domain.getService(MyTotalService.class, "MyTotalServiceComponent");
+ myTotalServiceNew=domain.getService(MyTotalService.class, "MyTotalServiceNewComponent");
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ domain.close();
+ }
+}