You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2007/02/13 00:12:05 UTC
svn commit: r506739 - in /incubator/tuscany/java/sca/integration-test: ./
propertyTest/ propertyTest/src/test/java/org/apache/tuscany/sca/itest/
specTest/ specTest/src/main/java/org/apache/tuscany/sca/test/spec/
specTest/src/main/java/org/apache/tuscan...
Author: jboynes
Date: Mon Feb 12 15:12:03 2007
New Revision: 506739
URL: http://svn.apache.org/viewvc?view=rev&rev=506739
Log:
copy spec and property itests to integration-test module
fix up tests so they compile with 1.0 api
still need to wire things up and figure out what they are testing
Added:
incubator/tuscany/java/sca/integration-test/
incubator/tuscany/java/sca/integration-test/pom.xml (with props)
incubator/tuscany/java/sca/integration-test/propertyTest/
- copied from r506724, incubator/tuscany/java/testing/sca/itest/propertyTest/
incubator/tuscany/java/sca/integration-test/specTest/
- copied from r506723, incubator/tuscany/java/testing/sca/itest/specTest/
Modified:
incubator/tuscany/java/sca/integration-test/propertyTest/pom.xml
incubator/tuscany/java/sca/integration-test/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java
incubator/tuscany/java/sca/integration-test/specTest/pom.xml
incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/SCAComponentService.java
incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java
incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyServiceImpl.java
incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyTotalServiceImpl.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java
incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java
Added: incubator/tuscany/java/sca/integration-test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/pom.xml?view=auto&rev=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/pom.xml (added)
+++ incubator/tuscany/java/sca/integration-test/pom.xml Mon Feb 12 15:12:03 2007
@@ -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>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>integration-test</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany Integration Tests</name>
+ <description>Integration tests for SCA.</description>
+
+ <modules>
+ <module>specTest</module>
+ <module>propertyTest</module>
+ </modules>
+
+ <properties>
+ <kernelVersion>1.0-incubator-SNAPSHOT</kernelVersion>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r1.0</artifactId>
+ <version>1.0-incubator-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
Propchange: incubator/tuscany/java/sca/integration-test/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/integration-test/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/integration-test/propertyTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/propertyTest/pom.xml?view=diff&rev=506739&r1=506724&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/propertyTest/pom.xml (original)
+++ incubator/tuscany/java/sca/integration-test/propertyTest/pom.xml Mon Feb 12 15:12:03 2007
@@ -1,91 +1,56 @@
<?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.
+ * 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>
<parent>
- <groupId>org.apache.tuscany.testing</groupId>
- <artifactId>sca-itest</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>integration-test</artifactId>
<version>1.0-incubator-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
</parent>
-
<modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.tuscany.testing</groupId>
- <artifactId>iTest-propertyTest</artifactId>
- <version>${testing.version}</version>
+ <artifactId>propertyTest</artifactId>
<packaging>jar</packaging>
- <name>Test Suite for SCA properties</name>
+ <name>Integration Test Suite for SCA Properties</name>
<dependencies>
<dependency>
<groupId>org.osoa</groupId>
- <artifactId>sca-api-r0.95</artifactId>
+ <artifactId>sca-api-r1.0</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
+
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.sca.plugins</groupId>
+ <groupId>org.apache.tuscany.sca</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>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
Modified: incubator/tuscany/java/sca/integration-test/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java?view=diff&rev=506739&r1=506724&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java (original)
+++ incubator/tuscany/java/sca/integration-test/propertyTest/src/test/java/org/apache/tuscany/sca/itest/PropertyITest.java Mon Feb 12 15:12:03 2007
@@ -20,97 +20,90 @@
package org.apache.tuscany.sca.itest;
import junit.framework.TestCase;
-
-import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.annotations.Reference;
public class PropertyITest extends TestCase {
- private ABComponent abService;
- private CDComponent cdService;
- private ABCDComponent abcdService;
- private PropertyComponent propertyService;
- // private PropertyService propertyService;
-
+ @Reference
+ public ABComponent abService;
+ @Reference
+ public CDComponent cdService;
+ @Reference
+ public ABCDComponent abcdService;
+ @Reference
+ public PropertyComponent propertyService;
+
public void testA() {
assertEquals("a", abService.getA());
}
-
+
public void testB() {
assertEquals("b", abService.getB());
}
public void testC() {
- assertEquals("c", cdService.getC());
+ assertEquals("c", cdService.getC());
}
-
+
public void testC2() {
assertEquals("c", cdService.getC2());
}
+
public void testD() {
assertEquals("d", cdService.getD());
}
-
+
public void testF() {
assertEquals("a", abService.getF());
}
-
+
public void testZ() {
assertEquals("z", abService.getZ());
}
-
-
+
+
public void testIntValue() {
assertEquals(1, abService.getIntValue());
}
-
+
public void testDefaultValue() {
assertEquals(1, abService.getIntValue());
}
-
+
public void testDefaultValueOverride() {
assertEquals(1, cdService.getOverrideValue());
}
-
+
public void testNoSource() {
assertEquals("aValue", cdService.getNoSource());
}
-
+
public void testFileProperty() {
assertEquals("fileValue", cdService.getFileProperty());
}
-
+
public void testABCD() {
assertEquals("a", abcdService.getA());
assertEquals("b", abcdService.getB());
assertEquals("c", abcdService.getC());
assertEquals("d", abcdService.getD());
}
-
- public void testDefaultProperty()
- {
- assertEquals("RTP",propertyService.getLocation());
- assertEquals("2006",propertyService.getYear());
-
- }
-
- public void testComplexProperty()
- {
+
+ public void testDefaultProperty() {
+ assertEquals("RTP", propertyService.getLocation());
+ assertEquals("2006", propertyService.getYear());
+
+ }
+
+ public void testComplexProperty() {
ComplexPropertyBean propBean = propertyService.getComplexPropertyOne();
assertNotNull(propBean);
assertEquals("TestString_1", propBean.getStringArray()[0]);
assertEquals(2, propBean.numberSetArray[1].integerNumber);
-
+
propBean = propertyService.getComplexPropertyTwo();
assertNotNull(propBean);
assertEquals(10, propBean.intArray[0]);
- assertEquals((float)22, propBean.numberSetArray[1].floatNumber);
- }
-
- 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(PropertyComponent.class, "PropertyComponent");
+ assertEquals((float) 22, propBean.numberSetArray[1].floatNumber);
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/pom.xml?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/pom.xml (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/pom.xml Mon Feb 12 15:12:03 2007
@@ -1,39 +1,37 @@
<?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.
+ * 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>
<parent>
- <groupId>org.apache.tuscany.testing</groupId>
- <artifactId>sca-itest</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>integration-test</artifactId>
<version>1.0-incubator-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>iTest-specTest</artifactId>
- <version>SNAPSHOT</version>
+ <artifactId>specTest</artifactId>
<packaging>jar</packaging>
- <name>Test Suite for SCA Spec APIs</name>
+ <name>Integration Test Suite for SCA Spec APIs</name>
<dependencies>
<dependency>
<groupId>org.osoa</groupId>
- <artifactId>sca-api-r0.95</artifactId>
+ <artifactId>sca-api-r1.0</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -44,47 +42,16 @@
<build>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ </execution>
+ </executions>
</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>**/*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>
</project>
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/SCAComponentService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/SCAComponentService.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/SCAComponentService.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/SCAComponentService.java Mon Feb 12 15:12:03 2007
@@ -18,11 +18,11 @@
*/
package org.apache.tuscany.sca.test.spec;
-import org.osoa.sca.CompositeContext;
+import org.osoa.sca.ComponentContext;
public interface SCAComponentService {
String getComponentName();
- CompositeContext getContext();
+ ComponentContext getContext();
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyListServiceImpl.java Mon Feb 12 15:12:03 2007
@@ -42,23 +42,23 @@
protected String year = "2006";
public String[] getHolidays() {
- return getHolidays(new Integer(year).intValue());
+ return getHolidays(Integer.parseInt(year));
}
public String[] getHolidays(int year) {
MyListService myService;
if (myListServicesList != null) {
- for (int i = 0; i < myListServicesList.size(); i++) {
- myService = myListServicesList.get(i);
- if (new Integer(myService.getYear()).intValue() == year) {
+ for (MyListService aMyListServicesList : myListServicesList) {
+ myService = aMyListServicesList;
+ if (Integer.parseInt(myService.getYear()) == year) {
return myService.getHolidays();
}
}
}
if (myListServicesArray != null) {
- for (int i = 0; i < myListServicesArray.length; i++) {
- myService = myListServicesArray[i];
- if (new Integer(myService.getYear()).intValue() == year) {
+ for (MyListService aMyListServicesArray : myListServicesArray) {
+ myService = aMyListServicesArray;
+ if (Integer.parseInt(myService.getYear()) == year) {
return myService.getHolidays();
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyServiceImpl.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyServiceImpl.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyServiceImpl.java Mon Feb 12 15:12:03 2007
@@ -24,7 +24,7 @@
import org.apache.tuscany.sca.test.spec.MyListServiceByYear;
import org.apache.tuscany.sca.test.spec.MyService;
import org.apache.tuscany.sca.test.spec.MyServiceByDate;
-import org.osoa.sca.CompositeContext;
+import org.osoa.sca.ComponentContext;
import org.osoa.sca.annotations.ComponentName;
import org.osoa.sca.annotations.Context;
import org.osoa.sca.annotations.Destroy;
@@ -48,10 +48,10 @@
protected String year = "2006";
@ComponentName
- private String componentName;
+ protected String componentName;
@Context
- private CompositeContext context;
+ protected ComponentContext context;
public MyServiceImpl() {
System.out.println("creating service instance...");
@@ -66,8 +66,8 @@
public Date nextHoliday(Date today) {
Date d1;
String[] days = getHolidays();
- for (int j = 0; j < days.length; j++) {
- d1 = new Date(days[j]);
+ for (String day : days) {
+ d1 = new Date(day);
if (d1.after(today))
return d1;
}
@@ -107,7 +107,7 @@
return componentName;
}
- public CompositeContext getContext() {
+ public ComponentContext getContext() {
return context;
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyTotalServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyTotalServiceImpl.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyTotalServiceImpl.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/main/java/org/apache/tuscany/sca/test/spec/impl/MyTotalServiceImpl.java Mon Feb 12 15:12:03 2007
@@ -25,7 +25,7 @@
import org.apache.tuscany.sca.test.spec.MyService;
import org.apache.tuscany.sca.test.spec.MyServiceByDate;
import org.apache.tuscany.sca.test.spec.MyTotalService;
-import org.osoa.sca.CompositeContext;
+import org.osoa.sca.ComponentContext;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
@@ -61,7 +61,7 @@
return myService.getComponentName();
}
- public CompositeContext getContext() {
+ public ComponentContext getContext() {
return myService.getContext();
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceListTest.java Mon Feb 12 15:12:03 2007
@@ -18,18 +18,14 @@
*/
package org.apache.tuscany.sca.test.spec;
-import org.apache.tuscany.sca.test.spec.MyListService;
-import org.apache.tuscany.sca.test.spec.MyListServiceByYear;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-
import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
public class ComponentServiceReferenceListTest extends TestCase {
- private MyListService myListService;
- private MyListServiceByYear myListServiceByYear;
-
- private CompositeContext context;
+ @Reference
+ public MyListService myListService;
+ @Reference
+ public MyListServiceByYear myListServiceByYear;
public void testDefaultProperty() {
assertEquals("2007", myListService.getYear());
@@ -39,12 +35,5 @@
public void testDefaultService() {
assertEquals(myListService.getHolidays()[0], myListServiceByYear.getHolidays(2007)[0]);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myListService = context.locateService(MyListService.class, "MyNewListService");
- myListServiceByYear = context.locateService(MyListServiceByYear.class, "MyNewListService");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentServiceReferenceTest.java Mon Feb 12 15:12:03 2007
@@ -20,16 +20,17 @@
import java.util.Date;
-import org.apache.tuscany.sca.test.spec.MyTotalService;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-import org.osoa.sca.RequestContext;
-
import junit.framework.TestCase;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Reference;
public class ComponentServiceReferenceTest extends TestCase {
- private MyTotalService myService;
- private CompositeContext context;
+ @Reference
+ public MyTotalService myService;
+
+ @Context
+ public ComponentContext context;
public void testDefaultProperty() {
assertEquals("NC", myService.getLocation());
@@ -43,40 +44,17 @@
}
- public void testContext() {
+ public void testMyServiceContext() {
assertNotNull("Service component name is null", myService.getComponentName());
assertNotNull("service context is null", myService.getContext());
System.out.println("Service component name :" + myService.getComponentName());
System.out.println("service context :" + myService.getContext());
- test(context);
-
}
- private void test(CompositeContext context) {
- assertNotNull("composite name is null", context.getName());
- assertNotNull("composite URI is null", context.getURI());
-
- System.out.println("composite name :" + context.getName());
- System.out.println("composite URI:" + context.getURI());
-
- if (context.getRequestContext() == null)
- System.out.println("Request context:" + context.getRequestContext());
- else
- display(context.getRequestContext());
- }
-
- private void display(RequestContext context) {
- System.out.println("\tService name:" + context.getServiceName());
- System.out.println("\tSecurity subject:" + context.getSecuritySubject());
- System.out.println("\tService reference:" + context.getServiceReference());
-
- }
+ public void testContext() {
+ assertNotNull("service context is null", context);
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService = context.locateService(MyTotalService.class, "MyTotalService");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/ComponentTest.java Mon Feb 12 15:12:03 2007
@@ -20,25 +20,23 @@
import java.util.Date;
-import org.apache.tuscany.sca.test.spec.MyListService;
-import org.apache.tuscany.sca.test.spec.MyListServiceByYear;
-import org.apache.tuscany.sca.test.spec.MyService;
-import org.apache.tuscany.sca.test.spec.MyServiceByDate;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.Reference;
import junit.framework.TestCase;
public class ComponentTest extends TestCase {
- private MyService myService;
- private MyServiceByDate myServiceByDate;
- private MyListService myListService;
- private MyListServiceByYear myListServiceByYear;
- private MyService myNCService;
- private MyListService myListServiceFor2006;
-
- private CompositeContext context;
+ @Reference
+ public MyService myService;
+ @Reference
+ public MyServiceByDate myServiceByDate;
+ @Reference
+ public MyListService myListService;
+ @Reference
+ public MyListServiceByYear myListServiceByYear;
+ @Reference
+ public MyService myNCService;
+ @Reference
+ public MyListService myListServiceFor2006;
public void testDefaultProperty() {
assertEquals("RTP", myService.getLocation());
@@ -69,39 +67,5 @@
System.out.println("Service component name :" + myService.getComponentName());
System.out.println("service context :" + myService.getContext());
-
- test(context);
-
- }
-
- private void test(CompositeContext context) {
- assertNotNull("composite name is null", context.getName());
- assertNotNull("composite URI is null", context.getURI());
-
- System.out.println("composite name :" + context.getName());
- System.out.println("composite URI:" + context.getURI());
-
- if (context.getRequestContext() == null)
- System.out.println("Request context:" + context.getRequestContext());
- else
- display(context.getRequestContext());
- }
-
- private void display(RequestContext context) {
- System.out.println("\tService name:" + context.getServiceName());
- System.out.println("\tSecurity subject:" + context.getSecuritySubject());
- System.out.println("\tService reference:" + context.getServiceReference());
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService = context.locateService(MyService.class, "MyService");
- myServiceByDate = context.locateService(MyServiceByDate.class, "MyServiceByDate");
- myListService = context.locateService(MyListService.class, "MyListService");
- myListServiceByYear = context.locateService(MyListServiceByYear.class, "MyListServiceByYear");
- myNCService = context.locateService(MyService.class, "MyNCService");
- myListServiceFor2006 = context.locateService(MyListService.class, "MyListServiceFor2006");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneService2LevelTest.java Mon Feb 12 15:12:03 2007
@@ -19,20 +19,19 @@
package org.apache.tuscany.sca.test.spec;
import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.test.spec.MyService;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.Reference;
public class CompositeOneService2LevelTest extends TestCase {
- private MyService myService;
- private MyService myServiceDefault;
- private MyService myServiceNo;
- private MyService myServiceMay;
- private MyService myServiceMust;
-
- private CompositeContext context;
+ @Reference
+ public MyService myService;
+ @Reference
+ public MyService myServiceDefault;
+ @Reference
+ public MyService myServiceNo;
+ @Reference
+ public MyService myServiceMay;
+ @Reference
+ public MyService myServiceMust;
public void testPropertyFromComponent() {
assertEquals("CARY", myService.getLocation());
@@ -86,38 +85,5 @@
System.out.println("Service component name :" + myService.getComponentName());
System.out.println("service context :" + myService.getContext());
-
- test(context);
-
- }
-
- private void test(CompositeContext context) {
- assertNotNull("composite name is null", context.getName());
- assertNotNull("composite URI is null", context.getURI());
-
- System.out.println("composite name :" + context.getName());
- System.out.println("composite URI:" + context.getURI());
-
- if (context.getRequestContext() == null)
- System.out.println("Request context:" + context.getRequestContext());
- else
- display(context.getRequestContext());
- }
-
- private void display(RequestContext context) {
- System.out.println("\tService name:" + context.getServiceName());
- System.out.println("\tSecurity subject:" + context.getSecuritySubject());
- System.out.println("\tService reference:" + context.getServiceReference());
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService = context.locateService(MyService.class, "MySimpleServiceInRecursiveComponent");
- myServiceDefault = context.locateService(MyService.class, "MySimpleServiceDefault");
- myServiceNo = context.locateService(MyService.class, "MySimpleServiceNo");
- myServiceMay = context.locateService(MyService.class, "MySimpleServiceMay");
- myServiceMust = context.locateService(MyService.class, "MySimpleServiceMust");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeOneServiceTest.java Mon Feb 12 15:12:03 2007
@@ -19,15 +19,11 @@
package org.apache.tuscany.sca.test.spec;
import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.test.spec.MyService;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.Reference;
public class CompositeOneServiceTest extends TestCase {
- private MyService myService;
- private CompositeContext context;
+ @Reference
+ public MyService myService;
public void testOverrideProperty() {
assertEquals("CARY", myService.getLocation());
@@ -45,34 +41,5 @@
System.out.println("Service component name :" + myService.getComponentName());
System.out.println("service context :" + myService.getContext());
-
- test(context);
-
- }
-
- private void test(CompositeContext context) {
- assertNotNull("composite name is null", context.getName());
- assertNotNull("composite URI is null", context.getURI());
-
- System.out.println("composite name :" + context.getName());
- System.out.println("composite URI:" + context.getURI());
-
- if (context.getRequestContext() == null)
- System.out.println("Request context:" + context.getRequestContext());
- else
- display(context.getRequestContext());
- }
-
- private void display(RequestContext context) {
- System.out.println("\tService name:" + context.getServiceName());
- System.out.println("\tSecurity subject:" + context.getSecuritySubject());
- System.out.println("\tService reference:" + context.getServiceReference());
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService = context.locateService(MyService.class, "MySimpleServiceInRecursive");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceForRefOverrideTest.java Mon Feb 12 15:12:03 2007
@@ -20,17 +20,16 @@
import java.util.Date;
-import org.apache.tuscany.sca.test.spec.MyTotalService;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-
import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
public class CompositeServiceReferenceForRefOverrideTest extends TestCase {
- private MyTotalService myService1;
- private MyTotalService myService2;
- private MyTotalService myService3;
- private CompositeContext context;
+ @Reference
+ public MyTotalService myService1;
+ @Reference
+ public MyTotalService myService2;
+ @Reference
+ public MyTotalService myService3;
public void testPropertyWithServiceFromReferenceNo() {
assertEquals("CARY", myService1.getLocation());
@@ -67,13 +66,5 @@
assertEquals(myService3.getHolidays()[0], myService3.getHolidays(2007)[0]);
assertNotSame(myService3.nextHoliday(), myService3.nextHoliday(new Date()));
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService1 = context.locateService(MyTotalService.class, "MyTotalServiceNo");
- myService2 = context.locateService(MyTotalService.class, "MyTotalServiceMay");
- myService3 = context.locateService(MyTotalService.class, "MyTotalServiceMust");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeServiceReferenceTest.java Mon Feb 12 15:12:03 2007
@@ -20,19 +20,20 @@
import java.util.Date;
-import org.apache.tuscany.sca.test.spec.MyTotalService;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-
import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
public class CompositeServiceReferenceTest extends TestCase {
- private MyTotalService myService1;
- private MyTotalService myService2;
- private MyTotalService myService3;
- private MyTotalService myService4;
- private MyTotalService myService5;
- private CompositeContext context;
+ @Reference
+ public MyTotalService myService1;
+ @Reference
+ public MyTotalService myService2;
+ @Reference
+ public MyTotalService myService3;
+ @Reference
+ public MyTotalService myService4;
+ @Reference
+ public MyTotalService myService5;
public void testPropertyWithServiceFromRecursive() {
assertEquals("CARY", myService1.getLocation());
@@ -76,16 +77,5 @@
public void testServiceReferenceFromComponentUseService() {
assertNotSame(myService5.nextHoliday(), myService5.nextHoliday(new Date()));
assertEquals(myService5.getHolidays()[0], myService5.getHolidays(2007)[0]);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService1 = context.locateService(MyTotalService.class, "MyTotalServiceFromRecursive");
- myService2 = context.locateService(MyTotalService.class, "MyTotalServiceInCompositeWithRecursive");
- myService3 = context.locateService(MyTotalService.class, "MyTotalServiceInCompositeWithComponentService");
- myService4 = context.locateService(MyTotalService.class, "MyTotalServiceInCompositeWithRecursiveUseService");
- myService5 =
- context.locateService(MyTotalService.class, "MyTotalServiceInCompositeWithComponentServiceUseService");
}
}
Modified: incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java?view=diff&rev=506739&r1=506723&r2=506739
==============================================================================
--- incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java (original)
+++ incubator/tuscany/java/sca/integration-test/specTest/src/test/java/org/apache/tuscany/sca/test/spec/CompositeTest.java Mon Feb 12 15:12:03 2007
@@ -20,23 +20,18 @@
import java.util.Date;
-import org.apache.tuscany.sca.test.spec.MyListService;
-import org.apache.tuscany.sca.test.spec.MyListServiceByYear;
-import org.apache.tuscany.sca.test.spec.MyService;
-import org.apache.tuscany.sca.test.spec.MyServiceByDate;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
-import org.osoa.sca.RequestContext;
-
import junit.framework.TestCase;
+import org.osoa.sca.annotations.Reference;
public class CompositeTest extends TestCase {
- private MyService myService;
- private MyServiceByDate myServiceByDate;
- private MyListService myListService;
- private MyListServiceByYear myListServiceByYear;
-
- private CompositeContext context;
+ @Reference
+ public MyService myService;
+ @Reference
+ public MyServiceByDate myServiceByDate;
+ @Reference
+ public MyListService myListService;
+ @Reference
+ public MyListServiceByYear myListServiceByYear;
public void testOverrideProperty() {
assertEquals("CARY", myService.getLocation());
@@ -56,38 +51,5 @@
System.out.println("Service component name :" + myService.getComponentName());
System.out.println("service context :" + myService.getContext());
-
- test(context);
-
- }
-
- private void test(CompositeContext context) {
- assertNotNull("composite name is null", context.getName());
- assertNotNull("composite URI is null", context.getURI());
-
- System.out.println("composite name :" + context.getName());
- System.out.println("composite URI:" + context.getURI());
-
- if (context.getRequestContext() == null)
- System.out.println("Request context:" + context.getRequestContext());
- else
- display(context.getRequestContext());
- }
-
- private void display(RequestContext context) {
- System.out.println("\tService name:" + context.getServiceName());
- System.out.println("\tSecurity subject:" + context.getSecuritySubject());
- System.out.println("\tService reference:" + context.getServiceReference());
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- context = CurrentCompositeContext.getContext();
- myService = context.locateService(MyService.class, "MyServiceInRecursiveMyService");
- myServiceByDate = context.locateService(MyServiceByDate.class, "MyServiceInRecursiveMyServiceByDate");
- myListService = context.locateService(MyListService.class, "MyServiceInRecursiveMyListService");
- myListServiceByYear =
- context.locateService(MyListServiceByYear.class, "MyServiceInRecursiveMyListServiceByYear");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org