From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../admin/MySimpleServiceInRecursiveTestCase.java | 79 ++++++++++++++++++++++ .../sca/itest/admin/MySimpleServiceTestCase.java | 75 ++++++++++++++++++++ .../sca/itest/admin/MyTotalServiceTestCase.java | 66 ++++++++++++++++++ .../test/resources/Iteration1Composite.composite | 43 ++++++++++++ .../test/resources/Iteration3Composite.composite | 68 +++++++++++++++++++ .../src/test/resources/MySimpleService.composite | 59 ++++++++++++++++ 6 files changed, 390 insertions(+) create mode 100644 branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java create mode 100644 branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java create mode 100644 branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java create mode 100644 branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration1Composite.composite create mode 100644 branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite create mode 100644 branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite (limited to 'branches/sca-java-1.2.1/itest/admin/src/test') diff --git a/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java b/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java new file mode 100644 index 0000000000..65924cdd4f --- /dev/null +++ b/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceInRecursiveTestCase.java @@ -0,0 +1,79 @@ +/* + * 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.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/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java b/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java new file mode 100644 index 0000000000..35065478f7 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MySimpleServiceTestCase.java @@ -0,0 +1,75 @@ +/* + * 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.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/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java b/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java new file mode 100644 index 0000000000..22e60ddcd5 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/admin/src/test/java/org/apache/tuscany/sca/itest/admin/MyTotalServiceTestCase.java @@ -0,0 +1,66 @@ +/* + * 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.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(); + } +} diff --git a/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration1Composite.composite b/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration1Composite.composite new file mode 100644 index 0000000000..95dbbf0124 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration1Composite.composite @@ -0,0 +1,43 @@ + + + + + Raleigh + 2008 + + Durham + 2009 + + + + + + + + Durham + 2009 + + + diff --git a/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite b/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite new file mode 100644 index 0000000000..dd06d030d6 --- /dev/null +++ b/branches/sca-java-1.2.1/itest/admin/src/test/resources/Iteration3Composite.composite @@ -0,0 +1,68 @@ + + + + + Raleigh + 2008 + + + + + + + + CARY + 2007 + + + + + + + + + + + + + + + + + + + + + Durham + 2009 + + + + + + + + Durham + 2009 + + diff --git a/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite b/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite new file mode 100644 index 0000000000..a1f8abb8da --- /dev/null +++ b/branches/sca-java-1.2.1/itest/admin/src/test/resources/MySimpleService.composite @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + Raleigh + 2008 + + + + + + + + CARY + 2007 + + + + + + + + + -- cgit v1.2.3