Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 70766 invoked from network); 27 Dec 2007 15:30:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Dec 2007 15:30:59 -0000 Received: (qmail 89050 invoked by uid 500); 27 Dec 2007 15:30:47 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 88986 invoked by uid 500); 27 Dec 2007 15:30:47 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 88944 invoked by uid 99); 27 Dec 2007 15:30:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2007 07:30:46 -0800 X-ASF-Spam-Status: No, hits=-98.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Dec 2007 15:30:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3068D1A9832; Thu, 27 Dec 2007 07:30:21 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r607079 - in /incubator/cxf/trunk/tools/wsdlto: frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ test/src/test/resources/wsdl2java_wsdl/cxf-1344/ Date: Thu, 27 Dec 2007 15:30:20 -0000 To: cxf-commits@incubator.apache.org From: ema@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071227153021.3068D1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ema Date: Thu Dec 27 07:30:19 2007 New Revision: 607079 URL: http://svn.apache.org/viewvc?rev=607079&view=rev Log: [CXF-1334]Fixed the duplicate Handler annotation issue Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?rev=607079&r1=607078&r2=607079&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java (original) +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java Thu Dec 27 07:30:19 2007 @@ -21,6 +21,8 @@ import java.util.Map; +import javax.jws.HandlerChain; + import org.apache.cxf.common.i18n.Message; import org.apache.cxf.service.model.ServiceInfo; import org.apache.cxf.tools.common.ToolConstants; @@ -89,10 +91,17 @@ handlerGen.generate(getEnvironment()); JAnnotation annot = handlerGen.getHandlerAnnotation(); - if (handlerGen.getHandlerAnnotation() != null - && !intf.getAnnotations().contains(annot)) { - intf.addAnnotation(annot); - intf.addImport("javax.jws.HandlerChain"); + if (handlerGen.getHandlerAnnotation() != null) { + boolean existHandlerAnno = false; + for (JAnnotation jann : intf.getAnnotations()) { + if (jann.getType() == HandlerChain.class) { + existHandlerAnno = true; + } + } + if (!existHandlerAnno) { + intf.addAnnotation(annot); + intf.addImport("javax.jws.HandlerChain"); + } } } clearAttributes(); Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?rev=607079&r1=607078&r2=607079&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java (original) +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java Thu Dec 27 07:30:19 2007 @@ -21,6 +21,8 @@ import java.util.Map; +import javax.jws.HandlerChain; + import org.apache.cxf.common.i18n.Message; import org.apache.cxf.service.model.ServiceInfo; import org.apache.cxf.tools.common.ToolConstants; @@ -83,10 +85,20 @@ handlerGen.generate(getEnvironment()); JAnnotation annot = handlerGen.getHandlerAnnotation(); - if (handlerGen.getHandlerAnnotation() != null - && !js.getAnnotations().contains(annot)) { - js.addAnnotation(annot); + + if (handlerGen.getHandlerAnnotation() != null) { + boolean existHandlerAnno = false; + for (JAnnotation jann : js.getAnnotations()) { + if (jann.getType() == HandlerChain.class) { + existHandlerAnno = true; + } + } + if (!existHandlerAnno) { + js.addAnnotation(annot); + js.addImport("javax.jws.HandlerChain"); + } } + } for (JavaPort port : js.getPorts()) { Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=607079&r1=607078&r2=607079&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java (original) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java Thu Dec 27 07:30:19 2007 @@ -1164,8 +1164,7 @@ assertTrue(e.getMessage().indexOf(": is not a valid char in the targetNamespace") != -1); } } - //TODO:This will be removed when runtime supports this mapping - //@org.junit.Ignore + public void testW3CEPR() throws Exception { env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/w3c-epr.wsdl")); processor.setContext(env); @@ -1175,6 +1174,14 @@ new Class[]{javax.xml.ws.wsaddressing.W3CEndpointReference.class}); assertNotNull("wsdl2java does not map w3c:EndpointReferenceType to javax.xml.ws.EndpointReference" , method); + } + + @Test + public void testHandlerAnnotation() throws Exception { + env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl")); + env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf-1344/handlerbinding.xml")); + processor.setContext(env); + processor.execute(); } } Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl?rev=607079&view=auto ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl (added) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl Thu Dec 27 07:30:19 2007 @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml?rev=607079&view=auto ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml (added) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml Thu Dec 27 07:30:19 2007 @@ -0,0 +1,41 @@ + + + + + + + ns1:SOAPService_Test1 + + LogHandler + org.apache.cxf.LogHandler + + + + + ns1:SoapPort_Test1 + + LogHandler2 + org.apache.cxf.LogHandler2 + + + + + + \ No newline at end of file