tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwilli...@apache.org
Subject svn commit: r673222 - in /tuscany/java/sca/vtest/assembly/component/src: main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/ main/resources/ test/java/org/apache/tuscany/sca/vtest/assembly/component/
Date Tue, 01 Jul 2008 22:21:46 GMT
Author: kwilliams
Date: Tue Jul  1 15:21:44 2008
New Revision: 673222

URL: http://svn.apache.org/viewvc?rev=673222&view=rev
Log:
Another Assembly Model test

Added:
    tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
  (with props)
Modified:
    tuscany/java/sca/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java
    tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java

Modified: tuscany/java/sca/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java?rev=673222&r1=673221&r2=673222&view=diff
==============================================================================
--- tuscany/java/sca/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java
(original)
+++ tuscany/java/sca/vtest/assembly/component/src/main/java/org/apache/tuscany/sca/vtest/assembly/component/impl/BServiceImpl.java
Tue Jul  1 15:21:44 2008
@@ -26,7 +26,7 @@
 @Service(BService.class)
 public class BServiceImpl implements BService {
     
-    @Property
+    @Property  
     protected String someProperty;
 
     public String getState() {

Added: tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite?rev=673222&view=auto
==============================================================================
--- tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
(added)
+++ tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
Tue Jul  1 15:21:44 2008
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	targetNamespace="http://assembly-tests"
+	name="Assemby-zero-components-Composite">
+
+    
+</composite>

Propchange: tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: tuscany/java/sca/vtest/assembly/component/src/main/resources/zerocomponents.composite
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java?rev=673222&r1=673221&r2=673222&view=diff
==============================================================================
--- tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
(original)
+++ tuscany/java/sca/vtest/assembly/component/src/test/java/org/apache/tuscany/sca/vtest/assembly/component/ComponentTestCase.java
Tue Jul  1 15:21:44 2008
@@ -31,30 +31,8 @@
  */
 public class ComponentTestCase {
 
-    protected static String compositeName = "component.composite";
-    protected static AService aService = null;
-
-    @BeforeClass
-    public static void init() throws Exception {
-        try {
-            System.out.println("Setting up");
-            ServiceFinder.init(compositeName);
-            aService = ServiceFinder.getService(AService.class, "AComponent/AService");
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
-
-    @AfterClass
-    public static void destroy() throws Exception {
-
-        System.out.println("Cleaning up");
-        ServiceFinder.cleanup();
-
-    }
-
     /**
-     * Lines 92-94:
+     * Lines 92-96:
      * <p>
      * Components are configured instances of implementations. Components
      * provide and consume services. More than one component can use and
@@ -62,9 +40,27 @@
      * implementation differently.
      */
     @Test
-    public void component1() throws Exception {
-        Assert.assertEquals("some b component value", aService.getBProperty());
-        Assert.assertEquals("some b2 component value", aService.getB2Property());
+    public void components1() throws Exception {
+        System.out.println("Setting up");
+        ServiceFinder.init("component.composite");
+        AService service = ServiceFinder.getService(AService.class, "AComponent/AService");
+        Assert.assertEquals("some b component value", service.getBProperty());
+        Assert.assertEquals("some b2 component value", service.getB2Property());
+        System.out.println("Cleaning up");
+        ServiceFinder.cleanup();
+    }
+
+    /**
+     * Lines 96-97:
+     * <p>
+     * There can be zero or more component elements within a composite.
+     */
+    @Test
+    public void components2() throws Exception {
+        System.out.println("Setting up");
+        ServiceFinder.init("zerocomponents.composite");
+        System.out.println("Cleaning up");
+        ServiceFinder.cleanup();
     }
 
 }



Mime
View raw message