summaryrefslogtreecommitdiffstats
path: root/java/sca/contrib/itest/validation/src/test/java/impl
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/contrib/itest/validation/src/test/java/impl')
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java68
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java69
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java60
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java58
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java66
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java58
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java59
-rw-r--r--java/sca/contrib/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java59
20 files changed, 1205 insertions, 0 deletions
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java
new file mode 100644
index 0000000000..690fb97a31
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class AttributeUnrecognizedNamespaceTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/AttributeUnrecognizedNamespace/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/AttributeUnrecognizedNamespace/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("AttributeUnrecognizedNamespace", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java
new file mode 100644
index 0000000000..a768535fde
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class AttributeWithoutNamespaceTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/AttributeWithoutNamespace/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/AttributeWithoutNamespace/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("AttributeWithoutNamespace", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java
new file mode 100644
index 0000000000..64d41bdb48
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class BPELProcessNotFoundTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/BPELProcessNotFound/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/BPELProcessNotFound/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("BPELProcessNotFound", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java
new file mode 100644
index 0000000000..585bd62027
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CannotResolveWSDLReferenceTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/CannotResolveWSDLReference/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/CannotResolveWSDLReference/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("CannotResolveWSDLReference", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java
new file mode 100644
index 0000000000..aab3529fba
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class MyRolePartnerRoleNullTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/MyRolePartnerRoleNull/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/MyRolePartnerRoleNull/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("MyRolePartnerRoleNull", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java
new file mode 100644
index 0000000000..4c3226f4c8
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java
@@ -0,0 +1,68 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PartnerLinkHasBothAttrTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/PartnerLinkHasBothAttr/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/PartnerLinkHasBothAttr/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ private static boolean isMessageLogged(Monitor monitor, String messageId) {
+ for (Problem problem : monitor.getProblems()){
+ if (problem.getMessageId().equals(messageId)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ assertTrue(isMessageLogged(monitor, "PartnerLinkHasBothAttr"));
+ /*Problem problem = monitor.getLastLoggedProblem();
+ assertNotNull(problem);
+ assertEquals("PartnerLinkHasBothAttr", problem.getMessageId());*/
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java
new file mode 100644
index 0000000000..b9c0b68f7e
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PartnerLinkNoMatchingTypeTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/PartnerLinkNoMatchingType/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/PartnerLinkNoMatchingType/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("PartnerLinkNoMatchingType", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java
new file mode 100644
index 0000000000..fc32e96b52
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.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 impl.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PartnerLinkTypeNoRolesTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/bpel/PartnerLinkTypeNoRoles/helloworld.composite",
+ "TestContribution", "src/main/resources/impl/bpel/PartnerLinkTypeNoRoles/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ private static boolean isMessageLogged(Monitor monitor, String messageId) {
+ for (Problem problem : monitor.getProblems()){
+ if (problem.getMessageId().equals(messageId)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ assertTrue(isMessageLogged(monitor, "PartnerLinkTypeNoRoles"));
+ /*Problem problem = monitor.getLastLoggedProblem();
+ assertNotNull(problem);
+ assertEquals("PartnerLinkTypeNoRoles", problem.getMessageId());*/
+
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java
new file mode 100644
index 0000000000..4b367f85ef
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.ejb;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class EJBLinkAttributeMissingTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/ejb/EJBLinkAttributeMissing/ejb.composite",
+ "TestContribution", "src/main/resources/impl/ejb/EJBLinkAttributeMissing/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("EJBLinkAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java
new file mode 100644
index 0000000000..969690acaf
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.java;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ClassNotFoundExceptionTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/java/ClassNotFoundException/Calculator.composite",
+ "TestContribution", "src/main/resources/impl/java/ClassNotFoundException/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("ClassNotFoundException", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java
new file mode 100644
index 0000000000..eef964e274
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java
@@ -0,0 +1,60 @@
+/*
+ * 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 impl.java;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ContributionResolveExceptionTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/java/ContributionResolveException/Calculator.composite",
+ "TestContribution", "src/main/resources/impl/java/ContributionResolveException/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+
+ assertNotNull(problem);
+ assertEquals("ContributionResolveException", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java
new file mode 100644
index 0000000000..c2fd7b3410
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package impl.resource;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CouldNotResolveLocationTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/resource/CouldNotResolveLocation/resource.composite",
+ "TestContribution", "src/main/resources/impl/resource/CouldNotResolveLocation/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ Assert.assertNotNull(problem);
+ Assert.assertEquals("CouldNotResolveLocation", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..c6a58d2b88
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.resource;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class LocationAttributeMissingTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/resource/LocationAttributeMissing/resource.composite",
+ "TestContribution", "src/main/resources/impl/resource/LocationAttributeMissing/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java
new file mode 100644
index 0000000000..ff0b2f3589
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.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 impl.spring;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ContributionResolveExceptionTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/spring/ContributionResolveException/SpringHelloWorld.composite",
+ "TestContribution", "src/main/resources/impl/spring/ContributionResolveException/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ private static boolean isMessageLogged(Monitor monitor, String messageId) {
+ for (Problem problem : monitor.getProblems()){
+ if (problem.getMessageId().equals(messageId)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ assertTrue(isMessageLogged(monitor, "ContributionResolveException"));
+ //assertEquals("ContributionResolveException", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..7b445960f1
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.spring;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class LocationAttributeMissingTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/spring/LocationAttributeMissing/SpringHelloWorld.composite",
+ "TestContribution", "src/main/resources/impl/spring/LocationAttributeMissing/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java
new file mode 100644
index 0000000000..6b4521cdc9
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.spring;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class UnableToResolveComponentTypeTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/spring/UnableToResolveComponentType/SpringHelloWorld.composite",
+ "TestContribution", "src/main/resources/impl/spring/UnableToResolveComponentType/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ //assertNotNull(problem);
+ //assertEquals("UnableToResolveComponentType", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java
new file mode 100644
index 0000000000..f46e9e4035
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package impl.widget;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CouldNotResolveLocationTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/widget/CouldNotResolveLocation/widget.composite",
+ "TestContribution", "src/main/resources/impl/widget/CouldNotResolveLocation/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ Assert.assertNotNull(problem);
+ Assert.assertEquals("CouldNotResolveLocation", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..ed95bcdcf0
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.widget;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class LocationAttributeMissingTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/widget/LocationAttributeMissing/widget.composite",
+ "TestContribution", "src/main/resources/impl/widget/LocationAttributeMissing/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java
new file mode 100644
index 0000000000..bd5a6d9601
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.xquery;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CouldNotLocateFileTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/xquery/CouldNotLocateFile/HelloWorld.composite",
+ "TestContribution", "src/main/resources/impl/xquery/CouldNotLocateFile/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("CouldNotLocateFile", problem.getMessageId());
+ }
+}
diff --git a/java/sca/contrib/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java b/java/sca/contrib/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..390eeb7e95
--- /dev/null
+++ b/java/sca/contrib/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java
@@ -0,0 +1,59 @@
+/*
+ * 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 impl.xquery;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class LocationAttributeMissingTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/xquery/LocationAttributeMissing/HelloWorld.composite",
+ "TestContribution", "src/main/resources/impl/xquery/LocationAttributeMissing/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = monitor.getLastProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}