summaryrefslogtreecommitdiffstats
path: root/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning')
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java79
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java76
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java65
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java66
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java69
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java81
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java73
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java69
-rw-r--r--sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java78
24 files changed, 1751 insertions, 0 deletions
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java
new file mode 100644
index 0000000000..ddebf877bb
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ComponentReferenceTargetNotFoundTestCase.java
@@ -0,0 +1,79 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ComponentReferenceTargetNotFoundTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ComponentReferenceTargetNotFound/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ComponentReferenceTargetNotFound").toURL().toString()));
+
+ try {
+ node.start();
+ } catch (Exception ex){
+ // do nothing - the SCA binding throws and exception here
+ // because the interface for the reference is not remotable
+ }
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ComponentReferenceTargetNotFound", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java
new file mode 100644
index 0000000000..4fabf946a9
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateComponentNameTestCase.java
@@ -0,0 +1,76 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class DuplicateComponentNameTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateComponentName/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/DuplicateComponentName").toURL().toString()));
+ /*
+ node = SCANode2Factory.createSCANodeWithComposite("DuplicateComponentName/Calculator.composite");
+ */
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("DuplicateComponentName", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java
new file mode 100644
index 0000000000..979e8e389f
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationPropertyNameTestCase.java
@@ -0,0 +1,65 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class DuplicateImplementationPropertyNameTestCase extends TestCase {
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateImplementationPropertyName/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/DuplicateImplementationPropertyName").toURL().toString()));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("DuplicateImplementationPropertyName", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java
new file mode 100644
index 0000000000..4b09a561a2
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateImplementationReferenceNameTestCase.java
@@ -0,0 +1,66 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class DuplicateImplementationReferenceNameTestCase extends TestCase {
+
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateImplementationReferenceName/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/DuplicateImplementationReferenceName").toURL().toString()));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("DuplicateImplementationReferenceName", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java
new file mode 100644
index 0000000000..2313fa6c61
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicatePropertyNameTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class DuplicatePropertyNameTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/DuplicatePropertyName/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/DuplicatePropertyName").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("DuplicateComponentPropertyName", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java
new file mode 100644
index 0000000000..43b7c811d9
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/DuplicateReferenceNameTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class DuplicateReferenceNameTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/DuplicateReferenceName/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/DuplicateReferenceName").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("DuplicateComponentReferenceName", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java
new file mode 100644
index 0000000000..bfb662379b
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/MultipleBindingsForServiceTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class MultipleBindingsForServiceTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/MultipleBindingsForService/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/MultipleBindingsForService").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("MultipleBindingsForService", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java
new file mode 100644
index 0000000000..100a6c2011
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoComponentImplementationTestCase.java
@@ -0,0 +1,69 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class NoComponentImplementationTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/NoComponentImplementation/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/NoComponentImplementation").toURL().toString()));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("NoComponentImplementation", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java
new file mode 100644
index 0000000000..53d1136065
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoCompositeNamespaceTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class NoCompositeNamespaceTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/NoCompositeNamespace/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/NoCompositeNamespace").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("NoCompositeNamespace", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java
new file mode 100644
index 0000000000..700e550467
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java
@@ -0,0 +1,81 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class NoMatchingBindingTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ try {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/NoMatchingBinding/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/NoMatchingBinding").toURL().toString()));
+
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ } catch (Exception ex){
+ // do nothing
+ return;
+ }
+ Assert.fail();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ /*
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("NoMatchingBinding", problem.getMessageId());
+ */
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java
new file mode 100644
index 0000000000..0c14651b16
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedReferenceNotFoundTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PromotedReferenceNotFoundTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/PromotedReferenceNotFound/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/PromotedReferenceNotFound").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PromotedReferenceNotFound", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java
new file mode 100644
index 0000000000..dc384c8047
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PromotedServiceNotFoundTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PromotedServiceNotFoundTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/PromotedServiceNotFound/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/PromotedServiceNotFound").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PromotedServiceNotFound", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java
new file mode 100644
index 0000000000..3435befd97
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeMustSupplyNullTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PropertyAttributeMustSupplyNullTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/PropertyAttribute/CalculatorNullMustSupply.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/PropertyAttribute").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PropertyMustSupplyNull", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java
new file mode 100644
index 0000000000..aea571fead
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyAttributeTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PropertyAttributeTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/PropertyAttribute/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/PropertyAttribute").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PropertyMustSupplyIncompatible", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java
new file mode 100644
index 0000000000..5a1554976c
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyNotFoundTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PropertyNotFoundTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/PropertyNotFound/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/PropertyNotFound").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PropertyNotFound", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java
new file mode 100644
index 0000000000..22d70042aa
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/PropertyOverrideManyAttributeTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PropertyOverrideManyAttributeTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/PropertyAttribute/CalculatorOverrideManyAttribute.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/PropertyAttribute").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PropertyOverrideManyAttribute", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java
new file mode 100644
index 0000000000..c7b691810b
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleComponentInterfaceTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ReferenceIncompatibleComponentInterfaceTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleComponentInterface/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ReferenceIncompatibleComponentInterface").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ReferenceIncompatibleComponentInterface", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java
new file mode 100644
index 0000000000..170e4ff801
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleInterfaceTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ReferenceIncompatibleInterfaceTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleInterface/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ReferenceIncompatibleInterface").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ReferenceIncompatibleInterface", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java
new file mode 100644
index 0000000000..4d4adfbf32
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceIncompatibleMultiplicityTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ReferenceIncompatibleMultiplicityTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceIncompatibleMultiplicity/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ReferenceIncompatibleMultiplicity").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ReferenceIncompatibleMultiplicity", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java
new file mode 100644
index 0000000000..2c239bb003
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceNotFoundTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ReferenceNotFoundTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceNotFound/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ReferenceNotFound").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ReferenceNotFound", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java
new file mode 100644
index 0000000000..a8fb1d07cf
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ReferenceWithoutTargetsTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ReferenceWithoutTargetsTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ReferenceWithoutTargets/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ReferenceWithoutTargets").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ReferenceWithoutTargets", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java
new file mode 100644
index 0000000000..9ea6d8915a
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/ServiceNotFoundForComponentServiceTestCase.java
@@ -0,0 +1,73 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ServiceNotFoundForComponentServiceTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/ServiceNotFoundForComponentService/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/ServiceNotFoundForComponentService").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ServiceNotFoundForComponentService", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java
new file mode 100644
index 0000000000..268a8539e1
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/UnresolvedComponentImplementationTestCase.java
@@ -0,0 +1,69 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class UnresolvedComponentImplementationTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ node = nodeFactory.createSCANode(new File("src/main/resources/UnresolvedComponentImplementation/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/UnresolvedComponentImplementation").toURL().toString()));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ }
+
+ public void testCalculator() throws Exception {
+ ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry();
+ UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = monitorFactory.createMonitor();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("UnresolvedComponentImplementation", problem.getMessageId());
+
+ }
+}
diff --git a/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java
new file mode 100644
index 0000000000..ea771deaca
--- /dev/null
+++ b/sandbox/sebastien/java/sca-node/itest/validation/src/test/java/calculator/warning/XSDValidationTestCase.java
@@ -0,0 +1,78 @@
+/*
+ * 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 calculator.warning;
+
+import java.io.File;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultLoggingMonitorImpl;
+import org.apache.tuscany.sca.node.SCAClient;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+import org.apache.tuscany.sca.node.SCANode2Factory.SCAContribution;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+import org.osoa.sca.ServiceRuntimeException;
+
+import calculator.warning.CalculatorService;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class XSDValidationTestCase extends TestCase {
+
+ private CalculatorService calculatorService;
+ private SCANode2 node;
+ private Exception startUpException;
+
+ @Override
+ protected void setUp() throws Exception {
+ SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
+ try {
+ node = nodeFactory.createSCANode(new File("src/main/resources/XsdValidation/Calculator.composite").toURL().toString(),
+ new SCAContribution("TestContribution",
+ new File("src/main/resources/XsdValidation").toURL().toString()));
+ node.start();
+ calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+ } catch (Exception ex){
+ startUpException = ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if (node != null){
+ node.stop();
+ }
+ }
+
+
+ public void testCalculator() throws Exception {
+
+ assertEquals("org.osoa.sca.ServiceRuntimeException: Unexpected <binding> element found. It should appear inside a <service> or <reference> element.", startUpException.getMessage());
+
+ }
+
+}