Author: slaws
Date: Wed Dec 14 13:24:50 2011
New Revision: 1214234

URL: http://svn.apache.org/viewvc?rev=1214234&view=rev
Log:
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. 

Added:
    
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java
    
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java
Modified:
    
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
    
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java

Added: 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java?rev=1214234&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated2CTCalcComponentImpl.java
 Wed Dec 14 13:24:50 2011
@@ -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";
+    }
+}

Added: 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java?rev=1214234&view=auto
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java
 (added)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedBaseCTCalcComponentImpl.java
 Wed Dec 14 13:24:50 2011
@@ -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";
+    }
+}

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite?rev=1214234&r1=1214233&r2=1214234&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite
 Wed Dec 14 13:24:50 2011
@@ -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>

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java?rev=1214234&r1=1214233&r2=1214234&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
 Wed Dec 14 13:24:50 2011
@@ -28,6 +28,7 @@ import org.apache.tuscany.sca.node.NodeF
 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());
+    }    
 }


Reply via email to