summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-12-14 13:24:50 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-12-14 13:24:50 +0000
commit235fc4303ddf893f928f6c1803bf7eb9d9aeebd9 (patch)
tree9460031a6c1202acfac3fe21579e614cd32b1153 /sca-java-2.x/trunk/testing/itest
parent423e9741c50730f2f9c509889227f2c614a35e8e (diff)
TUSCANY-3924 playing with whether we should take note of inherited annotations as per JSR-250. Test ignored but I don't want to loose it.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1214234 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/testing/itest')
-rw-r--r--sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java36
-rw-r--r--sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java58
-rw-r--r--sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite8
-rw-r--r--sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java9
4 files changed, 111 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java b/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java
new file mode 100644
index 0000000000..b0758d177c
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.itest.ctcalc;
+
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(CTCalcComponent.class)
+public class Annotated2CTCalcComponentImpl extends AnnotatedBaseCTCalcComponentImpl {
+
+ private String aPropertyPrivate;
+ protected String aPropertyProtected;
+ public String aPropertyPublic;
+ @Property
+ public String aPropertyAnnotated;
+
+ public String test(){
+ return "Annotated";
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java b/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java
new file mode 100644
index 0000000000..a474756c27
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.itest.ctcalc;
+
+import org.oasisopen.sca.annotation.Property;
+
+public class AnnotatedBaseCTCalcComponentImpl implements CTCalcComponent {
+
+ private String notAPropertyPrivate;
+ protected String notAPropertyProtected;
+
+ @Property
+ public String aPropertyPublic;
+
+ public String getNotAPropertyPrivate() {
+ return notAPropertyPrivate;
+ }
+
+ public void setNotAPropertyPrivate(String notAPropertyPrivate) {
+ this.notAPropertyPrivate = notAPropertyPrivate;
+ }
+
+ public String getNotAPropertyProtected() {
+ return notAPropertyProtected;
+ }
+
+ public void setNotAPropertyProtected(String notAPropertyProtected) {
+ this.notAPropertyProtected = notAPropertyProtected;
+ }
+
+ public String getNotAPropertyPublic() {
+ return aPropertyPublic;
+ }
+
+ public void setNotAPropertyPublic(String notAPropertyPublic) {
+ this.aPropertyPublic = notAPropertyPublic;
+ }
+
+ public String test(){
+ return "XXX";
+ }
+}
diff --git a/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite b/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
index c242c78970..e562568492 100644
--- a/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
+++ b/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
@@ -32,5 +32,13 @@
<implementation.java class="org.apache.tuscany.sca.itest.ctcalc.Annotated1CTCalcComponentImpl" />
<property name="aPropertyAnnotated" value="xyz"/>
</component>
+
+ <component name="Annotated2Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.ctcalc.Annotated2CTCalcComponentImpl" />
+ <property name="aPropertyAnnotated" value="xyz"/>
+<!-- TUSCANY-3924 playing with whether we should take note of inherited annotations as per JSR-250
+ <property name="aPropertyPublic" value="abc"/>
+ -->
+ </component>
</composite>
diff --git a/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java b/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
index a13a6d1b3f..c77dbb1232 100644
--- a/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
+++ b/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
@@ -28,6 +28,7 @@ import org.apache.tuscany.sca.node.NodeFactory;
import org.apache.tuscany.sca.node.impl.NodeImpl;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -93,4 +94,12 @@ public class CTCalcTestCase {
assertEquals(1, ((NodeImpl)node).getDomainComposite().getComponents().get(2).getProperties().size());
System.out.println(((NodeImpl)node).getDomainComposite().getComponents().get(2).getProperties());
}
+
+ @Ignore("TUSCANY-3924 playing with whether we should take note of inherited annotations as per JSR-250")
+ @Test
+ public void testAnnotated2Extension() {
+ assertEquals("Annotated", annotatedComponent.test());
+ assertEquals(2, ((NodeImpl)node).getDomainComposite().getComponents().get(3).getProperties().size());
+ System.out.println(((NodeImpl)node).getDomainComposite().getComponents().get(3).getProperties());
+ }
}