You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2008/04/04 00:42:41 UTC

svn commit: r644537 - in /incubator/tuscany/java/sca/vtest/java-api: ./ annotations/ annotations/reference/ annotations/service/ apis/ apis/componentcontext/ apis/componentcontext/src/ apis/componentcontext/src/main/ apis/componentcontext/src/main/java...

Author: kwilliams
Date: Thu Apr  3 15:42:38 2008
New Revision: 644537

URL: http://svn.apache.org/viewvc?rev=644537&view=rev
Log:
Adding Yee-Kang's test contribution for ComponentContext.  TUSCANY-2195

Added:
    incubator/tuscany/java/sca/vtest/java-api/apis/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/
    incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java   (with props)
    incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml   (with props)
Modified:
    incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml
    incubator/tuscany/java/sca/vtest/java-api/annotations/reference/pom.xml
    incubator/tuscany/java/sca/vtest/java-api/annotations/service/pom.xml
    incubator/tuscany/java/sca/vtest/java-api/pom.xml

Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml?rev=644537&r1=644536&r2=644537&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml Thu Apr  3 15:42:38 2008
@@ -28,7 +28,7 @@
     <artifactId>java-api-annotations</artifactId>
     <packaging>pom</packaging>
 
-    <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests</name>
+    <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests - Annotations</name>
 
     <dependencies>
         <dependency>

Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/reference/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/reference/pom.xml?rev=644537&r1=644536&r2=644537&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/reference/pom.xml (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/reference/pom.xml Thu Apr  3 15:42:38 2008
@@ -26,7 +26,7 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>vtest-java-api-annotations-reference</artifactId>
-    <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests - @Reference</name>
+    <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests - Annotations - @Reference</name>
 
     <dependencies>
         <dependency>

Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/pom.xml?rev=644537&r1=644536&r2=644537&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/pom.xml (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/pom.xml Thu Apr  3 15:42:38 2008
@@ -26,7 +26,7 @@
         <relativePath>../pom.xml</relativePath>
     </parent>
     <artifactId>vtest-java-api-annotations-service</artifactId>
-    <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests - @Service</name>
+    <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests - Annotations - @Service</name>
 
     <dependencies>
         <dependency>

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml Thu Apr  3 15:42:38 2008
@@ -0,0 +1,45 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>java-api-apis</artifactId>
+        <version>2.0-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>vtest-java-api-apis-componentcontext</artifactId>
+    <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs - ComponentContext</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+</project>

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java Thu Apr  3 15:42:38 2008
@@ -0,0 +1,34 @@
+/*
+ * 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();
+
+}

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/AComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java Thu Apr  3 15:42:38 2008
@@ -0,0 +1,29 @@
+/*
+ * 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();
+
+}

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/BComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java Thu Apr  3 15:42:38 2008
@@ -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.vtest.javaapi.apis.componentcontext.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.AComponent;
+import org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.BComponent;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(AComponent.class)
+public class AComponentImpl implements AComponent {
+
+    protected ComponentContext componentContext;
+    
+    @Reference
+    protected BComponent bReference;
+
+    public String getName() {
+        return "ComponentA";
+    }
+
+    @Context
+    public void setComponentContext(ComponentContext context) {
+        this.componentContext = context;
+    }
+
+    public String getContextURI() {
+        return componentContext.getURI();
+    }
+
+    public String getServiceBName() {
+        return componentContext.getService(BComponent.class, "bReference").getName();        
+    }
+
+    public String getServiceReferenceBName() {
+        ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
+        return bSR.getService().getName();
+    }
+
+}

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/AComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java Thu Apr  3 15:42:38 2008
@@ -0,0 +1,32 @@
+/*
+ * 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.BComponent;
+import org.osoa.sca.annotations.Service;
+
+@Service(BComponent.class)
+public class BComponentImpl implements BComponent {
+
+    public String getName() {
+        return "ComponentB";
+    }
+
+}

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/impl/BComponentImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite Thu Apr  3 15:42:38 2008
@@ -0,0 +1,33 @@
+<?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"
+	targetNamespace="http://java-api-tests"
+	name="AB-Composite">
+
+    <component name="AComponent">
+	    <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.AComponentImpl"/>
+	    <reference name="bReference" target="BComponent"/>
+     </component>
+
+    <component name="BComponent">
+        <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.apis.componentcontext.impl.BComponentImpl"/>
+    </component>
+
+</composite>

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/main/resources/ab.composite
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java Thu Apr  3 15:42:38 2008
@@ -0,0 +1,83 @@
+/*
+ * 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.host.embedded.SCADomain;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+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.
+ */
+public class ComponentContextTestCase {
+
+    protected static SCADomain domain;
+    protected static String compositeName = "ab.composite";
+    protected static AComponent a;
+
+    @BeforeClass
+    public static void init() throws Exception {
+        try {
+            System.out.println("Setting up");
+            domain = SCADomain.newInstance(compositeName);
+            a = domain.getService(AComponent.class, "AComponent");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    @AfterClass
+    public static void destroy() throws Exception {
+        System.out.println("Cleaning up");
+        if (domain != null) {
+            domain.close();
+        }
+    }
+
+    /**
+     * L776: Tests getURI() of the ComponentContext interface.
+     * @throws Exception
+     */
+    @Test
+    public void testGetURI() throws Exception {
+        Assert.assertEquals(a.getContextURI(), "AComponent");
+    }
+
+    /**
+     * L778: Tests getService() of the ComponentContext interface.
+     * @throws Exception
+     */
+    @Test
+    public void testGetService() throws Exception {
+        Assert.assertEquals(a.getServiceBName(), "ComponentB");
+    }
+
+    /**
+     * L780: Tests getServiceReference() of the ComponentContext interface.
+     * @throws Exception
+     */
+    @Test
+    public void testGetServiceReference() throws Exception {
+        Assert.assertEquals(a.getServiceReferenceBName(), "ComponentB");
+    }
+
+}

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/componentcontext/src/test/java/org/apache/tuscany/sca/vtest/javaapi/apis/componentcontext/ComponentContextTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml?rev=644537&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml (added)
+++ incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml Thu Apr  3 15:42:38 2008
@@ -0,0 +1,59 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>vtest-java-api</artifactId>
+        <version>2.0-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>java-api-apis</artifactId>
+    <packaging>pom</packaging>
+
+    <name>Apache Tuscany SCA Java APIs and Annotations Verification Tests - APIs</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <modules>
+                <module>componentcontext</module>
+           </modules>
+        </profile>
+    </profiles>
+</project>

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/tuscany/java/sca/vtest/java-api/apis/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/tuscany/java/sca/vtest/java-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/pom.xml?rev=644537&r1=644536&r2=644537&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/pom.xml (original)
+++ incubator/tuscany/java/sca/vtest/java-api/pom.xml Thu Apr  3 15:42:38 2008
@@ -54,6 +54,7 @@
             </activation>
             <modules>
                 <module>annotations</module>
+                <module>apis</module>
            </modules>
         </profile>
     </profiles>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org