summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:13:16 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:13:16 +0000
commit3ac2d800d840f03618fc364090d786effde84b1f (patch)
treee334754cd5c37e1465230497b48cc79584c1f571 /sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml
parent9bed5ae38c581999db465b42b504026a7097af95 (diff)
Moving 1.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835142 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml')
-rw-r--r--sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/ContributionReadException.java61
-rw-r--r--sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java61
-rw-r--r--sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java61
-rw-r--r--sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java61
-rw-r--r--sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java61
-rw-r--r--sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java60
6 files changed, 365 insertions, 0 deletions
diff --git a/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/ContributionReadException.java b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/ContributionReadException.java
new file mode 100644
index 0000000000..9b0d51eb59
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/ContributionReadException.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 assembly.xml;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ContributionReadException extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/assemblyxml/ContributionReadException/Calculator.composite",
+ "TestContribution", "src/main/resources/assemblyxml/ContributionReadException/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("ContributionReadException", problem.getMessageId());
+
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.java
new file mode 100644
index 0000000000..e8476991a9
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyImplValidationException.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 assembly.xml;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PolicyImplValidationException extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/assemblyxml/PolicyImplValidationException/Calculator.composite",
+ "TestContribution", "src/main/resources/assemblyxml/PolicyImplValidationException/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PolicyImplValidationException", problem.getMessageId());
+
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.java
new file mode 100644
index 0000000000..8ae156d63e
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/PolicyServiceValidationException.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 assembly.xml;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class PolicyServiceValidationException extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/assemblyxml/PolicyServiceValidationException/Calculator.composite",
+ "TestContribution", "src/main/resources/assemblyxml/PolicyServiceValidationException/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("PolicyServiceValidationException", problem.getMessageId());
+
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.java
new file mode 100644
index 0000000000..d757ff98dd
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedBindingElement.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 assembly.xml;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class UnexpectedBindingElement extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/assemblyxml/UnexpectedBindingElement/Calculator.composite",
+ "TestContribution", "src/main/resources/assemblyxml/UnexpectedBindingElement/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("UnexpectedBindingElement", problem.getMessageId());
+
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.java
new file mode 100644
index 0000000000..9a231a18c7
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedImplementationElement.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 assembly.xml;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl;
+
+import domain.CustomCompositeBuilder;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class UnexpectedImplementationElement extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/assemblyxml/UnexpectedImplementationElement/Calculator.composite",
+ "TestContribution", "src/main/resources/assemblyxml/UnexpectedImplementationElement/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("UnexpectedImplementationElement", problem.getMessageId());
+
+ }
+}
diff --git a/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.java
new file mode 100644
index 0000000000..4ae88b9ba3
--- /dev/null
+++ b/sca-java-1.x/branches/sca-java-20080910/itest/validation/src/test/java/assembly/xml/UnexpectedInterfaceElement.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 assembly.xml;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl;
+
+import domain.CustomCompositeBuilder;
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class UnexpectedInterfaceElement extends TestCase {
+
+ private CustomCompositeBuilder customDomain;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ customDomain = CustomCompositeBuilder.getInstance();
+ try {
+ customDomain.loadContribution("src/main/resources/assemblyxml/UnexpectedInterfaceElement/Calculator.composite",
+ "TestContribution", "src/main/resources/assemblyxml/UnexpectedInterfaceElement/");
+ } catch (Exception ex){
+ //throw ex;
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //node.stop();
+ }
+
+ public void testCalculator() {
+ Monitor monitor = customDomain.getMonitorInstance();
+ Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem();
+
+ assertNotNull(problem);
+ assertEquals("UnexpectedInterfaceElement", problem.getMessageId());
+
+ }
+}