summaryrefslogtreecommitdiffstats
path: root/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl')
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java61
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java62
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java59
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java61
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java61
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java61
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java64
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java66
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java111
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java64
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java59
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java57
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java59
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java60
-rw-r--r--tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java60
24 files changed, 1505 insertions, 0 deletions
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java
new file mode 100644
index 0000000000..cbc9e199e3
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeUnrecognizedNamespaceTestCase.java
@@ -0,0 +1,61 @@
+/*
+ * 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 org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ System.out.println("AttributeUnrecognizedNamespaceTestCase problem:" + problem.getMessageId());
+ assertEquals("AttributeUnrecognizedNamespace", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.java
new file mode 100644
index 0000000000..eb2eedb340
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/AttributeWithoutNamespaceTestCase.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.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("AttributeWithoutNamespace", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.java
new file mode 100644
index 0000000000..e93918a94c
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/BPELProcessNotFoundTestCase.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.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("BPELProcessNotFound", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java
new file mode 100644
index 0000000000..d711758a21
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/CannotResolveWSDLReferenceTestCase.java
@@ -0,0 +1,62 @@
+/*
+ * 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 org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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() {
+// TUSCANY-2970:tests don't work in continuum build
+
+// Monitor monitor = customDomain.getMonitorInstance();
+// Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+// assertNotNull(problem);
+// assertEquals("CannotResolveWSDLReference", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.java
new file mode 100644
index 0000000000..b6c3b6c7c9
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/MyRolePartnerRoleNullTestCase.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.bpel;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("MyRolePartnerRoleNull", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.java
new file mode 100644
index 0000000000..c623c2b157
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkHasBothAttrTestCase.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.impl.DefaultMonitorImpl;
+
+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
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ assertTrue(((DefaultMonitorImpl)monitor).isMessageLogged("PartnerLinkHasBothAttr"));
+ /*Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+ assertNotNull(problem);
+ assertEquals("PartnerLinkHasBothAttr", problem.getMessageId());*/
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java
new file mode 100644
index 0000000000..311a1fd8e7
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkNoMatchingTypeTestCase.java
@@ -0,0 +1,61 @@
+/*
+ * 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 org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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() {
+// TUSCANY-2970:tests don't work in continuum build
+// Monitor monitor = customDomain.getMonitorInstance();
+// Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+// assertNotNull(problem);
+// assertEquals("PartnerLinkNoMatchingType", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java
new file mode 100644
index 0000000000..999f4a4955
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/bpel/PartnerLinkTypeNoRolesTestCase.java
@@ -0,0 +1,61 @@
+/*
+ * 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.impl.DefaultMonitorImpl;
+
+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
+ }
+
+ public void testCalculator() {
+// TUSCANY-2970:tests don't work in continuum build
+// Monitor monitor = customDomain.getMonitorInstance();
+// assertTrue(((DefaultMonitorImpl)monitor).isMessageLogged("PartnerLinkTypeNoRoles"));
+ /*Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+ assertNotNull(problem);
+ assertEquals("PartnerLinkTypeNoRoles", problem.getMessageId());*/
+
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.java
new file mode 100644
index 0000000000..e0a3216d52
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/ejb/EJBLinkAttributeMissingTestCase.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.ejb;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("EJBLinkAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.java
new file mode 100644
index 0000000000..24d1c197a6
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ClassNotFoundExceptionTestCase.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 org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ClassNotFoundException", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java
new file mode 100644
index 0000000000..e3e38e86c3
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/java/ContributionResolveExceptionTestCase.java
@@ -0,0 +1,61 @@
+/*
+ * 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 org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+
+ assertNotNull(problem);
+ assertEquals("ContributionResolveException", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java
new file mode 100644
index 0000000000..b51403fec1
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/CouldNotLocateOSGiBundleTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.osgi;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CouldNotLocateOSGiBundleTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ //OSGiTestBundles.createBundle("src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class);
+
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/osgi/CouldNotLocateOSGiBundle/osgitest.composite",
+ "TestContribution", "src/main/resources/impl/osgi/CouldNotLocateOSGiBundle/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ OSGiRuntime.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("CouldNotLocateOSGiBundle", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.java
new file mode 100644
index 0000000000..1939455192
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/MissingComponentTypeFileTestCase.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.osgi;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class MissingComponentTypeFileTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ OSGiTestBundles.createBundle("src/main/resources/impl/osgi/MissingComponentTypeFile/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class);
+
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/osgi/MissingComponentTypeFile/osgitest.composite",
+ "TestContribution", "src/main/resources/impl/osgi/MissingComponentTypeFile/");
+ } catch (Exception ex){
+ System.out.println(ex.toString());
+ ex.printStackTrace();
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ OSGiRuntime.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("MissingComponentTypeFile", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java
new file mode 100644
index 0000000000..398c028dd8
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/OSGiTestBundles.java
@@ -0,0 +1,111 @@
+/*
+ * 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.osgi;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.net.URL;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+import java.util.zip.ZipEntry;
+
+
+/**
+ *
+ * Utility class to create OSGi bundles
+ *
+ * @version $Rev$ $Date$
+ */
+public class OSGiTestBundles {
+
+ public static void createBundle(String jarName,
+ Class<?> interfaceClass, Class<?> implClass) throws Exception {
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+ String EOL = System.getProperty("line.separator");
+
+ String packageName = interfaceClass.getPackage().getName();
+ String bundleName = interfaceClass.getName();
+
+ String manifestStr = "Manifest-Version: 1.0" + EOL
+ + "Bundle-ManifestVersion: 2" + EOL + "Bundle-Name: "
+ + bundleName + EOL + "Bundle-SymbolicName: " + bundleName + EOL
+ + "Bundle-Version: " + "1.0.0" + EOL
+ + "Bundle-Localization: plugin" + EOL;
+
+ StringBuilder manifestBuf = new StringBuilder();
+ manifestBuf.append(manifestStr);
+ manifestBuf.append("Export-Package: " + packageName + EOL);
+ manifestBuf.append("Import-Package: org.osgi.framework" + EOL);
+ manifestBuf.append("Bundle-Activator: " + implClass.getName() + EOL);
+
+ ByteArrayInputStream manifestStream = new ByteArrayInputStream(manifestBuf.toString().getBytes());
+ Manifest manifest = new Manifest();
+ manifest.read(manifestStream);
+
+
+ JarOutputStream jarOut = new JarOutputStream(out, manifest);
+
+ String interfaceClassName = interfaceClass.getName().replaceAll("\\.",
+ "/")
+ + ".class";
+
+ URL url = interfaceClass.getClassLoader().getResource(
+ interfaceClassName);
+ String path = url.getPath();
+
+ ZipEntry ze = new ZipEntry(interfaceClassName);
+
+ jarOut.putNextEntry(ze);
+ FileInputStream file = new FileInputStream(path);
+ byte[] fileContents = new byte[file.available()];
+ file.read(fileContents);
+ jarOut.write(fileContents);
+
+ String implClassName = implClass.getName().replaceAll("\\.",
+ "/")
+ + ".class";
+
+ url = implClass.getClassLoader().getResource(implClassName);
+ path = url.getPath();
+
+ ze = new ZipEntry(implClassName);
+
+ jarOut.putNextEntry(ze);
+ file = new FileInputStream(path);
+ fileContents = new byte[file.available()];
+ file.read(fileContents);
+ jarOut.write(fileContents);
+
+ file.close();
+
+ jarOut.close();
+ out.close();
+
+ FileOutputStream fileOut = new FileOutputStream(jarName);
+ fileOut.write(out.toByteArray());
+ fileOut.close();
+
+
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java
new file mode 100644
index 0000000000..4a82f569de
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/osgi/PropertyShouldSpecifySRTestCase.java
@@ -0,0 +1,64 @@
+/*
+ * 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.osgi;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+import org.apache.tuscany.sca.osgi.runtime.OSGiRuntime;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PropertyShouldSpecifySRTestCase extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ OSGiTestBundles.createBundle("src/main/resources/impl/osgi/PropertyShouldSpecifySR/OSGiTestService.jar", OSGiTestInterface.class, OSGiTestImpl.class);
+
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/impl/osgi/PropertyShouldSpecifySR/osgitest.composite",
+ "TestContribution", "src/main/resources/impl/osgi/PropertyShouldSpecifySR/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //nothing to do
+ OSGiRuntime.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PropertyShouldSpecifySR", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.java
new file mode 100644
index 0000000000..5881d866a0
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/CouldNotResolveLocationTestCase.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.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ Assert.assertNotNull(problem);
+ Assert.assertEquals("CouldNotResolveLocation", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..8fefaa05eb
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/resource/LocationAttributeMissingTestCase.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.resource;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java
new file mode 100644
index 0000000000..ebdd05d980
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/ContributionResolveExceptionTestCase.java
@@ -0,0 +1,57 @@
+/*
+ * 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.impl.DefaultMonitorImpl;
+
+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();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ assertTrue(((DefaultMonitorImpl)monitor).isMessageLogged("ContributionResolveException"));
+ //assertEquals("ContributionResolveException", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..7974aa5daf
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/LocationAttributeMissingTestCase.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.spring;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.java
new file mode 100644
index 0000000000..0ad7bc0918
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/spring/UnableToResolveComponentTypeTestCase.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.spring;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ //assertNotNull(problem);
+ //assertEquals("UnableToResolveComponentType", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.java
new file mode 100644
index 0000000000..3935afa79c
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/CouldNotResolveLocationTestCase.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.Assert;
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ Assert.assertNotNull(problem);
+ Assert.assertEquals("CouldNotResolveLocation", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..daf8eab56f
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/widget/LocationAttributeMissingTestCase.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.widget;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.java
new file mode 100644
index 0000000000..3dbbc61d9c
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/CouldNotLocateFileTestCase.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.xquery;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("CouldNotLocateFile", problem.getMessageId());
+ }
+}
diff --git a/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.java
new file mode 100644
index 0000000000..584c11c061
--- /dev/null
+++ b/tags/java/sca/1.5.1-RC1/itest/validation/src/test/java/impl/xquery/LocationAttributeMissingTestCase.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.xquery;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.impl.DefaultMonitorImpl;
+
+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 = ((DefaultMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("LocationAttributeMissing", problem.getMessageId());
+ }
+}