From 3a569a2f00bf172cddfd567149774ee808a2a242 Mon Sep 17 00:00:00 2001 From: nash Date: Wed, 30 Mar 2011 19:50:51 +0000 Subject: Create branch for 1.6.2 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1087059 13f79535-47bb-0310-9956-ffa450edef68 --- .../javaapi/annotations/property/AService.java | 82 +++++++ .../annotations/property/AnotherAService.java | 48 +++++ .../javaapi/annotations/property/BService.java | 32 +++ .../javaapi/annotations/property/CService.java | 38 ++++ .../javaapi/annotations/property/impl/AObject.java | 35 +++ .../annotations/property/impl/AServiceImpl.java | 240 +++++++++++++++++++++ .../property/impl/AnotherAServiceImpl.java | 116 ++++++++++ .../annotations/property/impl/BServiceImpl.java | 32 +++ .../annotations/property/impl/CServiceImpl1.java | 87 ++++++++ .../annotations/property/impl/CServiceImpl2.java | 87 ++++++++ .../annotations/property/impl/CServiceImpl3.java | 87 ++++++++ .../annotations/property/impl/CServiceImpl4.java | 88 ++++++++ .../annotations/property/impl/CServiceImpl5.java | 88 ++++++++ .../annotations/property/impl/CServiceImpl6.java | 89 ++++++++ 14 files changed, 1149 insertions(+) create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java create mode 100644 sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java (limited to 'sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest') diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java new file mode 100644 index 0000000000..5cfea1b099 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AService.java @@ -0,0 +1,82 @@ +/* + * 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 + */ +public interface AService { + + public String getName(); + + public String getP1(); + + public String getP2(); + + public String getP3(); + + public String getP4(); + + public String getP5(); + + public String getP6(); + + public String getP7AString(); + + public int getP7BInt(); + + public String getP8AString(); + + public int getP8BInt(); + + public String getP9AString(); + + public int getP9BInt(); + + public String getP10AString(); + + public int getP10BInt(); + + public String getP11AString(); + + public int getP11BInt(); + + public String getP12AString(); + + public int getP12BInt(); + + public String getP15(); + + public String getP16(); + + public String getP17(); + + public String getP18(); + + public int getP19Size(); + + public String getP20(int i); + + public int getP20Size(); + + public int getP21(int i); + + public int getP21Size(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java new file mode 100644 index 0000000000..5ddc59f8b6 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/AnotherAService.java @@ -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.property; + +/** + * Simple Service + */ +public interface AnotherAService { + + public String getName(); + + public String getP13(); + + public String getP14(); + + public String getP22(); + + public String getP23(); + + public String getP24(); + + public String getP25(); + + public boolean getP14SetterIsCalled(); + + public boolean getP23SetterIsCalled(); + + public boolean getP24SetterIsCalled(); + + public boolean getP25SetterIsCalled(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java new file mode 100644 index 0000000000..99fb842a9a --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/BService.java @@ -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(); + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java new file mode 100644 index 0000000000..5de3b5fcff --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/CService.java @@ -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(); +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java new file mode 100644 index 0000000000..f30c4c69fc --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AObject.java @@ -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.property.impl; + +/** + * A simple object to hold a string + */ +public class AObject { + + public String aString; + public int bInt; + + public AObject() { + this.aString = null; + this.bInt = 0; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java new file mode 100644 index 0000000000..b385083533 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java @@ -0,0 +1,240 @@ +/* + * 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 java.util.List; + +import org.apache.tuscany.sca.vtest.javaapi.annotations.property.AService; +import org.osoa.sca.annotations.Service; +import org.osoa.sca.annotations.Property; + +@Service(AService.class) +public class AServiceImpl implements AService { + + @Property + protected String p1; // simple Java type injected via field + + @Property + public String p2; // simple Java type injected via field + + protected String p3; // simple Java type injected via setter + + public String p4; // simple Java type injected via setter + + protected String p5; // simple Java type injected via constructor parameter + + public String p6; // simple Java type injected via constructor parameter + + @Property(required=true) + protected AObject p7; // complex Java type injected via field + + @Property + public AObject p8; // complex Java type injected via field + + protected AObject p9; // complex Java type injected via setter + + public AObject p10; // complex Java type injected via setter + + protected AObject p11; // complex Java type injected via constructor parameter + + public AObject p12; // complex Java type injected via constructor parameter + + @Property(name="pFifteen") + protected String p15; // injected via field with different name + + protected String p16; // injected via setter with different name + + @Property(name="p17", required=false) + public String p17; // injected via field but not defined in composite + + public String p18; // injected via setter but not defined in composite + + @Property(name="p19", required=true) + public List p19; // a List and injected via field with no element + + public List p20; // a List and injected via setter + + @Property(required=false) + public Integer[] p21; // an array and injected via field + + public String getName() { + return "AService"; + } + + public AServiceImpl( + @Property(name = "p5") String p5, + @Property(name = "p6") String p6, + @Property(name = "p11") AObject p11, + @Property(name = "p12") AObject p12 + ) { + super(); + this.p5 = p5; + this.p6 = p6; + this.p11 = p11; + this.p12 = p12; + } + + @Property + public void setP3(String p3) { + this.p3 = p3; + } + + @Property(required=true) + public void setP4(String p4) { + this.p4 = p4; + } + + @Property + public void setP9(AObject p9) { + this.p9 = p9; + } + + @Property + public void setP10(AObject p10) { + this.p10 = p10; + } + + @Property(name="pSixteen") + public void setP16(String p16) { + this.p16 = p16; + } + + @Property(name="p18", required=false) + public void setP18(String p18) { + this.p18 = p18; + } + + @Property(name="p20", required=true) + public void setP20(List p20) { + this.p20 = p20; + } + + public String getP1() { + return p1; + } + + public String getP2() { + return p2; + } + + public String getP3() { + return p3; + } + + public String getP4() { + return p4; + } + + public String getP5() { + return p5; + } + + public String getP6() { + return p6; + } + + public String getP7AString() { + return p7.aString; + } + + public int getP7BInt() { + return p7.bInt; + } + + public String getP8AString() { + return p8.aString; + } + + public int getP8BInt() { + return p8.bInt; + } + + public String getP9AString() { + return p9.aString; + } + + public int getP9BInt() { + return p9.bInt; + } + + public String getP10AString() { + return p10.aString; + } + + public int getP10BInt() { + return p10.bInt; + } + + public String getP11AString() { + return p11.aString; + } + + public int getP11BInt() { + return p11.bInt; + } + + public String getP12AString() { + return p12.aString; + } + + public int getP12BInt() { + return p12.bInt; + } + + public String getP15() { + return p15; + } + + public String getP16() { + return p16; + } + + public String getP17() { + return p17; + } + + public String getP18() { + return p18; + } + + public int getP19Size() { + return p19.size(); + } + + public String getP20(int i) { + return p20.get(i); + } + + public int getP20Size() { + return p20.size(); + } + + public int getP21(int i) { + return p21[i].intValue(); + } + + public int getP21Size() { + return p21.length; + } + +} + + + diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java new file mode 100644 index 0000000000..fd1ba5ee52 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AnotherAServiceImpl.java @@ -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.property.impl; + +import org.apache.tuscany.sca.vtest.javaapi.annotations.property.AnotherAService; +import org.osoa.sca.annotations.Service; + +@Service(AnotherAService.class) +public class AnotherAServiceImpl implements AnotherAService { + + public String p13; // injected via field and un-annotated + + public String p14; // injected via setter and un-annotated + + protected String p22; // unannotated protected field should not be injected + + protected String p23; // un-annotated protected and has protected setter + + protected String p24; // un-annotated protected field and has public setter + + private String p25; // un-annotated private field and has public setter + + public boolean p14SetterIsCalled = false; + + public boolean p23SetterIsCalled = false; + + public boolean p24SetterIsCalled = false; + + public boolean p25SetterIsCalled = false; + + + public String getName() { + return "AService"; + } + + public void setP14(String p14) { + p14SetterIsCalled = true; + this.p14 = p14; + } + + protected void setP23(String p23) { + p23SetterIsCalled = true; + this.p23 = p23; + } + + public void setP24(String p24) { + p24SetterIsCalled = true; + this.p24 = p24; + } + + public void setP25(String p25) { + p25SetterIsCalled = true; + this.p25 = p25; + } + + public String getP13() { + return p13; + } + + public String getP14() { + return p14; + } + + public String getP22() { + return p22; + } + + public String getP23() { + return p23; + } + + public String getP24() { + return p24; + } + + public String getP25() { + return p25; + } + + public boolean getP14SetterIsCalled() { + return p14SetterIsCalled; + } + + + public boolean getP23SetterIsCalled() { + return p23SetterIsCalled; + } + + + public boolean getP24SetterIsCalled() { + return p24SetterIsCalled; + } + + + public boolean getP25SetterIsCalled() { + return p25SetterIsCalled; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java new file mode 100644 index 0000000000..f22f4a35b7 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/BServiceImpl.java @@ -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"; + } + +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java new file mode 100644 index 0000000000..280d2275f8 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl1.java @@ -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; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java new file mode 100644 index 0000000000..6bc4384e73 --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl2.java @@ -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; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java new file mode 100644 index 0000000000..6715b64fad --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl3.java @@ -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; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java new file mode 100644 index 0000000000..e10f07b0be --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl4.java @@ -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; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java new file mode 100644 index 0000000000..9a23e2de8d --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl5.java @@ -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; + } +} diff --git a/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java new file mode 100644 index 0000000000..8f6b22eb0b --- /dev/null +++ b/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/CServiceImpl6.java @@ -0,0 +1,89 @@ +/* + * 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"}) + @Constructor({"bOne", "pTwo", "pThree", "pFour"}) // TUSCANY-3394, not sure how this test should work now + 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; + } +} -- cgit v1.2.3