From 539451c7e13d98504e6f3368d892406494ca711d Mon Sep 17 00:00:00 2001 From: lresende Date: Fri, 13 Nov 2009 01:23:07 +0000 Subject: Removing obsolete release candidate tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835693 13f79535-47bb-0310-9956-ffa450edef68 --- .../circular/include/CircularIncludeTestCase.java | 39 ------- .../src/test/java/composite/CompositeTestCase.java | 50 --------- .../LocateServiceEmbeddedSCADomainTestCase.java | 113 --------------------- .../composite/LocateServiceSCADomainTestCase.java | 73 ------------- .../recursive/src/test/java/foo/O2TestCase.java | 32 ------ .../recursive/src/test/java/foo/O4TestCase.java | 39 ------- .../src/test/java/policy/PolicyTestCase.java | 68 ------------- .../itest/recursive/src/test/java/sample/C.java | 32 ------ .../recursive/src/test/java/sample/CImpl.java | 80 --------------- .../src/test/java/sample/NestedTestCase.java | 96 ----------------- .../sample/RecursiveCompositeTestCaseFIXME.java | 53 ---------- .../itest/recursive/src/test/java/sample/X.java | 32 ------ .../recursive/src/test/java/sample/XImpl.java | 37 ------- .../itest/recursive/src/test/java/sample/Y.java | 32 ------ .../recursive/src/test/java/sample/YImpl.java | 38 ------- .../src/test/java/test/InnerTestCase.java | 51 ---------- .../src/test/java/test/OuterTestCase.java | 53 ---------- .../test1/composite/CompositeClientTestCase.java | 62 ----------- 18 files changed, 980 deletions(-) delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/circular/include/CircularIncludeTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/CompositeTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceEmbeddedSCADomainTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceSCADomainTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O2TestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O4TestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/policy/PolicyTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/C.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/CImpl.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/NestedTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/RecursiveCompositeTestCaseFIXME.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/X.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/XImpl.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/Y.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/YImpl.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/InnerTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/OuterTestCase.java delete mode 100644 sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test1/composite/CompositeClientTestCase.java (limited to 'sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test') diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/circular/include/CircularIncludeTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/circular/include/CircularIncludeTestCase.java deleted file mode 100644 index 1f7c35dd91..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/circular/include/CircularIncludeTestCase.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 circular.include; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.Test; - -public class CircularIncludeTestCase { - - @Test - public void testCyclicInclude() { - SCADomain scaDomain = SCADomain.newInstance("Demo1Composite.composite"); - - DemoClass demoService = scaDomain.getService(DemoClass.class, "Demo1Component"); - String demo = demoService.demo(); - Assert.assertEquals("hello", demo); - scaDomain.close(); - } - -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/CompositeTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/CompositeTestCase.java deleted file mode 100644 index 928cb3fea9..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/CompositeTestCase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 composite; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class CompositeTestCase extends TestCase { - - private SCADomain domain; - private Source source; - - @Override - protected void setUp() throws Exception { - domain = SCADomain.newInstance("OuterComposite.composite"); - source = domain.getService(Source.class, "SourceComponent"); - } - - @Override - protected void tearDown() throws Exception { - domain.close(); - } - - public void test() throws Exception { - System.out.println("Main thread " + Thread.currentThread()); - source.clientMethod("Client.main"); - System.out.println("Sleeping ..."); - Thread.sleep(1000); - if (SourceImpl.callbackCount != 2) { - throw new IllegalStateException("Expected callbacks not received"); - } - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceEmbeddedSCADomainTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceEmbeddedSCADomainTestCase.java deleted file mode 100644 index f042113f7a..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceEmbeddedSCADomainTestCase.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 composite; - -import java.io.File; -import java.net.URL; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.service.ContributionService; -import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain; - -public class LocateServiceEmbeddedSCADomainTestCase extends TestCase { - private ClassLoader cl; - private EmbeddedSCADomain domain; - private Contribution contribution; - - @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(); - - // Contribute the SCA contribution - ContributionService contributionService = domain.getContributionService(); - - File contribLocation = new File("./target/classes/"); - URL contributionURL = contribLocation.toURL(); - contribution = contributionService.contribute("http://contribution", contributionURL, false); - for (Composite deployable : contribution.getDeployables()) { - domain.getDomainComposite().getIncludes().add(deployable); - domain.buildComposite(deployable); - } - - // Start Components from my composite - for (Composite deployable : contribution.getDeployables() ) { - domain.getCompositeActivator().activate(deployable); - domain.getCompositeActivator().start(deployable); - } - } - - public void testValidLocateService() throws Exception { - Source source; - try { - source = domain.getService(Source.class, "SourceComponent"); - assertNotNull(source); - } catch (Throwable t) { - fail("Could not locate service"); - } - } - - public void testInvalidLocateService() throws Exception { - Source source; - try { - source = domain.getService(Source.class, "SourceComponentXXX"); - // The source proxy can be created for the remote target but it will throw exception when a method is invoked - source.clientMethod("ABC"); - fail("Expected to generate org.osoa.sca.ServiceRuntimeException but did not when invoking service with async"); - } catch (org.osoa.sca.ServiceRuntimeException e) { - // expected. - } - } - - public void testValidRecursiveLocateService() throws Exception { - Source source; - try { - source = domain.getService(Source.class, "SourceComponent/InnerSourceService"); - assertNotNull(source); - } catch (Throwable t) { - fail("Could not locate service"); - } - } - - @Override - public void tearDown() throws Exception { - ContributionService contributionService = domain.getContributionService(); - - // Remove the contribution from the in-memory repository - contributionService.remove("http://contribution"); - - // Stop Components from my composite - for (Composite deployable : contribution.getDeployables() ) { - domain.getCompositeActivator().stop(deployable); - domain.getCompositeActivator().deactivate(deployable); - } - - domain.stop(); - domain.close(); - } - -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceSCADomainTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceSCADomainTestCase.java deleted file mode 100644 index 87eb948452..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/composite/LocateServiceSCADomainTestCase.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 composite; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class LocateServiceSCADomainTestCase extends TestCase { - - private SCADomain domain; - - - @Override - protected void setUp() throws Exception { - domain = SCADomain.newInstance("OuterComposite.composite"); - } - - @Override - protected void tearDown() throws Exception { - domain.close(); - } - - public void testValidLocateService() throws Exception { - Source source; - try { - source = domain.getService(Source.class, "SourceComponent"); - assertNotNull(source); - } catch (Throwable t) { - fail("Could not locate service"); - } - } - - public void testInvalidLocateService() throws Exception { - Source source; - try { - source = domain.getService(Source.class, "SourceComponentXXX"); - // The source proxy can be created for the remote target but it will throw exception when a method is invoked - source.clientMethod("ABC"); - fail("Expected to generate org.osoa.sca.ServiceRuntimeException but did not when invoking service with async"); - } catch (org.osoa.sca.ServiceRuntimeException e) { - // expected. - } - } - - public void testValidRecursiveLocateService() throws Exception { - Source source; - try { - source = domain.getService(Source.class, "SourceComponent/InnerSourceService"); - assertNotNull(source); - } catch (Throwable t) { - fail("Could not locate service"); - } - } - -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O2TestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O2TestCase.java deleted file mode 100644 index d617ec8592..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O2TestCase.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 foo; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class O2TestCase extends TestCase { - - public void testGet() throws Exception { - SCADomain sca = SCADomain.newInstance("foo/o2.composite"); - I i = sca.getService(I.class, "O1Component"); - assertEquals("foo.A", i.get(0)); - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O4TestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O4TestCase.java deleted file mode 100644 index 15626c75ac..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/foo/O4TestCase.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 foo; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class O4TestCase extends TestCase { - - public void testO3Component() throws Exception { - SCADomain sca = SCADomain.newInstance("foo/o4.composite"); - I i = sca.getService(I.class, "O3Component"); - assertEquals("foo.A", i.get(0)); - } - - public void testO2Component() throws Exception { - SCADomain sca = SCADomain.newInstance("foo/o4.composite"); - I i = sca.getService(I.class, "O2Component"); - assertEquals("foo.A", i.get(0)); - } - -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/policy/PolicyTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/policy/PolicyTestCase.java deleted file mode 100644 index c9cc84f7d4..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/policy/PolicyTestCase.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 policy; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.impl.CompositeImpl; -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.apache.tuscany.sca.host.embedded.impl.DefaultSCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class PolicyTestCase { - - private SCADomain domain; - private Target targetClient; - - @Before - public void setUp() throws Exception { - domain = SCADomain.newInstance("policy/PolicyOuterComposite.composite"); - targetClient = domain.getService(Target.class, "TargetClientComponent"); - } - - @After - public void tearDown() throws Exception { - domain.close(); - } - - @Test - public void test() throws Exception { - try { - //Check that the implementation policy sets don't flow down to the components - //implementations that are themselves composites (implementation.composite) - Component outerComponent = ((DefaultSCADomain)domain).getComponent("OuterTargetServiceComponent"); - - Assert.assertEquals(0, outerComponent.getPolicySets().size()); - - for (Component component :((CompositeImpl)outerComponent.getImplementation()).getComponents()){ - Assert.assertEquals(0, component.getPolicySets().size()); - } - - // debugging - String result = targetClient.hello("Fred"); - - System.out.println(result); - } catch (Throwable t) { - t.printStackTrace(); - } - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/C.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/C.java deleted file mode 100644 index bf8391348b..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/C.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 sample; - -/** - * Simple Service - */ -public interface C { - - /** - * Sample operation - * - * @return A String - */ - String cOp(); -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/CImpl.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/CImpl.java deleted file mode 100644 index 466284983e..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/CImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 sample; - -import junit.framework.Assert; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * Implementation of a simple service - */ -@Service(C.class) -public class CImpl implements C { - - /** - * Reference to X - */ - private X xRef; - - /** - * Reference to Y - */ - private Y yRef; - - /** - * Setter for refX - * - * @param x Reference to X - */ - @Reference(name="refX") - protected void setX(X x) - { - System.out.println("Setting X on CImpl to " + x); - xRef = x; - } - - /** - * Setter for refY - * - * @param y Reference to Y - */ - @Reference(name="refY") - protected void setY(Y y) - { - System.out.println("Setting Y on CImpl to " + y); - yRef = y; - } - - /** - * Simple operation that uses the injected references to X and Y - * - * @return "C:cOp() - xResult = " + xRef.xOP() + " yResult = " + yRef.yOp(); - */ - public String cOp() { - Assert.assertNotNull(xRef); - Assert.assertNotNull(yRef); - - String xResult = xRef.xOp(); - String yResult = yRef.yOp(); - - return "C:cOp() - xResult = " + xResult + " yResult = " + yResult; - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/NestedTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/NestedTestCase.java deleted file mode 100644 index fc5d251460..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/NestedTestCase.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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 sample; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - - -/** - * Test for implementation.composite using implementation.composite - */ -public class NestedTestCase extends TestCase { - - /** - * Reference to the domain - */ - private SCADomain domain; - - /** - * Tear down the domain - */ - @Override - protected void tearDown() throws Exception { - if (domain != null) { - domain.close(); - } - } - - /** - * This tests having: - * - * AComponent -> implementation.composite(BComposite) - * BComposite -> implementation.composite(CComposite) - * - * This test fails. - * - * @throws Exception Failed - */ - public void testAComponent() throws Exception { - domain = SCADomain.newInstance("AComposite.composite"); - - System.out.println("Deployed names = " + domain.getComponentManager().getComponentNames()); - - C c = domain.getService(C.class, "AComponent"); - - String result = c.cOp(); - System.out.println("Method call returned [" + result + "]"); - Assert.assertNotNull(result); - Assert.assertTrue(result.indexOf("C:cOp()") != -1); - Assert.assertTrue(result.indexOf("X:xOp()") != -1); - Assert.assertTrue(result.indexOf("Y:yOp()") != -1); - } - - - /** - * This tests having: - * - * BComposite -> implementation.composite(CComposite) - * - * This test works. - * - * @throws Exception Failed - */ - public void testBComponent() throws Exception { - domain = SCADomain.newInstance("BComposite.composite"); - - System.out.println("Deployed names = " + domain.getComponentManager().getComponentNames()); - - C c = domain.getService(C.class, "BComponent"); - - String result = c.cOp(); - System.out.println("Method call returned [" + result + "]"); - Assert.assertNotNull(result); - Assert.assertTrue(result.indexOf("C:cOp()") != -1); - Assert.assertTrue(result.indexOf("X:xOp()") != -1); - Assert.assertTrue(result.indexOf("Y:yOp()") != -1); - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/RecursiveCompositeTestCaseFIXME.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/RecursiveCompositeTestCaseFIXME.java deleted file mode 100644 index a543add69b..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/RecursiveCompositeTestCaseFIXME.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 sample; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -//FIXME Fix this test case -public class RecursiveCompositeTestCaseFIXME extends TestCase { - - private SCADomain domain; - private Service1 tracker, tracker2; - - @Override - protected void setUp() throws Exception { - domain = SCADomain.newInstance("http://localhost", "/", "Composite1.composite", "Composite2.composite"); - tracker = domain.getService(Service1.class, "ComponentC"); - tracker2 = domain.getService(Service1.class, "ComponentB"); - - } - - @Override - protected void tearDown() throws Exception { - domain.close(); - } - - public void test() throws Exception { - try { - System.out.println("Main thread " + Thread.currentThread()); - System.out.println(tracker.track("Client")); - System.out.println(tracker2.track("Client")); - } catch (Throwable t) { - t.printStackTrace(); - } - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/X.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/X.java deleted file mode 100644 index e3a9335068..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/X.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 sample; - -/** - * Simple Service - */ -public interface X { - - /** - * Simple Operation - * - * @return A String - */ - String xOp(); -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/XImpl.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/XImpl.java deleted file mode 100644 index e430807568..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/XImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 sample; - -import org.osoa.sca.annotations.Service; - -/** - * Implementation of a simple service - */ -@Service(X.class) -public class XImpl implements X { - - /** - * Simple operation - * - * @return "X:xOp()" - */ - public String xOp() { - return "X:xOp()"; - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/Y.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/Y.java deleted file mode 100644 index c15a4f635a..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/Y.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 sample; - -/** - * Simple Service - */ -public interface Y { - - /** - * Simple Operation - * - * @return A String - */ - String yOp(); -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/YImpl.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/YImpl.java deleted file mode 100644 index 994c9eb95f..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/sample/YImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 sample; - -import org.osoa.sca.annotations.Service; - -/** - * Implementation of a Simple Service - */ -@Service(Y.class) -public class YImpl implements Y { - - /** - * A simple operation - * - * @return "Y:yOp()" - */ - public String yOp() { - return "Y:yOp()"; - } - -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/InnerTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/InnerTestCase.java deleted file mode 100644 index ebb4bc7acb..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/InnerTestCase.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 test; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class InnerTestCase extends TestCase { - - private SCADomain domain; - private Aggregator aggregator; - - @Override - protected void setUp() throws Exception { - domain = SCADomain.newInstance("Inner.composite"); - aggregator = domain.getService(Aggregator.class, "Aggregator"); - } - - @Override - protected void tearDown() throws Exception { - domain.close(); - } - - public void test() throws Exception { - try { - String result = aggregator.getAggregatedData(); - assertTrue(result.contains("InnerSource")); - assertTrue(result.contains("InnerSource")); - System.out.println(result); - } catch (Throwable t) { - t.printStackTrace(); - } - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/OuterTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/OuterTestCase.java deleted file mode 100644 index 6e95f5808b..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test/OuterTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 test; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -public class OuterTestCase { - - private SCADomain domain; - private Aggregator aggregator; - - @Before - public void setUp() throws Exception { - domain = SCADomain.newInstance("Outer.composite"); - aggregator = domain.getService(Aggregator.class, "Inner"); - } - - @After - public void tearDown() throws Exception { - domain.close(); - } - - @Ignore("TUSCANY-2484") - @Test - public void test() throws Exception { - String result = aggregator.getAggregatedData(); - Assert.assertTrue(result.contains("InnerSource")); - Assert.assertTrue(result.contains("OuterSource")); - System.out.println(result); - } -} diff --git a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test1/composite/CompositeClientTestCase.java b/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test1/composite/CompositeClientTestCase.java deleted file mode 100644 index b3abcac06e..0000000000 --- a/sca-java-1.x/tags/1.5.1-RC4/itest/recursive/src/test/java/test1/composite/CompositeClientTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 test1.composite; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * Simple client program that invokes the components that we wired together. - */ -public class CompositeClientTestCase extends TestCase { - - private SCADomain scaDomain; - private Target target; - - @Override - protected void setUp() throws Exception { - scaDomain = SCADomain.newInstance("test1/OuterComposite.composite"); - target = scaDomain.getService(Target.class, "Test1TargetComponent/Service_Two"); - } - - @Override - protected void tearDown() throws Exception { - scaDomain.close(); - } - - public void testComposite() throws Exception { - String res = target.hello("Wang Feng"); - assertEquals("TargetTwo: Hello Wang Feng!", res); - } - - // Test for problem in TUSCANY-2010 - public void testURLs() throws Exception { - try { - System.out.println("Component URI: " + scaDomain.getComponentManager().getComponent("Test1TargetComponent").getURI()); - System.out.println(" Service Name: " + scaDomain.getComponentManager().getComponent("Test1TargetComponent").getServices().get(0).getName()); - System.out.println(" Binding Name: " + scaDomain.getComponentManager().getComponent("Test1TargetComponent").getServices().get(0).getBindings().get(0).getName()); - System.out.println(" Binding URI: " + scaDomain.getComponentManager().getComponent("Test1TargetComponent").getServices().get(0).getBindings().get(0).getURI()); - assertEquals("/Test1TargetComponent/Service_One", scaDomain.getComponentManager().getComponent("Test1TargetComponent").getServices().get(0).getBindings().get(0).getURI()); - } catch (Throwable t) { - t.printStackTrace(); - } - } -} -- cgit v1.2.3