Author: bdaniel
Date: Mon Oct 23 07:22:59 2006
New Revision: 467002

URL: http://svn.apache.org/viewvc?view=rev&rev=467002
Log:
Simple property test

Added:
    incubator/tuscany/sandbox/bdaniel/propertyTest/pom.xml
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/
    incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/testing/
    
incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java

Added: incubator/tuscany/sandbox/bdaniel/propertyTest/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/pom.xml?view=auto&rev=467002
==============================================================================
--- incubator/tuscany/sandbox/bdaniel/propertyTest/pom.xml (added)
+++ incubator/tuscany/sandbox/bdaniel/propertyTest/pom.xml Mon Oct 23 07:22:59 
2006
@@ -0,0 +1,71 @@
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.tuscany.testing</groupId>
+    <artifactId>propertyTest</artifactId>
+    <version>SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osoa</groupId>
+            <artifactId>sca-api-r0.95</artifactId>
+            <version>1.0-incubator-M2</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.tuscany.sca.plugins</groupId>
+                <artifactId>tuscany-itest-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>start</id>
+                        <goals>
+                            <goal>start</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>test</id>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                        <configuration>
+                            <includes>
+                                <include>**/*ITest.java</include>
+                            </includes>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>stop</id>
+                        <goals>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>**/*ITest.java</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponent.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,9 @@
+package testing;
+
+public interface ABCDComponent {
+    String getA();
+    String getB();
+    String getC();
+    String getD();
+}
+

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABCDComponentImpl.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,36 @@
+package testing;
+
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+
[EMAIL PROTECTED]("MODULE")
+public class ABCDComponentImpl implements ABCDComponent {
+    private ABComponent abComponent;
+    private CDComponent cdComponent;
+    
+    @Reference
+    public void setAb(ABComponent component) {
+        this.abComponent = component;
+    }
+    
+    @Reference
+    public void setCd(CDComponent component) {
+        this.cdComponent = component;
+    }
+    
+    public String getA() {
+        return this.abComponent.getA();
+    }
+    
+    public String getB() {
+        return this.abComponent.getB();       
+    }
+    
+    public String getC() {
+        return this.cdComponent.getC();
+    }
+    
+    public String getD() {
+        return this.cdComponent.getD();
+    }
+}

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponent.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,8 @@
+package testing;
+
+public interface ABComponent {  
+
+    String getA();
+    String getB();
+    int getIntValue();
+}

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/ABComponentImpl.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,37 @@
+package testing;
+
+import org.osoa.sca.annotations.Property;
+
+public class ABComponentImpl implements ABComponent {
+
+    private String aProperty;
+    private String bProperty;
+    private int intValue;
+
+    @Property
+    public void setA(final String A) {
+        this.aProperty = A;
+    }
+
+    @Property
+    public void setB(final String B) {
+        this.bProperty = B;
+    }
+    
+    @Property
+    public void setOne(final int value) {
+        this.intValue = value;
+    }
+    
+    public String getA() {
+        return this.aProperty;
+    }
+    
+    public String getB() {
+        return this.bProperty;
+    }
+    
+    public int getIntValue() {
+        return this.intValue;
+    }
+}

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponent.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,11 @@
+package testing;
+
+/**
+ * @version $Rev: 465498 $ $Date: 2006-10-19 01:23:25 -0400 (Thu, 19 Oct 2006) 
$
+ */
+public interface CDComponent {  
+
+    String getC();
+    String getD();
+    String getNoSource();
+}

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/java/testing/CDComponentImpl.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,38 @@
+package testing;
+
+import org.osoa.sca.annotations.Property;
+
+public class CDComponentImpl implements CDComponent {
+
+    private String cProperty;
+    private String dProperty;
+    private String nosource;
+
+    @Property
+    public void setC(final String C) {
+        this.cProperty = C;
+    }
+
+    @Property
+    public void setD(final String D) {
+        this.dProperty = D;
+    }
+    
+    @Property
+    public void setNosource(final String value) {
+        this.nosource = value;
+    }
+    
+    public String getC() {
+        return this.cProperty;
+    }
+    
+    public String getD() {
+        return this.dProperty;
+    }
+
+    public String getNoSource() {
+       return this.nosource;
+    }
+}
+

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/main/resources/META-INF/sca/default.scdl
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,53 @@
+<?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:foo="http://foo"; 
+           name="PropertyTest">
+   
+    <property name="number" type="xsd:int">1</property>
+    
+       <property name="complex" type="foo:MyComplexType">
+               <foo:a>a</foo:a>
+               <foo:b>b</foo:b>
+               <foo:c>c</foo:c>
+               <foo:d>d</foo:d>
+       </property>     
+
+       <component name="ABCDComponent">
+               <implementation.java class="testing.ABCDComponentImpl"/>
+        <reference name="ab">ABComponent</reference>
+        <reference name="cd">CDComponent</reference>
+    </component>
+    
+    <component name="ABComponent">
+               <implementation.java class="testing.ABComponentImpl"/>
+               <property name="a" source="$complex/foo:a"/>
+               <property name="b" source="$complex/foo:b"/>
+               <property name="one" source="$number"/>
+    </component>
+    
+    <component name="CDComponent">
+       <implementation.java class="testing.CDComponentImpl"/>
+       <property name="c" source="$complex/foo:c"/>
+       <property name="d" source="$complex/foo:d"/>
+       <property name="nosource">aValue</property>
+    </component>    
+   
+</composite>

Added: 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java?view=auto&rev=467002
==============================================================================
--- 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java
 (added)
+++ 
incubator/tuscany/sandbox/bdaniel/propertyTest/src/test/java/testing/PropertyITest.java
 Mon Oct 23 07:22:59 2006
@@ -0,0 +1,48 @@
+package testing;
+
+import junit.framework.TestCase;
+import org.osoa.sca.CurrentCompositeContext;
+
+public class PropertyITest extends TestCase {
+    private ABComponent abService;
+    private CDComponent cdService;  
+    private ABCDComponent abcdService;
+       
+
+    public void testA() {
+        assertEquals("a", abService.getA());
+    }
+    
+    public void testB() {
+        assertEquals("b", abService.getB());
+    }
+
+    public void testC() {
+        assertEquals("c", cdService.getC());       
+    }
+    
+    public void testD() {
+        assertEquals("d", cdService.getD());
+    }
+    
+    public void testIntValue() {
+        assertEquals(1, abService.getIntValue());
+    }
+    public void testNoSource() {
+        assertEquals("aValue", cdService.getNoSource());
+    }
+    
+    public void testABCD() {
+        assertEquals("a", abcdService.getA());
+        assertEquals("b", abcdService.getB());
+        assertEquals("c", abcdService.getC());
+        assertEquals("d", abcdService.getD());
+    }
+    
+    protected void setUp() throws Exception {
+        super.setUp();
+        abService = 
CurrentCompositeContext.getContext().locateService(ABComponent.class, 
"ABComponent");
+        cdService = 
CurrentCompositeContext.getContext().locateService(CDComponent.class, 
"CDComponent");    
+        abcdService = 
CurrentCompositeContext.getContext().locateService(ABCDComponent.class, 
"ABCDComponent");
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to