You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2011/10/31 11:30:29 UTC
svn commit: r1195397 - in /tuscany/sca-java-2.x/trunk:
modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/
modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/
t...
Author: slaws
Date: Mon Oct 31 10:30:29 2011
New Revision: 1195397
URL: http://svn.apache.org/viewvc?rev=1195397&view=rev
Log:
TUSCANY-3924 - ignore artifacts of the base class when a java implementation class extends a base class
Added:
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/ (with props)
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated1CTCalcComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedCTCalcComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/BaseCTCalcComponentImpl.java
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcComponent.java
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/UnannotatedCTCalcComponentImpl.java
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/ (with props)
tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java
Modified:
tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java
tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java
tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
Modified: tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java?rev=1195397&r1=1195396&r2=1195397&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java Mon Oct 31 10:30:29 2011
@@ -25,9 +25,9 @@ package org.apache.tuscany.sca.implement
*/
public class Bean1 extends SuperBean {
- public static final int ALL_BEAN1_FIELDS = 6 + ALL_SUPER_FIELDS;
- public static final int ALL_BEAN1_PUBLIC_PROTECTED_FIELDS = 5 + ALL_SUPER_PUBLIC_PROTECTED_FIELDS;
- public static final int ALL_BEAN1_METHODS = 4 + ALL_SUPER_METHODS - 1;
+ public static final int ALL_BEAN1_FIELDS = 6; //TUSCANY-3924 + ALL_SUPER_FIELDS;
+ public static final int ALL_BEAN1_PUBLIC_PROTECTED_FIELDS = 5; //TUSCANY-3924 + ALL_SUPER_PUBLIC_PROTECTED_FIELDS;
+ public static final int ALL_BEAN1_METHODS = 4; //TUSCANY-3924 + ALL_SUPER_METHODS - 1;
public String field3;
protected String field2;
private String field1;
Modified: tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java?rev=1195397&r1=1195396&r2=1195397&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java Mon Oct 31 10:30:29 2011
@@ -29,6 +29,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
+import org.junit.Ignore;
import org.junit.Test;
/**
@@ -46,7 +47,7 @@ public class JavaIntrospectionHelperTest
@Test
public void testBean1AllPublicProtectedFields() throws Exception {
Set<Field> beanFields = JavaIntrospectionHelper.getAllPublicAndProtectedFields(Bean1.class, true);
- assertEquals(4, beanFields.size()); //Bean1.ALL_BEAN1_PUBLIC_PROTECTED_FIELDS
+ assertEquals(2, beanFields.size()); //Bean1.ALL_BEAN1_PUBLIC_PROTECTED_FIELDS
}
@Test
@@ -75,7 +76,8 @@ public class JavaIntrospectionHelperTest
throw new Exception("Override never invoked");
}
}
-
+
+ @Ignore("TUSCANY-3924")
@Test
public void testNoOverrideMethod() throws Exception {
Set<Method> beanFields = JavaIntrospectionHelper.getAllUniquePublicProtectedMethods(Bean1.class, true);
Modified: tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java?rev=1195397&r1=1195396&r2=1195397&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaIntrospectionHelper.java Mon Oct 31 10:30:29 2011
@@ -83,7 +83,8 @@ public final class JavaIntrospectionHelp
if (clazz == null || clazz.isArray() || Object.class.equals(clazz)) {
return fields;
}
- fields = getAllPublicAndProtectedFields(clazz.getSuperclass(), fields, validating);
+ // TUSCANY-3924 - don't consider inherited fields
+ //fields = getAllPublicAndProtectedFields(clazz.getSuperclass(), fields, validating);
Field[] declaredFields = null;
@@ -136,7 +137,8 @@ public final class JavaIntrospectionHelp
return fields;
}
- fields = getInjectableFields(clazz.getSuperclass(), fields, validating);
+ // TUSCANY-3924 - don't consider inherited fields
+ //fields = getInjectableFields(clazz.getSuperclass(), fields, validating);
Field[] declaredFields = null;
@@ -235,7 +237,8 @@ public final class JavaIntrospectionHelp
}
// evaluate class hierarchy - this is done last to track inherited
// methods
- methods = getAllUniqueMethods(pClass.getSuperclass(), methods, validating);
+ // TUSCANY-3924 - don't consider inherited fields
+ //methods = getAllUniqueMethods(pClass.getSuperclass(), methods, validating);
return methods;
}
Propchange: tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/
------------------------------------------------------------------------------
bugtraq:number = true
Added: tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated1CTCalcComponentImpl.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/Annotated1CTCalcComponentImpl.java?rev=1195397&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated1CTCalcComponentImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/Annotated1CTCalcComponentImpl.java Mon Oct 31 10:30:29 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 Annotated1CTCalcComponentImpl extends BaseCTCalcComponentImpl {
+
+ 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/AnnotatedCTCalcComponentImpl.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/AnnotatedCTCalcComponentImpl.java?rev=1195397&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedCTCalcComponentImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/AnnotatedCTCalcComponentImpl.java Mon Oct 31 10:30:29 2011
@@ -0,0 +1,34 @@
+/*
+ * 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 AnnotatedCTCalcComponentImpl extends BaseCTCalcComponentImpl {
+
+ private String aPropertyPrivate;
+ protected String aPropertyProtected;
+ public String aPropertyPublic;
+
+ public String test(){
+ return "Annotated";
+ }
+}
Added: tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/BaseCTCalcComponentImpl.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/BaseCTCalcComponentImpl.java?rev=1195397&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/BaseCTCalcComponentImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/BaseCTCalcComponentImpl.java Mon Oct 31 10:30:29 2011
@@ -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.itest.ctcalc;
+
+public class BaseCTCalcComponentImpl implements CTCalcComponent {
+
+ private String notAPropertyPrivate;
+ protected String notAPropertyProtected;
+ public String notAPropertyPublic;
+
+ 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 notAPropertyPublic;
+ }
+
+ public void setNotAPropertyPublic(String notAPropertyPublic) {
+ this.notAPropertyPublic = notAPropertyPublic;
+ }
+
+ public String test(){
+ return "XXX";
+ }
+}
Added: tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcComponent.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/CTCalcComponent.java?rev=1195397&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcComponent.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcComponent.java Mon Oct 31 10:30:29 2011
@@ -0,0 +1,23 @@
+/*
+ * 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;
+
+public interface CTCalcComponent {
+ public String test();
+}
Added: tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/UnannotatedCTCalcComponentImpl.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/UnannotatedCTCalcComponentImpl.java?rev=1195397&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/UnannotatedCTCalcComponentImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ctcalc/UnannotatedCTCalcComponentImpl.java Mon Oct 31 10:30:29 2011
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+public class UnannotatedCTCalcComponentImpl extends BaseCTCalcComponentImpl {
+
+ private String aPropertyPrivate;
+ protected String aPropertyProtected;
+ public String aPropertyPublic;
+
+ public String test(){
+ return "Unannotated";
+ }
+}
Added: 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=1195397&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/properties/src/main/resources/CTCalcTest.composite Mon Oct 31 10:30:29 2011
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://foo"
+ name="CTCalcTest">
+
+ <component name="AnnotatedComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.ctcalc.AnnotatedCTCalcComponentImpl" />
+ </component>
+
+ <component name="UnannotatedComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.ctcalc.UnannotatedCTCalcComponentImpl" />
+ </component>
+
+ <component name="Annotated1Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.ctcalc.Annotated1CTCalcComponentImpl" />
+ <property name="aPropertyAnnotated" value="xyz"/>
+ </component>
+
+</composite>
Propchange: tuscany/sca-java-2.x/trunk/testing/itest/properties/src/test/java/org/apache/tuscany/sca/itest/ctcalc/
------------------------------------------------------------------------------
bugtraq:number = true
Added: 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=1195397&view=auto
==============================================================================
--- 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/test/java/org/apache/tuscany/sca/itest/ctcalc/CTCalcTestCase.java Mon Oct 31 10:30:29 2011
@@ -0,0 +1,100 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+
+import java.util.Iterator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+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;
+
+/**
+ * This tests how properties are calculated in the case where the implementation class extends another class. Two
+ * cases are considered where the implementation class has:
+ * - SCA annotations
+ * - No SCA annotations
+ *
+ * In particular we're checking that the artifacts of the base class are ignored in both cases.
+ *
+ */
+public class CTCalcTestCase {
+
+ private static Node node;
+
+ private static CTCalcComponent annotatedComponent;
+ private static CTCalcComponent unannotatedComponent;
+
+
+ /**
+ * Method annotated with
+ *
+ * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
+ * Embedded SCA node, to start the SCA node and to get a reference to the 'outerABService' service
+ */
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("CTCalcTest.composite");
+ node = NodeFactory.newInstance().createNode("CTCalcTest.composite", new Contribution("c1", location));
+ node.start();
+ annotatedComponent = node.getService(CTCalcComponent.class, "AnnotatedComponent");
+ unannotatedComponent = node.getService(CTCalcComponent.class, "UnannotatedComponent");
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * node, close any previously opened connections etc
+ */
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ @Ignore("TODO - TUSCANY-3965")
+ @Test
+ public void testAnnotatedExtension() {
+ assertEquals("Annotated", annotatedComponent.test());
+ assertEquals(0, ((NodeImpl)node).getDomainComposite().getComponents().get(0).getProperties().size());
+ System.out.println(((NodeImpl)node).getDomainComposite().getComponents().get(0).getProperties());
+ }
+
+ @Test
+ public void testUnannotatedExtension() {
+ assertEquals("Unannotated", unannotatedComponent.test());
+ assertEquals(2, ((NodeImpl)node).getDomainComposite().getComponents().get(1).getProperties().size());
+ System.out.println(((NodeImpl)node).getDomainComposite().getComponents().get(1).getProperties());
+ }
+
+ @Test
+ public void testAnnotated1Extension() {
+ assertEquals("Annotated", annotatedComponent.test());
+ assertEquals(1, ((NodeImpl)node).getDomainComposite().getComponents().get(2).getProperties().size());
+ System.out.println(((NodeImpl)node).getDomainComposite().getComponents().get(2).getProperties());
+ }
+}