Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 13459 invoked from network); 25 Aug 2008 14:26:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Aug 2008 14:26:53 -0000 Received: (qmail 2693 invoked by uid 500); 25 Aug 2008 14:26:51 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 2646 invoked by uid 500); 25 Aug 2008 14:26:51 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 2637 invoked by uid 99); 25 Aug 2008 14:26:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 07:26:50 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 14:25:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E8CAB2388A03; Mon, 25 Aug 2008 07:25:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r688735 - in /cxf/trunk/tools: validator/src/main/java/org/apache/cxf/tools/validator/internal/ wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/ Date: Mon, 25 Aug 2008 14:25:50 -0000 To: commits@cxf.apache.org From: seanoc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080825142550.E8CAB2388A03@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: seanoc Date: Mon Aug 25 07:25:49 2008 New Revision: 688735 URL: http://svn.apache.org/viewvc?rev=688735&view=rev Log: Fix for https://issues.apache.org/jira/browse/CXF-1694 NPE with invalid wsld:impor Added: cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/ cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/child.wsdl cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/test.wsdl Modified: cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Modified: cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java URL: http://svn.apache.org/viewvc/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java?rev=688735&r1=688734&r2=688735&view=diff ============================================================================== --- cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java (original) +++ cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java Mon Aug 25 07:25:49 2008 @@ -247,7 +247,7 @@ vNode.getPlainText())); } } - } catch (ToolException e) { + } catch (Exception e) { this.vResults.addError(e.getMessage()); return false; } @@ -393,7 +393,7 @@ } @SuppressWarnings("unchecked") - private void collectValidationPoints() { + private void collectValidationPoints() throws Exception { if (services.size() == 0) { LOG.log(Level.WARNING, "WSDL document " + this.definition.getDocumentBaseURI() + " does not define any services"); @@ -407,7 +407,7 @@ collectValidationPointsForMessages(); } - private void collectValidationPointsForBindings() { + private void collectValidationPointsForBindings() throws Exception { Map vBindingNodes = new HashMap(); for (Service service : services.values()) { vBindingNodes.putAll(getBindings(service)); @@ -415,6 +415,12 @@ for (QName bName : vBindingNodes.keySet()) { Binding binding = this.definition.getBinding(bName); + if (binding == null) { + LOG.log(Level.SEVERE, bName.toString() + + " is not correct, please check that the correct namespace is being used"); + throw new Exception(bName.toString() + + " is not correct, please check that the correct namespace is being used"); + } XNode vBindingNode = getXNode(binding); vBindingNode.setFailurePoint(vBindingNodes.get(bName)); vNodes.add(vBindingNode); Modified: cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=688735&r1=688734&r2=688735&view=diff ============================================================================== --- cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original) +++ cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Mon Aug 25 07:25:49 2008 @@ -1041,5 +1041,18 @@ assertEquals("GreeterSOAPService", webServiceAnn.serviceName()); assertEquals("PingSoapPort", webServiceAnn.portName()); } + + + @Test + public void testCXF1694() throws Exception { + + try { + env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf1694/test.wsdl")); + processor.setContext(env); + processor.execute(); + } catch (Exception ex) { + assertTrue(ex.getMessage().contains("{http://child/}Binding is not correct")); + } + } } Added: cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/child.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/child.wsdl?rev=688735&view=auto ============================================================================== --- cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/child.wsdl (added) +++ cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/child.wsdl Mon Aug 25 07:25:49 2008 @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/test.wsdl URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/test.wsdl?rev=688735&view=auto ============================================================================== --- cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/test.wsdl (added) +++ cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1694/test.wsdl Mon Aug 25 07:25:49 2008 @@ -0,0 +1,3 @@ + + + \ No newline at end of file