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/16 18:30:15 UTC
svn commit: r648741 - in
/incubator/tuscany/java/sca/vtest/java-api/annotations:
property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/
property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/
pr...
Author: kwilliams
Date: Wed Apr 16 09:30:09 2008
New Revision: 648741
URL: http://svn.apache.org/viewvc?rev=648741&view=rev
Log:
Applying Gilbert's patch for TUSCANY-2234
Added:
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java (with props)
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java (with props)
Modified:
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/resources/property.composite
incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite
incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java Wed Apr 16 09:30:09 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.property;
+
+import org.osoa.sca.annotations.Remotable;
+
+
+/**
+ * Simple Service used by another service
+ */
+@Remotable
+public interface BService {
+
+ String getName();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
+
+
+/**
+ * Simple Service used by another service
+ */
+public interface CService {
+
+ String getName();
+
+ public String getB1Name();
+
+ public String getP2();
+
+ public int getP3();
+
+ public String getP4();
+
+ public String getConstructor();
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java Wed Apr 16 09:30:09 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.osoa.sca.annotations.Service;
+
+@Service(BService.class)
+public class BServiceImpl implements BService {
+
+ public String getName() {
+ return "BService";
+ }
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,87 @@
+/*
+ * 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CService.class)
+public class CServiceImpl1 implements CService {
+
+ public BService b1;
+
+ public String p2;
+
+ public int p3;
+
+ public String p4;
+
+ public String constructor;
+
+ @Constructor
+ public CServiceImpl1() {
+ constructor = "NoArgument";
+ }
+
+ public CServiceImpl1(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4) {
+ this.b1 = b1;
+ this.p2 = p2;
+ this.p3 = p3;
+ this.p4 = p4;
+ constructor = "AllArguments";
+ }
+
+ public CServiceImpl1(BService bOne, String pTwo, int pThree) {
+ this.b1 = bOne;
+ this.p2 = pTwo;
+ this.p3 = pThree;
+ constructor = "LessArguments";
+ }
+
+ public String getName() {
+ return "BService";
+ }
+
+ public String getB1Name() {
+ if (b1 == null)
+ return null;
+ return b1.getName();
+ }
+
+ public String getP2() {
+ return p2;
+ }
+
+ public int getP3() {
+ return p3;
+ }
+
+ public String getConstructor() {
+ return constructor;
+ }
+
+ public String getP4() {
+ return p4;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,87 @@
+/*
+ * 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CService.class)
+public class CServiceImpl2 implements CService {
+
+ public BService b1;
+
+ public String p2;
+
+ public int p3;
+
+ public String p4;
+
+ public String constructor;
+
+ public CServiceImpl2() {
+ constructor = "NoArgument";
+ }
+
+ @Constructor()
+ public CServiceImpl2(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4) {
+ this.b1 = b1;
+ this.p2 = p2;
+ this.p3 = p3;
+ this.p4 = p4;
+ constructor = "AllArguments";
+ }
+
+ public CServiceImpl2(BService bOne, String pTwo, int pThree) {
+ this.b1 = bOne;
+ this.p2 = pTwo;
+ this.p3 = pThree;
+ constructor = "LessArguments";
+ }
+
+ public String getName() {
+ return "BService";
+ }
+
+ public String getB1Name() {
+ if (b1 == null)
+ return null;
+ return b1.getName();
+ }
+
+ public String getP2() {
+ return p2;
+ }
+
+ public int getP3() {
+ return p3;
+ }
+
+ public String getConstructor() {
+ return constructor;
+ }
+
+ public String getP4() {
+ return p4;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,87 @@
+/*
+ * 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CService.class)
+public class CServiceImpl3 implements CService {
+
+ public BService b1;
+
+ public String p2;
+
+ public int p3;
+
+ public String p4;
+
+ public String constructor;
+
+ public CServiceImpl3() {
+ constructor = "NoArgument";
+ }
+
+ @Constructor({"bOne", "pTwo", "pThree", "pFour"})
+ public CServiceImpl3(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4) {
+ this.b1 = b1;
+ this.p2 = p2;
+ this.p3 = p3;
+ this.p4 = p4;
+ constructor = "AllArguments";
+ }
+
+ public CServiceImpl3(BService bOne, String pTwo, int pThree) {
+ this.b1 = bOne;
+ this.p2 = pTwo;
+ this.p3 = pThree;
+ constructor = "LessArguments";
+ }
+
+ public String getName() {
+ return "BService";
+ }
+
+ public String getB1Name() {
+ if (b1 == null)
+ return null;
+ return b1.getName();
+ }
+
+ public String getP2() {
+ return p2;
+ }
+
+ public int getP3() {
+ return p3;
+ }
+
+ public String getConstructor() {
+ return constructor;
+ }
+
+ public String getP4() {
+ return p4;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,88 @@
+/*
+ * 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CService.class)
+public class CServiceImpl4 implements CService {
+
+ public BService b1;
+
+ public String p2;
+
+ public int p3;
+
+ public String p4;
+
+ public String constructor;
+
+ public CServiceImpl4() {
+ constructor = "NoArgument";
+ }
+
+ public CServiceImpl4(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4, int extra) {
+ this.b1 = b1;
+ this.p2 = p2;
+ this.p3 = p3;
+ this.p4 = p4;
+ constructor = "ExtraArguments";
+ }
+
+ @Constructor({"bOne", "pTwo", "pThree", "pFour"})
+ public CServiceImpl4(BService bOne, String pTwo, int pThree, String pFour) {
+ this.b1 = bOne;
+ this.p2 = pTwo;
+ this.p3 = pThree;
+ this.p4 = pFour;
+ constructor = "AllArguments";
+ }
+
+ public String getName() {
+ return "BService";
+ }
+
+ public String getB1Name() {
+ if (b1 == null)
+ return null;
+ return b1.getName();
+ }
+
+ public String getP2() {
+ return p2;
+ }
+
+ public int getP3() {
+ return p3;
+ }
+
+ public String getConstructor() {
+ return constructor;
+ }
+
+ public String getP4() {
+ return p4;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,88 @@
+/*
+ * 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CService.class)
+public class CServiceImpl5 implements CService {
+
+ public BService b1;
+
+ public String p2;
+
+ public int p3;
+
+ public String p4;
+
+ public String constructor;
+
+ public CServiceImpl5() {
+ constructor = "NoArgument";
+ }
+
+ public CServiceImpl5(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4, int extra) {
+ this.b1 = b1;
+ this.p2 = p2;
+ this.p3 = p3;
+ this.p4 = p4;
+ constructor = "ExtraArguments";
+ }
+
+ @Constructor({"bOne", "pFour", "pThree", "pTwo"})
+ public CServiceImpl5(BService bOne, String pTwo, int pThree, String pFour) {
+ this.b1 = bOne;
+ this.p2 = pTwo;
+ this.p3 = pThree;
+ this.p4 = pFour;
+ constructor = "SwitchedValues";
+ }
+
+ public String getName() {
+ return "BService";
+ }
+
+ public String getB1Name() {
+ if (b1 == null)
+ return null;
+ return b1.getName();
+ }
+
+ public String getP2() {
+ return p2;
+ }
+
+ public int getP3() {
+ return p3;
+ }
+
+ public String getConstructor() {
+ return constructor;
+ }
+
+ public String getP4() {
+ return p4;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,88 @@
+/*
+ * 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.property.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
+import org.osoa.sca.annotations.Constructor;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+import org.osoa.sca.annotations.Service;
+
+@Service(CService.class)
+public class CServiceImpl6 implements CService {
+
+ public BService b1;
+
+ public String p2;
+
+ public int p3;
+
+ public String p4;
+
+ public String constructor;
+
+ public CServiceImpl6() {
+ constructor = "NoArgument";
+ }
+
+ public CServiceImpl6(@Reference(name = "bOne") BService b1, @Property(name = "pTwo") String p2, @Property(name = "pThree") int p3, @Property(name = "pFour") String p4, int extra) {
+ this.b1 = b1;
+ this.p2 = p2;
+ this.p3 = p3;
+ this.p4 = p4;
+ constructor = "ExtraArguments";
+ }
+
+ @Constructor({"bOne", "pTwo", "pThree", "pWrong"})
+ public CServiceImpl6(BService bOne, String pTwo, int pThree, String pFour) {
+ this.b1 = bOne;
+ this.p2 = pTwo;
+ this.p3 = pThree;
+ this.p4 = pFour;
+ constructor = "WrongValues";
+ }
+
+ public String getName() {
+ return "BService";
+ }
+
+ public String getB1Name() {
+ if (b1 == null)
+ return null;
+ return b1.getName();
+ }
+
+ public String getP2() {
+ return p2;
+ }
+
+ public int getP3() {
+ return p3;
+ }
+
+ public String getConstructor() {
+ return constructor;
+ }
+
+ public String getP4() {
+ return p4;
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/resources/property.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/resources/property.composite?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/resources/property.composite (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/main/resources/property.composite Wed Apr 16 09:30:09 2008
@@ -73,5 +73,63 @@
<property name="p20" many="true">"p20"</property>
<property name="p21" many="true">2 1 21</property>
</component>
+
+ <component name="CComponent1">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl1" />
+ <reference name="bOne" target="BComponent"/>
+ <property name="pTwo">p2</property>
+ <property name="pThree">3</property>
+ <property name="pFour">p4</property>
+ </component>
+
+ <component name="CComponent2">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl2" />
+ <reference name="bOne" target="BComponent"/>
+ <property name="pTwo">p2</property>
+ <property name="pThree">3</property>
+ <property name="pFour">p4</property>
+ </component>
+
+ <component name="CComponent3">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl3" />
+ <reference name="bOne" target="BComponent"/>
+ <property name="pTwo">p2</property>
+ <property name="pThree">3</property>
+ <property name="pFour">p4</property>
+ </component>
+
+ <component name="CComponent4">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl4" />
+ <reference name="bOne" target="BComponent"/>
+ <property name="pTwo">p2</property>
+ <property name="pThree">3</property>
+ <property name="pFour">p4</property>
+ </component>
+
+ <component name="CComponent5">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl5" />
+ <reference name="bOne" target="BComponent"/>
+ <property name="pTwo">p2</property>
+ <property name="pThree">3</property>
+ <property name="pFour">p4</property>
+ </component>
+ <component name="CComponent6">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.CServiceImpl6" />
+ <reference name="bOne" target="BComponent"/>
+ <property name="pTwo">p2</property>
+ <property name="pThree">3</property>
+ <property name="pFour">p4</property>
+ </component>
+
+ <component name="BComponent">
+ <implementation.java class="org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl.BServiceImpl"/>
+ </component>
+
</composite>
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/property/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/PropertyAnnotationTestCase.java Wed Apr 16 09:30:09 2008
@@ -19,24 +19,32 @@
package org.apache.tuscany.sca.vtest.javaapi.annotations.property;
+import static org.junit.Assert.fail;
import junit.framework.Assert;
import org.apache.tuscany.sca.host.embedded.SCADomain;
import org.apache.tuscany.sca.vtest.javaapi.annotations.property.AService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.property.CService;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Ignore;
/**
- * This test class tests the Property annotation described in section 1.2.3 and
- * 1.8.13
+ * This test class tests the Property annotation described in section 1.2.3
+ * including 1.8.5 and 1.8.13
*/
public class PropertyAnnotationTestCase {
protected static SCADomain domain;
protected static String compositeName = "property.composite";
protected static AService aService = null;
+ protected static CService cService1 = null;
+ protected static CService cService2 = null;
+ protected static CService cService3 = null;
+ protected static CService cService4 = null;
+ protected static CService cService5 = null;
+ protected static CService cService6 = null;
@BeforeClass
public static void init() throws Exception {
@@ -44,6 +52,12 @@
System.out.println("Setting up");
domain = SCADomain.newInstance(compositeName);
aService = domain.getService(AService.class, "AComponent");
+ cService1 = domain.getService(CService.class, "CComponent1");
+ cService2 = domain.getService(CService.class, "CComponent2");
+ cService3 = domain.getService(CService.class, "CComponent3");
+ cService4 = domain.getService(CService.class, "CComponent4");
+ cService5 = domain.getService(CService.class, "CComponent5");
+ cService6 = domain.getService(CService.class, "CComponent6");
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -181,4 +195,65 @@
Assert.assertEquals(1, aService.getP21(1));
Assert.assertEquals(21, aService.getP21(2));
}
+
+ /**
+ * Lines 1141 to 1162:<br>
+ * 1.8.5. "@Constructor"<br>
+ * ...<br>
+ * The "@Constructor" annotation is used to mark a particular constructor
+ * to use when instantiating a Java component implementation.<br>
+ * The "@Constructor" annotation has the following attribute:<br>
+ * <li>value (optional) identifies the property/reference names that
+ * correspond to each of the constructor arguments. The position in the
+ * array determines which of the arguments are being named.</li>
+ * <p>
+ * cService1 - "@Constructor" without value and constructor arguments<br>
+ * cService2 - "@Constructor" without value but with constructor
+ * arguments<br>
+ * cService3 - "@Constructor" with values and constructor arguments<br>
+ * cService4 - "@Constructor" with values and constructor arguments
+ * where value, property and parameter names are same<br>
+ * cService5 - "@Constructor" with switched values and constructor
+ * arguments<br>
+ * cService6 - "@Constructor" with wrong values<br>
+ */
+ @Test
+ public void atProperty6() throws Exception {
+ Assert.assertNull(cService1.getB1Name());
+ Assert.assertNull(cService1.getP2());
+ Assert.assertEquals(0, cService1.getP3());
+ Assert.assertNull(cService1.getP4());
+ Assert.assertEquals("NoArgument", cService1.getConstructor());
+
+ Assert.assertEquals("BService", cService2.getB1Name());
+ Assert.assertEquals("p2", cService2.getP2());
+ Assert.assertEquals(3, cService2.getP3());
+ Assert.assertEquals("p4", cService2.getP4());
+ Assert.assertEquals("AllArguments", cService2.getConstructor());
+
+ Assert.assertEquals("BService", cService3.getB1Name());
+ Assert.assertEquals("p2", cService3.getP2());
+ Assert.assertEquals(3, cService3.getP3());
+ Assert.assertEquals("p4", cService3.getP4());
+ Assert.assertEquals("AllArguments", cService3.getConstructor());
+
+ Assert.assertEquals("BService", cService4.getB1Name());
+ Assert.assertEquals("p2", cService4.getP2());
+ Assert.assertEquals(3, cService4.getP3());
+ Assert.assertEquals("p4", cService4.getP4());
+ Assert.assertEquals("AllArguments", cService4.getConstructor());
+
+ Assert.assertEquals("BService", cService5.getB1Name());
+ Assert.assertEquals("p4", cService5.getP2());
+ Assert.assertEquals(3, cService5.getP3());
+ Assert.assertEquals("p2", cService5.getP4());
+ Assert.assertEquals("SwitchedValues", cService5.getConstructor());
+
+ try {
+ System.out.println(cService6.getB1Name());
+ fail("Should have failed to call this service");
+ } catch (Throwable t) {}
+
+ }
+
}
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/BService.java Wed Apr 16 09:30:09 2008
@@ -29,4 +29,5 @@
public String setAObject(AObject a);
+ public String testServices();
}
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/CService.java Wed Apr 16 09:30:09 2008
@@ -18,13 +18,14 @@
*/
package org.apache.tuscany.sca.vtest.javaapi.annotations.service;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
+
/**
- * Simple Local Service without defining
- *
- * @Service at the implementation class
+ * Simple Local Service without defining "@Service" at the implementation class
*/
public interface CService {
public String getName();
+ public String setAObject(AObject a);
}
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.service;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Remotable Service
+ */
+@Remotable
+public interface HService {
+
+ public String getName();
+
+ public String setAObject1(AObject a);
+
+ public String setAObject2(AObject a);
+
+ public String getComponentName();
+
+ public String getAObject1String();
+
+ public String getAObject2String();
+
+ public String getAObject3String();
+
+ public AObject getAObject3();
+
+ public String getServiceName1();
+
+ public String getServiceName2();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/HService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,54 @@
+/*
+ * 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.service;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Simple Remotable Service
+ */
+@Remotable
+public interface IService {
+
+ public String getName();
+
+ public String setAObject1(AObject a);
+
+ public String setAObject2(AObject a);
+
+ public void setComponentName1(String componentName1);
+
+ public String getComponentName1();
+
+ public String getComponentName2();
+
+ public String getAObject1String();
+
+ public String getAObject2String();
+
+ public String getAObject3String();
+
+ public AObject getAObject3();
+
+ public String getServiceName1();
+
+ public String getServiceName2();
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/IService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/BServiceImpl.java Wed Apr 16 09:30:09 2008
@@ -19,12 +19,29 @@
package org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.AService;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.BService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.CService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.HService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.IService;
import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.Reference;
@Service(BService.class)
public class BServiceImpl implements BService {
+ @Reference(required=false)
+ public AService aService = null;
+
+ @Reference(required=false)
+ public CService cService = null;
+
+ @Reference(required=false)
+ public HService hService = null;
+
+ @Reference(required=false)
+ public IService iService = null;
+
public String getName() {
return "BService";
}
@@ -32,5 +49,63 @@
public String setAObject(AObject a) {
a.aString = "BService";
return "BService";
+ }
+
+ public String testServices() {
+
+ AObject a = new AObject();
+ aService.setAObject(a);
+ if (a.aString != null)
+ return "AServiceNotPassByValue";
+
+ AObject c = new AObject();
+ cService.setAObject(c);
+ if (c.aString == null || !c.aString.equals("CService"))
+ return "CServiceNotPassByReference";
+
+
+ AObject h1 = new AObject();
+ hService.setAObject1(h1);
+ if (h1.aString == null || !h1.aString.equals("HService"))
+ return "HServiceSetAObject1NotPassByReference";
+ h1.aString = "testServices";
+ if (!hService.getAObject1String().equals("testServices"))
+ return "HServiceGetAObject1NotPassByReference";
+
+ AObject h2 = new AObject();
+ hService.setAObject2(h2);
+ if (h2.aString != null)
+ return "HServiceSetAObject2NotPassByValue";
+ h2.aString = "testServices";
+ if (!hService.getAObject2String().equals("HService"))
+ return "HServiceGetAObject1NotPassByValue";
+
+ AObject h3 = hService.getAObject3();
+ h3.aString = "testServices";
+ if (!hService.getAObject3String().equals("HService"))
+ return "HServiceGetAObject3NotPassByValue";
+
+ AObject i1 = new AObject();
+ iService.setAObject1(i1);
+ if (i1.aString == null || !i1.aString.equals("IService"))
+ return "IServiceSetAObject1NotPassByReference";
+ i1.aString = "testServices";
+ if (!iService.getAObject1String().equals("testServices"))
+ return "IServiceGetAObject1NotPassByReference";
+
+ AObject i2 = new AObject();
+ iService.setAObject2(i2);
+ if (i2.aString == null || !i2.aString.equals("IService"))
+ return "IServiceSetAObject2NotPassByReference";
+ i2.aString = "testServices";
+ if (!iService.getAObject2String().equals("testServices"))
+ return "IServiceGetAObject2NotPassByReference";
+
+ AObject i3 = iService.getAObject3();
+ i3.aString = "testServices";
+ if (!iService.getAObject3String().equals("testServices"))
+ return "IServiceGetAObject3NotPassByReference";
+
+ return "None";
}
}
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/CServiceImpl.java Wed Apr 16 09:30:09 2008
@@ -27,4 +27,8 @@
return "CService";
}
+ public String setAObject(AObject a) {
+ a.aString = "CService";
+ return "CService";
+ }
}
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,105 @@
+/*
+ * 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.service.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.HService;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.ComponentName;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+import org.osoa.sca.annotations.AllowsPassByReference;
+
+@Service(HService.class)
+@Scope("REQUEST")
+public class HServiceImpl implements HService {
+
+ @ComponentName
+ protected String componentName;
+
+ private AObject aObject1 = null;
+
+ private AObject aObject2 = null;
+
+ private AObject aObject3 = null;
+
+ public RequestContext requestContext;
+
+ public ComponentContext componentContext;
+
+ public String getName() {
+ return "HService";
+ }
+
+ @AllowsPassByReference
+ public String setAObject1(AObject a) {
+ a.aString = "HService";
+ aObject1 = a;
+ return "HService";
+ }
+
+ public String setAObject2(AObject a) {
+ a.aString = "HService";
+ aObject2 = a;
+ return "HService";
+ }
+
+ @Context
+ public void setComponentContext(ComponentContext componentContext) {
+ this.componentContext = componentContext;
+ }
+
+ @Context
+ public void setRequestContext(RequestContext requestContext) {
+ this.requestContext = requestContext;
+ }
+
+ public String getComponentName() {
+ return componentName;
+ }
+
+ public String getAObject1String() {
+ return aObject1.aString;
+ }
+
+ public String getAObject2String() {
+ return aObject2.aString;
+ }
+
+ public String getAObject3String() {
+ return aObject3.aString;
+ }
+
+ public AObject getAObject3() {
+ aObject3 = new AObject();
+ aObject3.aString = "HService";
+ return aObject3;
+ }
+
+ public String getServiceName1() {
+ return requestContext.getServiceName();
+ }
+
+ public String getServiceName2() {
+ return componentContext.getRequestContext().getServiceName();
+ }
+
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/HServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java?rev=648741&view=auto
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java (added)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java Wed Apr 16 09:30:09 2008
@@ -0,0 +1,107 @@
+/*
+ * 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.service.impl;
+
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.IService;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.RequestContext;
+import org.osoa.sca.annotations.AllowsPassByReference;
+import org.osoa.sca.annotations.ComponentName;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+@Service(IService.class)
+@Scope("REQUEST")
+@AllowsPassByReference
+public class IServiceImpl implements IService {
+
+ @ComponentName
+ public String componentName1;
+
+ public String componentName2;
+
+ private AObject aObject1 = null;
+
+ private AObject aObject2 = null;
+
+ private AObject aObject3 = null;
+
+ @Context
+ public RequestContext requestContext;
+
+ @Context
+ public ComponentContext componentContext;
+
+ public String getName() {
+ return "IService";
+ }
+
+ public String setAObject1(AObject a) {
+ a.aString = "IService";
+ aObject1 = a;
+ return "IService";
+ }
+
+ public String setAObject2(AObject a) {
+ a.aString = "IService";
+ aObject2 = a;
+ return "IService";
+ }
+
+ @ComponentName
+ public void setComponentName1(String componentName1) {
+ this.componentName2 = componentName1;
+ }
+
+ public String getAObject1String() {
+ return aObject1.aString;
+ }
+
+ public String getAObject2String() {
+ return aObject2.aString;
+ }
+
+ public String getAObject3String() {
+ return aObject3.aString;
+ }
+
+ public AObject getAObject3() {
+ aObject3 = new AObject();
+ aObject3.aString = "IService";
+ return aObject3;
+ }
+
+ public String getComponentName1() {
+ return componentName1;
+ }
+
+ public String getComponentName2() {
+ return componentName2;
+ }
+
+ public String getServiceName1() {
+ return requestContext.getServiceName();
+ }
+
+ public String getServiceName2() {
+ return componentContext.getRequestContext().getServiceName();
+ }
+}
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/impl/IServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/main/resources/service.composite Wed Apr 16 09:30:09 2008
@@ -30,6 +30,15 @@
class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.BServiceImpl" />
</component>
+ <component name="BComponent1">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.BServiceImpl" />
+ <reference name="aService" target="AComponent"/>
+ <reference name="cService" target="CComponent"/>
+ <reference name="hService" target="HComponent"/>
+ <reference name="iService" target="IComponent"/>
+ </component>
+
<component name="CComponent">
<implementation.java
class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.CServiceImpl" />
@@ -59,5 +68,15 @@
<implementation.java
class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.GServiceImpl" />
</component>
-
+
+ <component name="HComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.HServiceImpl" />
+ </component>
+
+ <component name="IComponent">
+ <implementation.java
+ class="org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.IServiceImpl" />
+ </component>
+
</composite>
Modified: incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java?rev=648741&r1=648740&r2=648741&view=diff
==============================================================================
--- incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java (original)
+++ incubator/tuscany/java/sca/vtest/java-api/annotations/service/src/test/java/org/apache/tuscany/sca/vtest/javaapi/annotations/service/ServiceAnnotationTestCase.java Wed Apr 16 09:30:09 2008
@@ -31,8 +31,11 @@
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.DService3;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.EService;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.FService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.GService1;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.GService2;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.HService;
+import org.apache.tuscany.sca.vtest.javaapi.annotations.service.IService;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.AObject;
-import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl;
import org.apache.tuscany.sca.vtest.javaapi.annotations.service.impl.FServiceImpl2;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -40,8 +43,10 @@
import org.junit.Ignore;
/**
- * This test class tests the Service annotation described in section 1.2.1 and
- * 1.8.17
+ * This test class tests the Service annotation described in section 1.2.1
+ * including 1.3.1, 1.8.1, 1.8.3, 1.8.6, 1.8.15 and 1.8.17<br>
+ * but not..<br>
+ * <li>Lines 1531 to 1534</li>
*/
public class ServiceAnnotationTestCase {
@@ -49,6 +54,9 @@
protected static String compositeName = "service.composite";
protected static AService aService = null;
protected static BService bService = null;
+ protected static BService bService1 = null;
+ protected static HService hService = null;
+ protected static IService iService = null;
@BeforeClass
public static void init() throws Exception {
@@ -57,6 +65,9 @@
domain = SCADomain.newInstance(compositeName);
aService = domain.getService(AService.class, "AComponent");
bService = domain.getService(BService.class, "BComponent");
+ bService1 = domain.getService(BService.class, "BComponent1");
+ hService = domain.getService(HService.class, "HComponent");
+ iService = domain.getService(IService.class, "IComponent");
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -126,12 +137,63 @@
* ...<br>
* The data exchange semantic for calls to local services is by-reference.<br>
* ...<br>
+ * Lines 996 to 1028:<br>
+ * 1.8.1 "@AllowsPassByReference"<br>
+ * ...<br>
+ * Lines 1535 to 1540:<br>
+ * Independent of whether the remotable service is called from outside of
+ * the composite that contains it or from another component in the same
+ * composite, the data exchange semantics are by-value.<br>
+ * Implementations of remotable services may modify input data during or
+ * after an invocation and may modify return data after the invocation. If
+ * a remotable service is called locally or remotely, the SCA container is
+ * responsible for making sure that no modification of input data or
+ * post-invocation modifications to return data are seen by the caller.<br>
+ * <p>
+ * Test under Non-SCA <-> SCA
+ * <li>BService is local service to test by reference</li>
+ * <li>HService is remotable service to test "@AllowsPassByReference" at
+ * method level</li>
+ * <li>IService is remotable service to test "@AllowsPassByReference" at
+ * class level</li>
*/
@Test
public void atService4() throws Exception {
- AObject o = new AObject();
- Assert.assertEquals("BService", bService.setAObject(o));
- Assert.assertEquals("BService", o.aString);
+ AObject b = new AObject();
+ Assert.assertEquals("BService", bService.setAObject(b));
+ Assert.assertEquals("BService", b.aString);
+
+ AObject h1 = new AObject();
+ Assert.assertEquals("HService", hService.setAObject1(h1));
+ Assert.assertEquals("HService", h1.aString);
+ h1.aString = "atService4";
+ Assert.assertEquals("atService4", hService.getAObject1String());
+
+ AObject h2 = new AObject();
+ Assert.assertEquals("HService", hService.setAObject2(h2));
+ Assert.assertNull(h2.aString);
+ h2.aString = "atService4";
+ Assert.assertEquals("HService", hService.getAObject2String());
+
+ AObject h3 = hService.getAObject3();
+ h3.aString = "atService4";
+ Assert.assertEquals("HService", hService.getAObject3String());
+
+ AObject i1 = new AObject();
+ Assert.assertEquals("IService", iService.setAObject1(i1));
+ Assert.assertEquals("IService", i1.aString);
+ i1.aString = "atService4";
+ Assert.assertEquals("atService4", iService.getAObject1String());
+
+ AObject i2 = new AObject();
+ Assert.assertEquals("IService", iService.setAObject2(i2));
+ Assert.assertEquals("IService", i2.aString);
+ i2.aString = "atService4";
+ Assert.assertEquals("atService4", iService.getAObject2String());
+
+ AObject i3 = iService.getAObject3();
+ i3.aString = "atService4";
+ Assert.assertEquals("atService4", iService.getAObject3String());
}
/**
@@ -216,5 +278,74 @@
Assert.assertEquals("GService1", gService1.getServiceName());
Assert.assertEquals("GService", gService2.getName());
Assert.assertEquals("GService2", gService2.getServiceName());
+ }
+
+ /**
+ * Lines 227 to 242:<br>
+ * A local service can only be called by clients that are deployed within
+ * the same address space as the component implementing the local service.<br>
+ * ...<br>
+ * The data exchange semantic for calls to local services is by-reference.<br>
+ * ...<br>
+ * Lines 996 to 1028:<br>
+ * 1.8.1 "@AllowsPassByReference"<br>
+ * ...<br>
+ * Lines 1535 to 1540:<br>
+ * Independent of whether the remotable service is called from outside of
+ * the composite that contains it or from another component in the same
+ * composite, the data exchange semantics are by-value.<br>
+ * Implementations of remotable services may modify input data during or
+ * after an invocation and may modify return data after the invocation. If
+ * a remotable service is called locally or remotely, the SCA container is
+ * responsible for making sure that no modification of input data or
+ * post-invocation modifications to return data are seen by the caller.<br>
+ * <p>
+ * Test under SCA <-> SCA<br>
+ * <li>AService is remotable service to test by value</li>
+ * <li>CService is local service to test by-reference</li>
+ * <li>HService is remotable service to test "@AllowsPassByReference" at method level</li>
+ * <li>IService is remotable service to test "@AllowsPassByReference" at class level</li>
+ */
+ @Test
+ public void atService10() throws Exception {
+ Assert.assertEquals("None", bService1.testServices());
+ }
+
+ /**
+ * Lines 1095 to 1124:<br>
+ * 1.8.3. "@ComponentName"<br>
+ * ...<br>
+ * The "@ComponentName" annotation type is used to annotate a Java class
+ * field or setter method that is used to inject the component name.<br>
+ * ...<br>
+ */
+ @Test
+ public void atService11() throws Exception {
+ Assert.assertEquals("HComponent", hService.getComponentName());
+ Assert.assertNull(iService.getComponentName1());
+ Assert.assertEquals("IComponent", iService.getComponentName2());
+ }
+
+ /**
+ * Lines 1164 to 1187:<br>
+ * 1.8.6. "@Context"<br>
+ * ...<br>
+ * The "@Context" annotation type is used to annotate a Java class field
+ * or a setter method that is used to inject a composite context for the
+ * component. The type of context to be injected is defined by the type of
+ * the Java class field or type of the setter method input argument, the
+ * type is either ComponentContext or RequestContext.<br>
+ * ...<br>
+ * <p>
+ * HService - "@Context" is used to annotate setter methods<br>
+ * IService - "@Context" is used to annotate class fields<br>
+ * <br>
+ */
+ @Test
+ public void atService12() throws Exception {
+ Assert.assertEquals("HService", hService.getServiceName1());
+ Assert.assertEquals("HService", hService.getServiceName2());
+ Assert.assertEquals("IService", iService.getServiceName1());
+ Assert.assertEquals("IService", iService.getServiceName2());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org