You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/01/13 21:19:14 UTC
svn commit: r495960 - in
/incubator/tuscany/java/testing/sca/itest/propertyTest: ./
src/main/java/org/apache/tuscany/sca/itest/ src/main/resources/META-INF/sca/
src/test/java/org/apache/tuscany/sca/itest/
Author: lresende
Date: Sat Jan 13 12:19:13 2007
New Revision: 495960
URL: http://svn.apache.org/viewvc?view=rev&rev=495960
Log:
TUSCANY-911 - Adding testcase for checking default values for properties
Added:
incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
Modified:
incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml
incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/resources/META-INF/sca/default.scdl
incubator/tuscany/java/testing/sca/itest/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java
Modified: incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml?view=diff&rev=495960&r1=495959&r2=495960
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml (original)
+++ incubator/tuscany/java/testing/sca/itest/propertyTest/pom.xml Sat Jan 13 12:19:13 2007
@@ -51,10 +51,41 @@
<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>**/*Test.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>**/*Test.java</exclude>
+ </excludes>
+ </configuration>
</plugin>
</plugins>
</build>
Added: incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java?view=auto&rev=495960
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java (added)
+++ incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java Sat Jan 13 12:19:13 2007
@@ -0,0 +1,26 @@
+/*
+ * 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.itest;
+
+
+public interface PropertyComponent {
+ public String getLocation();
+ public String getYear();
+}
Added: incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java?view=auto&rev=495960
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java (added)
+++ incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java Sat Jan 13 12:19:13 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.itest;
+
+import org.osoa.sca.annotations.Property;
+
+public class PropertyComponentImpl implements PropertyComponent {
+ @Property(name = "location")
+ protected String location = "RTP";
+
+ @Property(name = "year")
+ protected String year = "2006";
+
+ public String getLocation(){
+ return location;
+ }
+
+ public String getYear(){
+ return year;
+ }
+}
Modified: incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/resources/META-INF/sca/default.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/resources/META-INF/sca/default.scdl?view=diff&rev=495960&r1=495959&r2=495960
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/resources/META-INF/sca/default.scdl (original)
+++ incubator/tuscany/java/testing/sca/itest/propertyTest/src/main/resources/META-INF/sca/default.scdl Sat Jan 13 12:19:13 2007
@@ -61,6 +61,10 @@
<property name="nonFileProperty" file="META-INF/sca/fileProperty.txt" source="$complex/foo:c"/>
<property name="two" source="$number">2</property>
</component>
+
+ <component name="PropertyComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.PropertyComponentImpl"/>
+ </component>
<!-- <component name="Override">
<implementation.composite name="OverrideComposite" scdlLocation="override.scdl"/>
Modified: incubator/tuscany/java/testing/sca/itest/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/testing/sca/itest/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java?view=diff&rev=495960&r1=495959&r2=495960
==============================================================================
--- incubator/tuscany/java/testing/sca/itest/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java (original)
+++ incubator/tuscany/java/testing/sca/itest/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java Sat Jan 13 12:19:13 2007
@@ -21,15 +21,13 @@
import junit.framework.TestCase;
-import org.apache.tuscany.sca.itest.ABCDComponent;
-import org.apache.tuscany.sca.itest.ABComponent;
-import org.apache.tuscany.sca.itest.CDComponent;
import org.osoa.sca.CurrentCompositeContext;
public class PropertyITest extends TestCase {
private ABComponent abService;
private CDComponent cdService;
private ABCDComponent abcdService;
+ private PropertyComponent propertyService;
// private PropertyService propertyService;
@@ -88,11 +86,19 @@
assertEquals("d", abcdService.getD());
}
+ public void testDefaultProperty()
+ {
+ assertEquals("RTP",propertyService.getLocation());
+ assertEquals("2006",propertyService.getYear());
+
+ }
+
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");
- // propertyService = CurrentCompositeContext.getContext().locateService(PropertyService.class, "PropertyService");
+ propertyService = CurrentCompositeContext.getContext().locateService(PropertyComponent.class, "PropertyComponent");
+ //propertyService = CurrentCompositeContext.getContext().locateService(PropertyService.class, "PropertyService");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org