From 3ac2d800d840f03618fc364090d786effde84b1f Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:13:16 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835142 13f79535-47bb-0310-9956-ffa450edef68 --- .../vtest/java-api/apis/componentcontext/pom.xml | 45 ----- .../javaapi/apis/componentcontext/AComponent.java | 42 ----- .../javaapi/apis/componentcontext/BComponent.java | 29 ---- .../javaapi/apis/componentcontext/BService.java | 34 ---- .../javaapi/apis/componentcontext/CService.java | 29 ---- .../javaapi/apis/componentcontext/DComponent.java | 29 ---- .../apis/componentcontext/impl/AComponentImpl.java | 124 -------------- .../impl/AUnannotatedComponentImpl.java | 121 -------------- .../apis/componentcontext/impl/BComponentImpl.java | 52 ------ .../apis/componentcontext/impl/DComponentImpl.java | 32 ---- .../src/main/resources/ab.composite | 47 ------ .../componentcontext/ComponentContextTestCase.java | 184 --------------------- 12 files changed, 768 deletions(-) delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/pom.xml delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite delete mode 100644 branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java (limited to 'branches/sca-java-20080910/vtest/java-api/apis/componentcontext') diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/pom.xml b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/pom.xml deleted file mode 100644 index 9af4b21f8a..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - java-api-apis - 1.4-SNAPSHOT - ../pom.xml - - vtest-java-api-apis-componentcontext - Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - ComponentContext - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.4-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.4-SNAPSHOT - runtime - - - diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java deleted file mode 100644 index b2c8c07866..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java +++ /dev/null @@ -1,42 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext; - -/** - * Simple Service A. - */ -public interface AComponent { - - public String getName(); - - public String getContextURI(); - public String getServiceBName(); - public String getServiceReferenceBName(); - public String getSelfReferenceName(); - public String getProperty(); - public String getRequestContextServiceName(); - public String getCastCallableReferenceServiceName(); - public String getCastServiceReferenceServiceName(); - public void illegalCast(); - - public String testServiceLookup(); - public String getRequestContextContent(); - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java deleted file mode 100644 index 7e425c740f..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java +++ /dev/null @@ -1,29 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext; - -/** - * Simple Service B. - */ -public interface BComponent { - - String getName(); - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java deleted file mode 100644 index eff7cc5a88..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BService.java +++ /dev/null @@ -1,34 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext; - -import org.osoa.sca.annotations.Remotable; - -/** - * Simple Service B. - */ -@Remotable -public interface BService { - - String getBName(); - - String getSelfReferenceWithServiceName(); - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java deleted file mode 100644 index d0da012f6f..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/CService.java +++ /dev/null @@ -1,29 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext; - -/** - * Simple Service C. - */ -public interface CService { - - String getCName(); - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java deleted file mode 100644 index a221ba11fc..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/DComponent.java +++ /dev/null @@ -1,29 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface DComponent { - - public String getName(); - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java deleted file mode 100644 index 606443a480..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java +++ /dev/null @@ -1,124 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent; -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(AComponent.class) -@Scope("COMPOSITE") -@EagerInit -public class AComponentImpl implements AComponent { - - public static String rcContent = null; - - protected ComponentContext componentContext; - - @Reference - protected BService bReference; - - @Reference - protected DComponent dReference; - - @Property(name="aProperty", required=true) - protected String aProperty; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - @Init - public void init() { - RequestContext rc = componentContext.getRequestContext(); - if (rc != null) { - rcContent = "NotNull"; - } else { - rcContent = "Null"; - } - } - - public String getContextURI() { - return componentContext.getURI(); - } - - public String getServiceBName() { - return componentContext.getService(BService.class, "bReference").getBName(); - } - - public String getServiceReferenceBName() { - ServiceReference bSR = componentContext.getServiceReference(BService.class, "bReference"); - return bSR.getService().getBName(); - } - - public String getSelfReferenceName() { - ServiceReference aSR = componentContext.createSelfReference(AComponent.class); - return aSR.getService().getName(); - } - - public String getProperty() { - return componentContext.getProperty(String.class, "aProperty"); - } - - public String getRequestContextServiceName() { - return componentContext.getRequestContext().getServiceName(); - } - - public String getCastCallableReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - CallableReference bCR = componentContext.cast(b); - return bCR.getService().getBName(); - } - - public String getCastServiceReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - ServiceReference bSR = componentContext.cast(b); - return bSR.getService().getBName(); - } - - public void illegalCast() { - componentContext.cast(""); - } - - public String testServiceLookup() { - return componentContext.getService(DComponent.class, "dReference").getName(); - } - - public String getRequestContextContent() { - return rcContent; - } - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java deleted file mode 100644 index 34a71e1318..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AUnannotatedComponentImpl.java +++ /dev/null @@ -1,121 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent; -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(AComponent.class) -@Scope("COMPOSITE") -@EagerInit -public class AUnannotatedComponentImpl implements AComponent { - - public static String rcContent = null; - - protected ComponentContext componentContext; - - protected BService bReference; - - protected DComponent dReference; - - protected String aProperty; - - public String getName() { - return "ComponentA"; - } - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - @Init - public void init() { - RequestContext rc = componentContext.getRequestContext(); - if (rc != null) { - rcContent = "NotNull"; - } else { - rcContent = "Null"; - } - } - - public String getContextURI() { - return componentContext.getURI(); - } - - public String getServiceBName() { - return componentContext.getService(BService.class, "bReference").getBName(); - } - - public String getServiceReferenceBName() { - ServiceReference bSR = componentContext.getServiceReference(BService.class, "bReference"); - return bSR.getService().getBName(); - } - - public String getSelfReferenceName() { - ServiceReference aSR = componentContext.createSelfReference(AComponent.class); - return aSR.getService().getName(); - } - - public String getProperty() { - return componentContext.getProperty(String.class, "aProperty"); - } - - public String getRequestContextServiceName() { - return componentContext.getRequestContext().getServiceName(); - } - - public String getCastCallableReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - CallableReference bCR = componentContext.cast(b); - return bCR.getService().getBName(); - } - - public String getCastServiceReferenceServiceName() { - BService b = componentContext.getService(BService.class, "bReference"); - ServiceReference bSR = componentContext.cast(b); - return bSR.getService().getBName(); - } - - public void illegalCast() { - componentContext.cast(""); - } - - public String testServiceLookup() { - return componentContext.getService(DComponent.class, "dReference").getName(); - } - - public String getRequestContextContent() { - return rcContent; - } - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java deleted file mode 100644 index 71d2eade2b..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java +++ /dev/null @@ -1,52 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BService; -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.CService; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.annotations.Context; -import org.osoa.sca.annotations.Service; - -@Service(interfaces={BService.class, CService.class}) -public class BComponentImpl implements BService, CService { - - protected ComponentContext componentContext; - - @Context - public void setComponentContext(ComponentContext context) { - this.componentContext = context; - } - - public String getBName() { - return "ServiceB"; - } - - public String getCName() { - return "ServiceC"; - } - - public String getSelfReferenceWithServiceName() { - ServiceReference cSR = componentContext.createSelfReference(CService.class, "CService"); - return cSR.getService().getCName(); - } - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.java deleted file mode 100644 index 4b2c8c183b..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/DComponentImpl.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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl; - -import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.DComponent; -import org.osoa.sca.annotations.Service; - -@Service(DComponent.class) -public class DComponentImpl implements DComponent { - - public String getName() { - return "ComponentD"; - } - -} diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite deleted file mode 100644 index 19f110d5dc..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - PropertyA - - - - - - - PropertyA - - - - - - - - - - - diff --git a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java b/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java deleted file mode 100644 index 9bfe0c06e7..0000000000 --- a/branches/sca-java-20080910/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java +++ /dev/null @@ -1,184 +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 org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext; - -import org.apache.tuscany.sca.vtest.utilities.ServiceFinder; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -/** - * This test class tests the ComponentContext interface described in 1.7.1 of - * the SCA Java Annotations & APIs Specification 1.0. Relevant sections of 1.4 - * will also be covered here. - */ -public class ComponentContextTestCase { - - protected static String compositeName = "ab.composite"; - protected static AComponent a; - protected static AComponent aUnannotated; - protected static BService b; - - @BeforeClass - public static void init() throws Exception { - try { - System.out.println("Setting up"); - ServiceFinder.init(compositeName); - a = ServiceFinder.getService(AComponent.class, "AComponent"); - aUnannotated = ServiceFinder.getService(AComponent.class, "AUnannotatedComponent"); - b = ServiceFinder.getService(BService.class, "BComponent/BService"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @AfterClass - public static void destroy() throws Exception { - System.out.println("Cleaning up"); - ServiceFinder.cleanup(); - } - - /** - * Lines 776
- * getURI() - Returns the absolute URI of the component within the SCA - * domain. - * - * @throws Exception - */ - @Test - public void testGetURI() throws Exception { - Assert.assertEquals("AComponent", a.getContextURI()); - Assert.assertEquals("AUnannotatedComponent", aUnannotated.getContextURI()); - } - - /** - * Lines 778
- * getService(Class<B> businessInterface, String referenceName) ? - * Returns a proxy for the reference defined by the current component. - * - * @throws Exception - */ - @Test - public void testGetService() throws Exception { - Assert.assertEquals(a.getServiceBName(), "ServiceB"); - } - - /** - * Lines 780
- * getServiceReference(Class<B> businessInterface, String - * referenceName) ? Returns a ServiceReference defined by the current - * component. - * - * @throws Exception - */ - @Test - public void testGetServiceReference() throws Exception { - Assert.assertEquals(a.getServiceReferenceBName(), "ServiceB"); - } - - /** - * Lines 783
- * createSelfReference(Class<B> businessInterface) ? Returns a - * ServiceReference that can be used to invoke this component over the - * designated service. - * - * @throws Exception - */ - @Test - public void testCreateSelfReference() throws Exception { - Assert.assertEquals(a.getSelfReferenceName(), "ComponentA"); - } - - /** - * Lines 785
- * getSelfReference(Class<B> businessInterface, String serviceName) - - * Returns a ServiceReference that can be used to invoke this component over - * the designated service. Service name explicitly declares the service name - * to invoke. - * - * @throws Exception - */ - @Test - public void testCreateSelfReferenceWithServiceName() throws Exception { - Assert.assertEquals("ServiceC", b.getSelfReferenceWithServiceName()); - } - - /** - * Lines 788
- * getProperty (Class<B> type, String propertyName) - Returns the - * value of an SCA property defined by this component. - * - * @throws Exception - */ - @Test - public void testGetProperty() throws Exception { - Assert.assertEquals("PropertyA", a.getProperty()); - } - - /** - * Lines 793
- * getRequestContext() - Returns the context for the current SCA service - * request, or null if there is no current request or if the context is - * unavailable. - * - * @throws Exception - */ - @Test - public void testGetRequestContext() throws Exception { - Assert.assertEquals("AComponent", a.getRequestContextServiceName()); - Assert.assertEquals("NotNull", a.getRequestContextContent()); - } - - /** - * Lines 790,794
- * cast(B target) - Casts a type-safe reference to a CallableReference. - * - * @throws Exception - */ - @Test - public void testCast() throws Exception { - Assert.assertEquals("ServiceB", a.getCastCallableReferenceServiceName()); - Assert.assertEquals("ServiceB", a.getCastServiceReferenceServiceName()); - - String check = ""; - try { - a.illegalCast(); - } catch (IllegalArgumentException iae) { - check = "IllegalCast"; - } - Assert.assertEquals("IllegalCast", check); - } - - /** - * Lines 342-344
- * When a component implementation needs access to a service where the - * reference to the service is not known at compile time, the reference can - * be located using the component?s ComponentContext. - * - * @throws Exception - */ - @Ignore - public void testServiceLookup() throws Exception { - Assert.assertEquals("ComponentD", a.testServiceLookup()); - } - -} -- cgit v1.2.3