summaryrefslogtreecommitdiffstats
path: root/sandbox/old/contrib/itest/specTest/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/old/contrib/itest/specTest/src/test')
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java48
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java39
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java60
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java71
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java89
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java45
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java70
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java81
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java55
-rw-r--r--sandbox/old/contrib/itest/specTest/src/test/resources/itest.scdl30
10 files changed, 588 insertions, 0 deletions
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java
new file mode 100644
index 0000000000..c7bce6e65f
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentContextTestComponent.java
@@ -0,0 +1,48 @@
+/*
+ * 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.test.spec;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ComponentContextTestComponent extends TestCase {
+ @Reference
+ public ComponentContextTester tester;
+
+ public void testContextWasInjected() {
+ assertTrue(tester.isContextInjected());
+ }
+
+ public void testComponentURI() {
+ assertEquals("itest://localhost/testDomain/testHarness/ComponentContextTester", tester.getURI());
+ }
+
+ public void testGetService() {
+ assertEquals("itest://localhost/testDomain/testHarness/ReferencedService",
+ tester.getServiceIdentity("getServiceTest"));
+ }
+
+ public void testGetServiceReference() {
+ assertEquals("itest://localhost/testDomain/testHarness/ReferencedService",
+ tester.getServiceReferenceIdentity("getServiceTest"));
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java
new file mode 100644
index 0000000000..c06ce947ea
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.test.spec;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+public class ComponentServiceReferenceListTest extends TestCase {
+ @Reference
+ public MyListService myListService;
+ @Reference
+ public MyListServiceByYear myListServiceByYear;
+
+ public void testDefaultProperty() {
+ assertEquals("2007", myListService.getYear());
+
+ }
+
+ public void testDefaultService() {
+ assertEquals(myListService.getHolidays()[0], myListServiceByYear.getHolidays(2007)[0]);
+
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java
new file mode 100644
index 0000000000..30a4959d8f
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java
@@ -0,0 +1,60 @@
+/*
+ * 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.test.spec;
+
+import java.util.Date;
+
+import junit.framework.TestCase;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Reference;
+
+public class ComponentServiceReferenceTest extends TestCase {
+ @Reference
+ public MyTotalService myService;
+
+ @Context
+ public ComponentContext context;
+
+ public void testDefaultProperty() {
+ assertEquals("NC", myService.getLocation());
+ assertEquals("2007", myService.getYear());
+
+ }
+
+ public void testDefaultService() {
+ assertNotSame(myService.nextHoliday(), myService.nextHoliday(new Date()));
+ assertEquals(myService.getHolidays()[0], myService.getHolidays(2007)[0]);
+
+ }
+
+ public void testMyServiceContext() {
+ assertNotNull("Service component name is null", myService.getComponentName());
+ assertNotNull("service context is null", myService.getContext());
+
+ System.out.println("Service component name :" + myService.getComponentName());
+ System.out.println("service context :" + myService.getContext());
+
+ }
+
+ public void testContext() {
+ assertNotNull("service context is null", context);
+
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java
new file mode 100644
index 0000000000..d039a066a7
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java
@@ -0,0 +1,71 @@
+/*
+ * 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.test.spec;
+
+import java.util.Date;
+
+import org.osoa.sca.annotations.Reference;
+
+import junit.framework.TestCase;
+
+public class ComponentTest extends TestCase {
+ @Reference
+ public MyService myService;
+ @Reference
+ public MyServiceByDate myServiceByDate;
+ @Reference
+ public MyListService myListService;
+ @Reference
+ public MyListServiceByYear myListServiceByYear;
+ @Reference
+ public MyService myNCService;
+ @Reference
+ public MyListService myListServiceFor2006;
+
+ public void testDefaultProperty() {
+ assertEquals("RTP", myService.getLocation());
+ assertEquals("2006", myService.getYear());
+
+ }
+
+ public void testDefaultService() {
+ assertEquals(myService.nextHoliday(), myServiceByDate.nextHoliday(new Date()));
+ assertEquals(myListService.getHolidays()[0], myListServiceByYear.getHolidays(2006)[0]);
+
+ }
+
+ public void testOverrideProperty() {
+ assertEquals("NC", myNCService.getLocation());
+ assertEquals("2007", myNCService.getYear());
+ }
+
+ public void testServiceWithOverrideProperty() {
+ assertFalse(myNCService.nextHoliday() == myService.nextHoliday());
+ assertEquals(myListServiceFor2006.getHolidays()[0], myListServiceByYear.getHolidays(2006)[0]);
+
+ }
+
+ public void testContext() {
+ assertNotNull("Service component name is null", myService.getComponentName());
+ assertNotNull("service context is null", myService.getContext());
+
+ System.out.println("Service component name :" + myService.getComponentName());
+ System.out.println("service context :" + myService.getContext());
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java
new file mode 100644
index 0000000000..2a50cdc8df
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java
@@ -0,0 +1,89 @@
+/*
+ * 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.test.spec;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+public class CompositeOneService2LevelTest extends TestCase {
+ @Reference
+ public MyService myService;
+ @Reference
+ public MyService myServiceDefault;
+ @Reference
+ public MyService myServiceNo;
+ @Reference
+ public MyService myServiceMay;
+ @Reference
+ public MyService myServiceMust;
+
+ public void testPropertyFromComponent() {
+ assertEquals("CARY", myService.getLocation());
+ assertEquals("2007", myService.getYear());
+
+ }
+
+ public void testPropertyFromServiceDefault() {
+ assertEquals("CARY", myServiceDefault.getLocation());
+ assertEquals("2007", myServiceDefault.getYear());
+
+ }
+
+ public void testServiceDefault() {
+ assertEquals(myService.nextHoliday(), myServiceDefault.nextHoliday());
+ }
+
+ public void testPropertyFromServiceNo() {
+ assertEquals("CARY", myServiceNo.getLocation());
+ assertEquals("2007", myServiceNo.getYear());
+
+ }
+
+ public void testServiceNo() {
+ assertEquals(myService.nextHoliday(), myServiceNo.nextHoliday());
+ }
+
+ public void testPropertyFromServiceMay() {
+ assertEquals("CARY", myServiceMay.getLocation());
+ assertEquals("2007", myServiceMay.getYear());
+
+ }
+
+ public void testServiceMay() {
+ assertEquals(myService.nextHoliday(), myServiceMay.nextHoliday());
+ }
+
+ public void testPropertyFromServiceMust() {
+ assertEquals("CARY", myServiceMust.getLocation());
+ assertEquals("2007", myServiceMust.getYear());
+
+ }
+
+ public void testServiceMust() {
+ assertEquals(myService.nextHoliday(), myServiceMust.nextHoliday());
+ }
+
+ public void testContext() {
+ assertNotNull("Service component name is null", myService.getComponentName());
+ assertNotNull("service context is null", myService.getContext());
+
+ System.out.println("Service component name :" + myService.getComponentName());
+ System.out.println("service context :" + myService.getContext());
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java
new file mode 100644
index 0000000000..27deb92012
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.test.spec;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+public class CompositeOneServiceTest extends TestCase {
+ @Reference
+ public MyService myService;
+
+ public void testOverrideProperty() {
+ assertEquals("CARY", myService.getLocation());
+ assertEquals("2007", myService.getYear());
+
+ }
+
+ public void testDefaultService() {
+ assertNotNull(myService.nextHoliday());
+ }
+
+ public void testContext() {
+ assertNotNull("Service component name is null", myService.getComponentName());
+ assertNotNull("service context is null", myService.getContext());
+
+ System.out.println("Service component name :" + myService.getComponentName());
+ System.out.println("service context :" + myService.getContext());
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java
new file mode 100644
index 0000000000..b312fd1e36
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.test.spec;
+
+import java.util.Date;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+public class CompositeServiceReferenceForRefOverrideTest extends TestCase {
+ @Reference
+ public MyTotalService myService1;
+ @Reference
+ public MyTotalService myService2;
+ @Reference
+ public MyTotalService myService3;
+
+ public void testPropertyWithServiceFromReferenceNo() {
+ assertEquals("CARY", myService1.getLocation());
+ assertEquals("2007", myService1.getYear());
+ }
+
+ public void testPropertyWithServiceFromReferenceMay() {
+ assertEquals("CARY", myService2.getLocation());
+ assertEquals("2007", myService2.getYear());
+
+ }
+
+ public void testPropertyWithServiceFromReferenceMust() {
+ assertEquals("CARY", myService3.getLocation());
+ assertEquals("2007", myService3.getYear());
+ }
+
+ public void testServiceFromReferenceNo() {
+ System.out.println("nextHolday()" + myService1.nextHoliday());
+ System.out.println("nextHolday(Date)" + myService1.nextHoliday(new Date()));
+ System.out.println("myService1.getHolidays()[0]" + myService1.getHolidays()[0]);
+ System.out.println("myService1.getHolidays(2007)[0]" + myService1.getHolidays(2007)[0]);
+ assertNotSame(myService1.nextHoliday(), myService1.nextHoliday(new Date()));
+ assertEquals(myService1.getHolidays()[0], myService1.getHolidays(2007)[0]);
+ }
+
+ public void testServiceFromReferenceMay() {
+ assertEquals(myService2.getHolidays()[0], myService2.getHolidays(2007)[0]);
+ assertNotSame(myService2.nextHoliday(), myService2.nextHoliday(new Date()));
+
+ }
+
+ public void testServiceFromReferenceMust() {
+ assertEquals(myService3.getHolidays()[0], myService3.getHolidays(2007)[0]);
+ assertNotSame(myService3.nextHoliday(), myService3.nextHoliday(new Date()));
+
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java
new file mode 100644
index 0000000000..edf8d05512
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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.test.spec;
+
+import java.util.Date;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+public class CompositeServiceReferenceTest extends TestCase {
+ @Reference
+ public MyTotalService myService1;
+ @Reference
+ public MyTotalService myService2;
+ @Reference
+ public MyTotalService myService3;
+ @Reference
+ public MyTotalService myService4;
+ @Reference
+ public MyTotalService myService5;
+
+ public void testPropertyWithServiceFromRecursive() {
+ assertEquals("CARY", myService1.getLocation());
+ assertEquals("2007", myService1.getYear());
+ }
+
+ public void testPropertyWithServiceInCompositeFromRecursive() {
+ assertEquals("CARY", myService2.getLocation());
+ assertEquals("2007", myService2.getYear());
+
+ }
+
+ public void testPropertyWithServiceInCompositeFromComponent() {
+ assertEquals("CARY", myService3.getLocation());
+ assertEquals("2007", myService3.getYear());
+ }
+
+ public void testServiceFromRecursive() {
+ assertNotSame(myService1.nextHoliday(), myService1.nextHoliday(new Date()));
+ assertEquals(myService1.getHolidays()[0], myService1.getHolidays(2007)[0]);
+
+ }
+
+ public void testServiceReferenceFromRecursive() {
+ assertEquals(myService2.getHolidays()[0], myService2.getHolidays(2007)[0]);
+ assertNotSame(myService2.nextHoliday(), myService2.nextHoliday(new Date()));
+
+ }
+
+ public void testServiceReferenceFromRecursiveUseService() {
+ assertNotSame(myService4.nextHoliday(), myService4.nextHoliday(new Date()));
+ assertEquals(myService4.getHolidays()[0], myService4.getHolidays(2007)[0]);
+ }
+
+ public void testServiceReferenceFromComponent() {
+ assertEquals(myService3.getHolidays()[0], myService3.getHolidays(2007)[0]);
+ assertNotSame(myService3.nextHoliday(), myService3.nextHoliday(new Date()));
+
+ }
+
+ public void testServiceReferenceFromComponentUseService() {
+ assertNotSame(myService5.nextHoliday(), myService5.nextHoliday(new Date()));
+ assertEquals(myService5.getHolidays()[0], myService5.getHolidays(2007)[0]);
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java
new file mode 100644
index 0000000000..98c368fdba
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.test.spec;
+
+import java.util.Date;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
+
+public class CompositeTest extends TestCase {
+ @Reference
+ public MyService myService;
+ @Reference
+ public MyServiceByDate myServiceByDate;
+ @Reference
+ public MyListService myListService;
+ @Reference
+ public MyListServiceByYear myListServiceByYear;
+
+ public void testOverrideProperty() {
+ assertEquals("CARY", myService.getLocation());
+ assertEquals("2007", myService.getYear());
+
+ }
+
+ public void testDefaultService() {
+ assertEquals(myService.nextHoliday(), myServiceByDate.nextHoliday(new Date()));
+ assertEquals(myListService.getHolidays()[0], myListServiceByYear.getHolidays(2007)[0]);
+
+ }
+
+ public void testContext() {
+ assertNotNull("Service component name is null", myService.getComponentName());
+ assertNotNull("service context is null", myService.getContext());
+
+ System.out.println("Service component name :" + myService.getComponentName());
+ System.out.println("service context :" + myService.getContext());
+ }
+}
diff --git a/sandbox/old/contrib/itest/specTest/src/test/resources/itest.scdl b/sandbox/old/contrib/itest/specTest/src/test/resources/itest.scdl
new file mode 100644
index 0000000000..62c5cece94
--- /dev/null
+++ b/sandbox/old/contrib/itest/specTest/src/test/resources/itest.scdl
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/2.0-alpha"
+ name="SpecTestHarnessComposite">
+
+ <include name="SpecTestComposite" scdlResource="META-INF/sca/default.scdl"/>
+
+ <component name="testComponentContext">
+ <tuscany:junit class="org.apache.tuscany.sca.test.spec.ComponentContextTestComponent"/>
+ <reference name="tester" target="ComponentContextTester"/>
+ </component>
+</composite>