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/15 17:51:17 UTC
svn commit: r648293 - in
/incubator/tuscany/java/sca/vtest/java-api/annotations: ./ scope/
scope/src/ scope/src/main/ scope/src/main/java/ scope/src/main/java/org/
scope/src/main/java/org/apache/ scope/src/main/java/org/apache/tuscany/
scope/src/main/j...
Author: kwilliams
Date: Tue Apr 15 08:50:58 2008
New Revision: 648293
URL: http://svn.apache.org/viewvc?rev=648293&view=rev
Log:
Committing Gilbert's @Scope vTests for TUSCANY-2221
Added:
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/
incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java (with props)
Modified:
incubator/tuscany/java/sca/vtest/java-api/annotations/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=648293&r1=648292&r2=648293&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/pom.xml Tue Apr 15 08:50:58 2008
@@ -56,6 +56,7 @@
<module>reference</module>
<module>service</module>
<module>property</module>
+ <module>scope</module>
<module>oneway</module>
<module>conversational</module>
</modules>
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml Tue Apr 15 08:50:58 2008
@@ -0,0 +1,46 @@
+<?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-annotations</artifactId>
+ <version>2.0-incubating-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>vtest-java-api-annotations-scope</artifactId>
+ <name>Apache Tuscany SCA Java APIs and Annoations Verification Tests - Annotations - @Scope</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/annotations/scope/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java Tue Apr 15 08:50:58 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.annotations.scope;
+
+
+/**
+ * Simple Service
+ */
+public interface AService {
+
+ public String getName();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/AService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,40 @@
+/*
+ * 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.annotations.scope;
+
+/**
+ * Simple Service
+ */
+public interface BService {
+
+ public String getName();
+
+ public boolean isInitReady();
+
+ public String getCurrentState();
+
+ public String setCurrentState(String currentState);
+
+ public int getDestroyCalledCounter();
+
+ public int getInitCalledCounter();
+
+ public int getInstanceCounter();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/BService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,40 @@
+/*
+ * 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.annotations.scope;
+
+/**
+ * Simple Service
+ */
+public interface CService {
+
+ public String getName();
+
+ public boolean isInitReady();
+
+ public String getCurrentState();
+
+ public String setCurrentState(String currentState);
+
+ public int getDestroyCalledCounter();
+
+ public int getInitCalledCounter();
+
+ public int getInstanceCounter();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/CService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.annotations.scope;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Service
+ */
+@Remotable
+public interface DService {
+
+ public String getName();
+
+ public boolean isInitReady();
+
+ public String getCurrentState();
+
+ public String setCurrentState(String currentState);
+
+ public int getDestroyCalledCounter();
+
+ public int getInitCalledCounter();
+
+ public int getInstanceCounter();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/DService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.annotations.scope;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Service
+ */
+@Remotable
+public interface FService {
+
+ public String getName();
+
+ public boolean isInitReady();
+
+ public String getCurrentState();
+
+ public String setCurrentState(String currentState);
+
+ public int getDestroyCalledCounter();
+
+ public int getInitCalledCounter();
+
+ public int getInstanceCounter();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/FService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.annotations.scope;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Service
+ */
+@Remotable
+public interface GService {
+
+ public String getName();
+
+ public int getInitCalledCounter();
+
+ public int getDestroyCalledCounter();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/GService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,36 @@
+/*
+ * 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.annotations.scope;
+
+import org.osoa.sca.annotations.Remotable;
+
+
+/**
+ * Simple Service
+ */
+@Remotable
+public interface HService {
+
+ public String getName();
+
+ public String test();
+
+ public String testCounters(int n);
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/HService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,48 @@
+/*
+ * 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.annotations.scope;
+
+import org.osoa.sca.annotations.Conversational;
+import org.osoa.sca.annotations.EndsConversation;
+
+/**
+ * Simple Service
+ */
+@Conversational
+public interface IService {
+
+ public String getName();
+
+ public boolean isInitReady();
+
+ public String getCurrentState();
+
+ public String getConversationId();
+
+ public String setCurrentState(String currentState);
+
+ public int getDestroyCalledCounter();
+
+ public int getInitCalledCounter();
+
+ public int getInstanceCounter();
+
+ @EndsConversation
+ public void endConversation();
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/IService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java Tue Apr 15 08:50:58 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.osoa.sca.annotations.Service;
+
+@Service(AService.class)
+public class AServiceImpl implements AService {
+
+ public String getName() {
+ return "AService";
+ }
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/AServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,112 @@
+/*
+ * 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.BService;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Destroy;
+
+@Service(BService.class)
+public class BServiceImpl implements BService {
+
+ private static int instanceCounter = 0;
+
+ private static int initCalledCounter = 0;
+
+ private static int destroyCalledCounter = 0;
+
+ public AService a1;
+
+ public String p1;
+
+ private int currentInstanceId = 0;
+
+ public String currentState = null;
+
+ private boolean isInitReady = false;
+
+ public BServiceImpl() {
+ currentInstanceId = ++instanceCounter;
+ isInitReady = false;
+ }
+
+ @Reference
+ public void setA1(AService a1) {
+ this.a1 = a1;
+ }
+
+ @Property
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+
+ @Init
+ public void initBService() throws Exception {
+ initCalledCounter++;
+ if (p1.equals("p1") && a1.getName().equals("AService"))
+ isInitReady = true;
+ }
+
+ @Destroy
+ public void destroyBService() {
+ destroyCalledCounter++;
+ }
+
+ public String getName() {
+ return "BService" + currentInstanceId;
+ }
+
+ public AService getA1() {
+ return a1;
+ }
+
+ public String getP1() {
+ return p1;
+ }
+
+ public String getCurrentState() {
+ return currentState;
+ }
+
+ public String setCurrentState(String currentState) {
+ this.currentState = currentState;
+ return this.currentState;
+ }
+
+ public boolean isInitReady() {
+ return isInitReady;
+ }
+
+ public int getDestroyCalledCounter() {
+ return destroyCalledCounter;
+ }
+
+ public int getInitCalledCounter() {
+ return initCalledCounter;
+ }
+
+ public int getInstanceCounter() {
+ return instanceCounter;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/BServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,114 @@
+/*
+ * 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.CService;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Scope;
+
+@Service(CService.class)
+@Scope("STATELESS")
+public class CServiceImpl implements CService {
+
+ public static int instanceCounter = 0;
+
+ public static int initCalledCounter = 0;
+
+ public static int destroyCalledCounter = 0;
+
+ public AService a1;
+
+ public String p1;
+
+ public int currentInstanceId = 0;
+
+ public String currentState = null;
+
+ public boolean isInitReady = false;
+
+ public CServiceImpl() {
+ currentInstanceId = ++instanceCounter;
+ isInitReady = false;
+ }
+
+ @Reference
+ public void setA1(AService a1) {
+ this.a1 = a1;
+ }
+
+ @Property
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+
+ @Init
+ public void initCService() throws Exception {
+ initCalledCounter++;
+ if (p1.equals("p1") && a1.getName().equals("AService"))
+ isInitReady = true;
+ }
+
+ @Destroy
+ public void destroyCService() {
+ destroyCalledCounter++;
+ }
+
+ public String getName() {
+ return "CService" + currentInstanceId;
+ }
+
+ public AService getA1() {
+ return a1;
+ }
+
+ public String getP1() {
+ return p1;
+ }
+
+ public String getCurrentState() {
+ return currentState;
+ }
+
+ public String setCurrentState(String currentState) {
+ this.currentState = currentState;
+ return this.currentState;
+ }
+
+ public boolean isInitReady() {
+ return isInitReady;
+ }
+
+ public int getDestroyCalledCounter() {
+ return destroyCalledCounter;
+ }
+
+ public int getInitCalledCounter() {
+ return initCalledCounter;
+ }
+
+ public int getInstanceCounter() {
+ return instanceCounter;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/CServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,116 @@
+/*
+ * 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.DService;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Scope;
+
+@Service(DService.class)
+@Scope("REQUEST")
+public class DServiceImpl implements DService {
+
+ public static int instanceCounter = 0;
+
+ public static int initCalledCounter = 0;
+
+ public static int destroyCalledCounter = 0;
+
+ public AService a1;
+
+ public String p1;
+
+ public int currentInstanceId = 0;
+
+ public String currentState = null;
+
+ public boolean isInitReady = false;
+
+ public DServiceImpl() {
+ currentInstanceId = ++instanceCounter;
+ isInitReady = false;
+ }
+
+ @Reference
+ public void setA1(AService a1) {
+ this.a1 = a1;
+ }
+
+ @Property
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+
+ @Init
+ public void initDService() throws Exception {
+ initCalledCounter++;
+ if (p1.equals("p1") && a1.getName().equals("AService"))
+ isInitReady = true;
+ System.out.println("DService" + currentInstanceId + "->initDService");
+ }
+
+ @Destroy
+ public void destroyDService() {
+ destroyCalledCounter++;
+ System.out.println("DService" + currentInstanceId + "->destroyDService");
+ }
+
+ public String getName() {
+ return "DService" + currentInstanceId;
+ }
+
+ public AService getA1() {
+ return a1;
+ }
+
+ public String getP1() {
+ return p1;
+ }
+
+ public String getCurrentState() {
+ return currentState;
+ }
+
+ public String setCurrentState(String currentState) {
+ this.currentState = "DService" + currentInstanceId + "-" + currentState;
+ return this.currentState;
+ }
+
+ public boolean isInitReady() {
+ return isInitReady;
+ }
+
+ public int getDestroyCalledCounter() {
+ return destroyCalledCounter;
+ }
+
+ public int getInitCalledCounter() {
+ return initCalledCounter;
+ }
+
+ public int getInstanceCounter() {
+ return instanceCounter;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/DServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,116 @@
+/*
+ * 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.FService;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Scope;
+
+@Service(FService.class)
+@Scope("COMPOSITE")
+public class FServiceImpl implements FService {
+
+ public static int instanceCounter = 0;
+
+ public static int initCalledCounter = 0;
+
+ public static int destroyCalledCounter = 0;
+
+ public AService a1;
+
+ public String p1;
+
+ public int currentInstanceId = 0;
+
+ public String currentState = null;
+
+ public boolean isInitReady = false;
+
+ public FServiceImpl() {
+ currentInstanceId = ++instanceCounter;
+ isInitReady = false;
+ }
+
+ @Reference
+ public void setA1(AService a1) {
+ this.a1 = a1;
+ }
+
+ @Property
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+
+ @Init
+ public void initFService() throws Exception {
+ initCalledCounter++;
+ if (p1.equals("p1") && a1.getName().equals("AService"))
+ isInitReady = true;
+ System.out.println("FService" + currentInstanceId + "->initFService");
+ }
+
+ @Destroy
+ public void destroyFService() {
+ destroyCalledCounter++;
+ System.out.println("FService" + currentInstanceId + "->destroyFService");
+ }
+
+ public String getName() {
+ return "FService" + currentInstanceId;
+ }
+
+ public AService getA1() {
+ return a1;
+ }
+
+ public String getP1() {
+ return p1;
+ }
+
+ public String getCurrentState() {
+ return currentState;
+ }
+
+ public String setCurrentState(String currentState) {
+ this.currentState = "FService" + currentInstanceId + "-" + currentState;
+ return this.currentState;
+ }
+
+ public boolean isInitReady() {
+ return isInitReady;
+ }
+
+ public int getDestroyCalledCounter() {
+ return destroyCalledCounter;
+ }
+
+ public int getInitCalledCounter() {
+ return initCalledCounter;
+ }
+
+ public int getInstanceCounter() {
+ return instanceCounter;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/FServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,57 @@
+package org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.GService;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.EagerInit;
+
+@Scope("COMPOSITE")
+@EagerInit
+public class GServiceImpl implements GService {
+
+ public static int initCalledCounter = 0;
+
+ public static int destroyCalledCounter = 0;
+
+ public AService a1;
+
+ public String p1;
+
+ @Init
+ public void initGService() throws Exception {
+ initCalledCounter++;
+ System.out.println("GService->initGService");
+ }
+
+ @Destroy
+ public void destroyGService() {
+ destroyCalledCounter++;
+ System.out.println("GService->destroyGService");
+ }
+
+ @Reference
+ public void setA1(AService a1) {
+ this.a1 = a1;
+ }
+
+ @Property
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+
+ public String getName() {
+ return "GService";
+ }
+
+ public int getInitCalledCounter() {
+ return initCalledCounter;
+ }
+
+ public int getDestroyCalledCounter() {
+ return destroyCalledCounter;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/GServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,86 @@
+/*
+ * 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.IService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.HService;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(HService.class)
+public class HServiceImpl implements HService {
+
+ @Reference
+ public IService i1;
+
+ public String getName() {
+ return "HService";
+ }
+
+ public String test() {
+
+ String serviceName = i1.getName();
+ String conversationIdBefore = i1.getConversationId();
+
+ for (int i = 0; i < 10; i++) {
+ String newState = "state-" + i;
+ i1.setCurrentState(newState);
+ String currentState = i1.getCurrentState();
+ if (currentState == null || !currentState.equals(serviceName + "-" + newState)) {
+ i1.endConversation();
+ return "CurrentStateLost - " + currentState;
+ }
+ }
+
+ boolean isInitReady = i1.isInitReady();
+
+ String conversationIdAfter = i1.getConversationId();
+
+ i1.endConversation();
+
+ if (!isInitReady)
+ return "InitNotReady";
+
+ if (!conversationIdBefore.equals(conversationIdAfter))
+ return "DifferentConversationId";
+
+ return "None";
+ }
+
+ public String testCounters(int n) {
+ int instanceCounter = i1.getInstanceCounter();
+ int initCalledCounter = i1.getInitCalledCounter();
+ int destroyCalledCounter = i1.getDestroyCalledCounter();
+
+ System.out.println("instanceCounter=" + instanceCounter);
+ System.out.println("initCalledCounter=" + initCalledCounter);
+ System.out.println("destroyCalledCounter=" + destroyCalledCounter);
+
+ if (instanceCounter != n + 1)
+ return "IncorrectInstanceCounter";
+ if (initCalledCounter != n + 1)
+ return "IncorrectInitCalledCounter";
+ if (destroyCalledCounter != n)
+ return "IncorrectDestroyCalledCounter";
+
+ return "None";
+ }
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/HServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,129 @@
+/*
+ * 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.annotations.scope.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.IService;
+import org.osoa.sca.annotations.ConversationID;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Scope;
+
+@Service(IService.class)
+@Scope("CONVERSATION")
+public class IServiceImpl implements IService {
+
+ public static int instanceCounter = 0;
+
+ public static int initCalledCounter = 0;
+
+ public static int destroyCalledCounter = 0;
+
+ @ConversationID
+ protected String conversationId;
+
+ public int currentInstanceId = 0;
+
+ public AService a1;
+
+ public String p1;
+
+ public String currentState = null;
+
+ public boolean isInitReady = false;
+
+ public IServiceImpl() {
+ currentInstanceId = ++instanceCounter;
+ isInitReady = false;
+ }
+
+ @Reference
+ public void setA1(AService a1) {
+ this.a1 = a1;
+ }
+
+ @Property
+ public void setP1(String p1) {
+ this.p1 = p1;
+ }
+
+ @Init
+ public void initIService() throws Exception {
+ initCalledCounter++;
+ if (p1.equals("p1") && a1.getName().equals("AService"))
+ isInitReady = true;
+ System.out.println("IService" + currentInstanceId + "->initIService");
+ }
+
+ @Destroy
+ public void destroyIService() {
+ destroyCalledCounter++;
+ System.out.println("IService" + currentInstanceId + "->destroyIService");
+ }
+
+ public void endConversation() {
+ System.out.println("IService" + currentInstanceId + "->endConversation");
+ }
+
+ public String getName() {
+ return "IService" + currentInstanceId;
+ }
+
+ public AService getA1() {
+ return a1;
+ }
+
+ public String getP1() {
+ return p1;
+ }
+
+ public String getCurrentState() {
+ return currentState;
+ }
+
+ public String getConversationId() {
+ return conversationId;
+ }
+
+ public String setCurrentState(String currentState) {
+ this.currentState = "IService" + currentInstanceId + "-" + currentState;
+ return this.currentState;
+ }
+
+ public boolean isInitReady() {
+ return isInitReady;
+ }
+
+ public int getDestroyCalledCounter() {
+ return destroyCalledCounter;
+ }
+
+ public int getInitCalledCounter() {
+ return initCalledCounter;
+ }
+
+ public int getInstanceCounter() {
+ return instanceCounter;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/impl/IServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite Tue Apr 15 08:50:58 2008
@@ -0,0 +1,76 @@
+<?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="Scope-Composite">
+
+ <component name="AComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.AServiceImpl" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.BServiceImpl" />
+ <reference name="a1" target="AComponent"/>
+ <property name="p1">p1</property>
+ </component>
+
+ <component name="CComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.CServiceImpl" />
+ <reference name="a1" target="AComponent"/>
+ <property name="p1">p1</property>
+ </component>
+
+ <component name="DComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.DServiceImpl" />
+ <reference name="a1" target="AComponent"/>
+ <property name="p1">p1</property>
+ </component>
+
+ <component name="FComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.FServiceImpl" />
+ <reference name="a1" target="AComponent"/>
+ <property name="p1">p1</property>
+ </component>
+
+ <component name="GComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.GServiceImpl" />
+ <reference name="a1" target="AComponent"/>
+ <property name="p1">p1</property>
+ </component>
+
+ <component name="HComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.HServiceImpl" />
+ <reference name="i1" target="IComponent"/>
+ </component>
+
+ <component name="IComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.scope.impl.IServiceImpl" />
+ <reference name="a1" target="AComponent"/>
+ <property name="p1">p1</property>
+ </component>
+
+</composite>
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/main/resources/scope.composite
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java?rev=648293&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java Tue Apr 15 08:50:58 2008
@@ -0,0 +1,438 @@
+/*
+ * 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.annotations.scope;
+
+import java.util.ArrayList;
+
+import junit.framework.Assert;
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.CService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.DService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.FService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.GService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.scope.HService;
+import org.junit.Test;
+
+/**
+ * This test class tests the Scope annotation described in section 1.2.4
+ * including 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, and 1.8.16<br>
+ * <p>
+ * Check following:<br>
+ * <li>Number of service instances be created</li>
+ * <li>Init method be called and where all property and reference injection is
+ * complete.</li>
+ * <li>Destroy method be called</li>
+ * <li>State be preserved in request and conversation scopes but not others</li>
+ */
+public class ScopeAnnotationTestCase {
+
+ protected static SCADomain domain;
+ protected static String compositeName = "scope.composite";
+
+ protected static int numDThread = 5;
+ protected static int numFThread = 5;
+ protected static int numHThread = 5;
+
+ /**
+ * Line 259:<br>
+ * <li>STATELESS</li>
+ * <p>
+ * Line 284:<br>
+ * For stateless components, there is no implied correlation between
+ * service requests.<br>
+ * <p>
+ * Line 1589 to 1591:<br>
+ * The default value is 'STATELESS'. For 'STATELESS' implementations,
+ * a different implementation instance may be used to service each request.
+ * Implementation instances may be newly created or be drawn from a pool
+ * of instances.<br>
+ * <p>
+ * BComponent is not defined '@Scope'<br>
+ * CComponent is defined '@Scope("STATELESS")'<br>
+ * <p>
+ */
+ @Test
+ public void atScope1() throws Exception {
+ System.out.println("atScope1 - Setting up");
+ domain = SCADomain.newInstance(compositeName);
+ BThread b1 = new BThread("ThreadB1");
+ BThread b2 = new BThread("ThreadB2");
+ CThread c1 = new CThread("ThreadC1");
+ CThread c2 = new CThread("ThreadC2");
+ b1.start();
+ b2.start();
+ c1.start();
+ c2.start();
+ b1.join();
+ b2.join();
+ c1.join();
+ c2.join();
+ System.out.println("atScope1 - Cleaning up");
+ if (domain != null)
+ domain.close();
+ Assert.assertEquals("None", b1.failedReason);
+ Assert.assertEquals("None", b2.failedReason);
+ Assert.assertEquals("None", c1.failedReason);
+ Assert.assertEquals("None", c2.failedReason);
+ System.out.println("");
+ }
+
+ /**
+ * Line 260:<br>
+ * <li>REQUEST</li>
+ * <p>
+ * Lines 286 to 289:<br>
+ * The lifecycle of request scope extends from the point a request on a
+ * remotable interface enters the SCA runtime and a thread processes that
+ * request until the thread completes synchronously processing the request.
+ * During that time, all service requests will be delegated to the same
+ * implementation instance of a request-scoped component.<br>
+ * <p>
+ * Lines 290 to 293:<br>
+ * There are times when a local request scoped service is called without
+ * there being a remotable service earlier in the call stack, such as when
+ * a local service is called from a non-SCA entity. In these cases, a
+ * remote request is always considered to be present, but the lifetime of
+ * the request is implementation dependent. For example, a timer event
+ * could be treated as a remote request..<br>
+ * <p>
+ * @TODO - Need to find out how to test lines 290 to 293
+ * - Need to find out when destroy method be called
+ */
+ @Test
+ public void atScope2() throws Exception {
+ System.out.println("atScope2 - Setting up");
+ domain = SCADomain.newInstance(compositeName);
+ ArrayList<DThread> d = new ArrayList<DThread>();
+ for (int i = 0; i < numDThread; i++)
+ d.add(new DThread("ThreadD"+i));
+ for (int i = 0; i < numDThread; i++)
+ d.get(i).start();
+ for (int i = 0; i < numDThread; i++)
+ d.get(i).join();
+ System.out.println("atScope2 - Cleaning up");
+ if (domain != null)
+ domain.close();
+ for (int i = 0; i < numDThread; i++)
+ Assert.assertEquals("None", d.get(i).failedReason);
+ System.out.println("");
+ }
+
+ /**
+ * Line 262:<br>
+ * <li>COMPOSITE</li>
+ * <p>
+ * Lines 296 to 298:<br>
+ * All service requests are dispatched to the same implementation instance
+ * for the lifetime of the containing composite. The lifetime of the
+ * containing composite is defined as the time it becomes active in the
+ * runtime to the time it is deactivated, either normally or abnormally.<br>
+ * <p>
+ * Following lines should be found at System out<br>
+ * atScope3 - Cleaning up<br>
+ * FService1->destroyFService
+ */
+ @Test
+ public void atScope3() throws Exception {
+ System.out.println("atScope3 - Setting up");
+ domain = SCADomain.newInstance(compositeName);
+ FService fService = domain.getService(FService.class, "FComponent");
+ String serviceName = fService.getName();
+ boolean isInitReady = fService.isInitReady();
+
+ ArrayList<FThread> f = new ArrayList<FThread>();
+ for (int i = 0; i < numFThread; i++)
+ f.add(new FThread("ThreadF"+i));
+ for (int i = 0; i < numFThread; i++)
+ f.get(i).start();
+ for (int i = 0; i < numFThread; i++)
+ f.get(i).join();
+ for (int i = 0; i < numFThread; i++) {
+ Assert.assertEquals(serviceName, f.get(i).serviceName);
+ }
+
+ int instanceCounter = fService.getInstanceCounter();
+ int initCalledCounter = fService.getInitCalledCounter();
+
+ System.out.println("atScope3 - Cleaning up");
+ if (domain != null)
+ domain.close();
+
+ Assert.assertTrue(isInitReady);
+ Assert.assertEquals(1, instanceCounter);
+ Assert.assertEquals(1, initCalledCounter);
+ System.out.println("");
+ }
+
+ /**
+ * Lines 299 to 302:<br>
+ * A composite scoped implementation may also specify eager initialization
+ * using the "@EagerInit" annotation. When marked for eager initialization,
+ * the composite scoped instance will be created when its containing
+ * component is started. If a method is marked with the "@Init" annotation,
+ * it will be called when the instance is created.<p>
+ * Section 1.8.9 "@EagerInit"<br>
+ * <p>
+ * GService is defined as eager initialization. It will be initialized
+ * when everytime calls SCADomain.newInstance(compositeName), so the
+ * initCalledCounter is greater than 1.
+ */
+ @Test
+ public void atScope4() throws Exception {
+ System.out.println("atScope4 - Setting up");
+ domain = SCADomain.newInstance(compositeName);
+ GService gService = domain.getService(GService.class, "GComponent");
+ int initCalledCounter = gService.getInitCalledCounter();
+ int destroyCalledCounter = gService.getDestroyCalledCounter();
+
+ System.out.println("atScope4 - Cleaning up");
+ if (domain != null)
+ domain.close();
+
+ Assert.assertTrue(initCalledCounter > 1);
+ Assert.assertTrue(destroyCalledCounter > 1);
+ System.out.println("");
+ }
+
+ /**
+ * Line 261:<br>
+ * <li>CONVERSATION</li>
+ * <p>
+ * Lines 305 to 310:<br>
+ * A conversation is defined as a series of correlated interactions between
+ * a client and a target service. A conversational scope starts when the
+ * first service request is dispatched to an implementation instance
+ * offering a conversational service. A conversational scope completes
+ * after an end operation defined by the service contract is called and
+ * completes processing or the conversation expires. A conversation may be
+ * long-running and the SCA runtime may choose to passivate implementation
+ * instances. If this occurs, the runtime must guarantee implementation
+ * instance state is preserved.
+ */
+ @Test
+ public void atScope5() throws Exception {
+ System.out.println("atScope5 - Setting up");
+ domain = SCADomain.newInstance(compositeName);
+ ArrayList<HThread> g = new ArrayList<HThread>();
+ for (int i = 0; i < numHThread; i++)
+ g.add(new HThread("ThreadH"+i));
+ for (int i = 0; i < numHThread; i++)
+ g.get(i).start();
+ for (int i = 0; i < numHThread; i++)
+ g.get(i).join();
+
+ HService hService = domain.getService(HService.class, "HComponent");
+ String failedReason = hService.testCounters(numHThread);
+
+ System.out.println("atScope5 - Cleaning up");
+ if (domain != null)
+ domain.close();
+
+ for (int i = 0; i < numHThread; i++)
+ Assert.assertEquals("None", g.get(i).failedReason);
+ Assert.assertEquals("None", failedReason);
+
+ System.out.println("");
+ }
+
+ private class BThread extends Thread {
+ private String name = null;
+ public String failedReason = "Unknown";
+
+ public BThread(String name) {
+ super();
+ this.name = name;
+ failedReason = "Unknown";
+ }
+
+ @Override
+ public void run() {
+ BService bService = domain.getService(BService.class, "BComponent");
+ bService.setCurrentState(name + "-state-1");
+ System.out.println(name + "->" + bService.getName());
+ if (!bService.isInitReady()) {
+ failedReason = "InitNotReady";
+ return;
+ }
+ if (bService.getCurrentState() != null) {
+ failedReason = "CurrentStateNotNull";
+ return;
+ }
+ int counter = bService.getInstanceCounter();
+ if (counter < 2) {
+ failedReason = "OnlyOneInstance - " + counter;
+ return;
+ }
+ counter = bService.getInitCalledCounter();
+ if (counter < 2) {
+ failedReason = "InitBeCalledOnce - " + counter;
+ return;
+ }
+ counter = bService.getDestroyCalledCounter();
+ if (counter < 2) {
+ failedReason = "DestroyBeCalledOnce - " + counter;
+ return;
+ }
+ failedReason = "None";
+ }
+ }
+
+ private class CThread extends Thread {
+ private String name = null;
+ public String failedReason = "Unknown";
+
+ public CThread(String name) {
+ super();
+ this.name = name;
+ failedReason = "Unknown";
+ }
+
+ @Override
+ public void run() {
+ CService cService = domain.getService(CService.class, "CComponent");
+ cService.setCurrentState(name + "-state-1");
+ System.out.println(name + "->" + cService.getName());
+ if (!cService.isInitReady()) {
+ failedReason = "InitNotReady";
+ return;
+ }
+ if (cService.getCurrentState() != null) {
+ failedReason = "CurrentStateNotNull";
+ return;
+ }
+ int counter = cService.getInstanceCounter();
+ if (counter < 2) {
+ failedReason = "OnlyOneInstance - " + counter;
+ return;
+ }
+ counter = cService.getInitCalledCounter();
+ if (counter < 2) {
+ failedReason = "InitBeCalledOnce - " + counter;
+ return;
+ }
+ counter = cService.getDestroyCalledCounter();
+ if (counter < 2) {
+ failedReason = "DestroyBeCalledOnce - " + counter;
+ return;
+ }
+ failedReason = "None";
+ }
+ }
+
+ private class DThread extends Thread {
+
+ private String name = null;
+ public String failedReason = "Unknown";
+
+ public DThread(String name) {
+ super();
+ this.name = name;
+ failedReason = "Unknown";
+ }
+
+ @Override
+ public void run() {
+ DService dService = domain.getService(DService.class, "DComponent");
+ String serviceName = dService.getName();
+ System.out.println(name + "->" + serviceName);
+
+ for (int i = 0; i < 10; i++) {
+ String newState = name + "-state-" + i;
+ dService.setCurrentState(newState);
+ String currentState = dService.getCurrentState();
+ if (!currentState.equals(serviceName + "-" + newState)) {
+ failedReason = "CurrentStateLost - " + currentState;
+ return;
+ }
+ }
+
+ if (!dService.isInitReady()) {
+ failedReason = "InitNotReady";
+ return;
+ }
+
+ int counter = dService.getInstanceCounter();
+ if (counter > numDThread) {
+ failedReason = "TooMuchInstance - " + counter;
+ return;
+ }
+
+ counter = dService.getInitCalledCounter();
+ if (counter > numDThread) {
+ failedReason = "InitBeCalledTooMuch - " + counter;
+ return;
+ }
+
+ // JIRA T-2215
+ /* Don't know when destroy method be called
+ counter = dService.getDestroyCalledCounter();
+ if (counter > numDThreads) {
+ failedReason = "DestroyBeCalledTooMuch - " + counter;
+ return;
+ }
+ */
+ failedReason = "None";
+ }
+ }
+
+ private class FThread extends Thread {
+
+ private String name = null;
+
+ public String serviceName = null;
+
+ public FThread(String name) {
+ super();
+ this.name = name;
+ }
+
+ @Override
+ public void run() {
+ FService fService = domain.getService(FService.class, "FComponent");
+ serviceName = fService.getName();
+ System.out.println(name + "->" + serviceName);
+
+ for (int i = 0; i < 10; i++) {
+ String newState = name + "-state-" + i;
+ fService.setCurrentState(newState);
+ fService.getCurrentState();
+ }
+ }
+ }
+
+ private class HThread extends Thread {
+
+ public String failedReason = "Unknown";
+
+ public HThread(String name) {
+ super();
+ failedReason = "Unknown";
+ }
+
+ @Override
+ public void run() {
+ HService hService = domain.getService(HService.class, "HComponent");
+ failedReason = hService.test();
+ }
+ }
+
+}
+
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/scope/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/scope/ScopeAnnotationTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org