From bb2aadc32654a0e70ab209cb3cbcecdc768068b9 Mon Sep 17 00:00:00 2001 From: nash Date: Fri, 5 Dec 2008 00:03:14 +0000 Subject: Add validation test case and further updates for TUSCANY-2698 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@723501 13f79535-47bb-0310-9956-ffa450edef68 --- .../wsxml/MissingImportedXSD/helloworld.wsdl | 76 ++++++++++++++++++++++ .../MissingImportedXSD/helloworldwsjms.composite | 34 ++++++++++ .../binding/wsxml/MissingImportedXSDTestCase.java | 64 ++++++++++++++++++ .../binding/ws/xml/WebServiceBindingProcessor.java | 8 +-- .../wsdl/xml/WSDLInterfaceProcessor.java | 10 ++- .../impl/ContributionContentProcessor.java | 4 +- 6 files changed, 189 insertions(+), 7 deletions(-) create mode 100644 branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworld.wsdl create mode 100644 branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworldwsjms.composite create mode 100644 branches/sca-java-1.x/itest/validation/src/test/java/binding/wsxml/MissingImportedXSDTestCase.java diff --git a/branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworld.wsdl b/branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworld.wsdl new file mode 100644 index 0000000000..ce3689afff --- /dev/null +++ b/branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworld.wsdl @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworldwsjms.composite b/branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworldwsjms.composite new file mode 100644 index 0000000000..61a9dae367 --- /dev/null +++ b/branches/sca-java-1.x/itest/validation/src/main/resources/binding/wsxml/MissingImportedXSD/helloworldwsjms.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/branches/sca-java-1.x/itest/validation/src/test/java/binding/wsxml/MissingImportedXSDTestCase.java b/branches/sca-java-1.x/itest/validation/src/test/java/binding/wsxml/MissingImportedXSDTestCase.java new file mode 100644 index 0000000000..0ceae597fb --- /dev/null +++ b/branches/sca-java-1.x/itest/validation/src/test/java/binding/wsxml/MissingImportedXSDTestCase.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 binding.wsxml; + +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 MissingImportedXSDTestCase extends TestCase { + + private CustomCompositeBuilder customDomain; + + @Override + protected void setUp() throws Exception + { + customDomain = CustomCompositeBuilder.getInstance(); + try { + customDomain.loadContribution("src/main/resources/binding/wsxml/MissingImportedXSD/helloworldwsjms.composite", + "TestContribution", "src/main/resources/binding/wsxml/MissingImportedXSD/"); + } catch (Exception ex) { + //throw ex; + } + } + + @Override + protected void tearDown() throws Exception { + //node.stop(); + } + + public void testCalculator() { + Monitor monitor = customDomain.getMonitorInstance(); + + Problem problem = ((DefaultMonitorImpl)monitor).getProblems().get(0); + assertNotNull(problem); + assertEquals("ContributionResolveException", problem.getMessageId()); + + problem = ((DefaultMonitorImpl)monitor).getLastLoggedProblem(); + assertNotNull(problem); + assertEquals("InvalidInterfaceException", problem.getMessageId()); + } +} diff --git a/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java index 860daa647d..980003ddf1 100644 --- a/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java +++ b/branches/sca-java-1.x/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java @@ -343,10 +343,10 @@ public class WebServiceBindingProcessor implements StAXArtifactProcessor