geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r520746 - in /geronimo/server/trunk/modules: geronimo-axis2/ geronimo-axis2/src/main/java/org/apache/geronimo/axis2/ geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/ geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/...
Date Wed, 21 Mar 2007 04:47:55 GMT
Author: dims
Date: Tue Mar 20 21:47:54 2007
New Revision: 520746

URL: http://svn.apache.org/viewvc?view=rev&rev=520746
Log:
Get failing test to work. When trying to load HandlerChainsType, we have to use HandlerChainsDocument's
Factory to parse the xml 

Modified:
    geronimo/server/trunk/modules/geronimo-axis2/pom.xml
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AnnotationHandlerChainBuilder.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
    geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2HandlerResolverTest.java
    geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java

Modified: geronimo/server/trunk/modules/geronimo-axis2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/pom.xml?view=diff&rev=520746&r1=520745&r2=520746
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/pom.xml (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/pom.xml Tue Mar 20 21:47:54 2007
@@ -186,15 +186,12 @@
     
     <build>
         <plugins>
-            <!--
-            HACK: Disable Axis2HandlerResolverTest until Dimms can fix it... :-(
-            -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
                     <excludes>
-                        <exclude>**/Axis2HandlerResolverTest.java</exclude>
+                        <!--<exclude>**/Axis2HandlerResolverTest.java</exclude>-->
                     </excludes>
                 </configuration>
             </plugin>

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AnnotationHandlerChainBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AnnotationHandlerChainBuilder.java?view=diff&rev=520746&r1=520745&r2=520746
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AnnotationHandlerChainBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AnnotationHandlerChainBuilder.java
Tue Mar 20 21:47:54 2007
@@ -22,6 +22,7 @@
 import org.apache.geronimo.xbeans.javaee.HandlerChainType;
 import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
 import org.apache.geronimo.xbeans.javaee.PortComponentHandlerType;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsDocument;
 
 import javax.jws.HandlerChain;
 import javax.xml.ws.WebServiceException;
@@ -59,7 +60,7 @@
             HandlerChainType hc = null;
             try {
                 URL handlerFileURL = clz.getResource(hcAnn.getFileName());
-                HandlerChainsType handlerChainsType = HandlerChainsType.Factory.parse(handlerFileURL);
+                HandlerChainsType handlerChainsType = HandlerChainsDocument.Factory.parse(handlerFileURL).getHandlerChains();
 
                 if (null == handlerChainsType || handlerChainsType.getHandlerChainArray()
== null) {
                     throw new WebServiceException("Chain not specified");

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java?view=diff&rev=520746&r1=520745&r2=520746
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/client/Axis2ServiceReference.java
Tue Mar 20 21:47:54 2007
@@ -22,14 +22,14 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.axis2.Axis2HandlerResolver;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.jaxws.HandlerChainsUtils;
 import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
 import org.apache.geronimo.jaxws.JNDIResolver;
 import org.apache.geronimo.jaxws.client.EndpointInfo;
 import org.apache.geronimo.jaxws.client.JAXWSServiceReference;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsDocument;
 import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
+import org.apache.xmlbeans.XmlException;
 
-import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
 import javax.xml.ws.handler.HandlerResolver;
 import java.net.URI;
@@ -55,9 +55,8 @@
 
     protected HandlerChainsType getHandlerChains() {
         try {
-            return HandlerChainsUtils.toHandlerChains(this.handlerChainsXML, HandlerChainsType.class);
-        } catch (JAXBException e) {
-            // this should not happen
+            return HandlerChainsDocument.Factory.parse(this.handlerChainsXML).getHandlerChains();
+        } catch (XmlException e) {
             log.warn("Failed to deserialize handler chains", e);
             return null;
         }

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java?view=diff&rev=520746&r1=520745&r2=520746
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
Tue Mar 20 21:47:54 2007
@@ -35,6 +35,7 @@
 import org.apache.geronimo.jaxws.PortInfo;
 import org.apache.geronimo.jaxws.annotations.AnnotationException;
 import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsDocument;
 
 import javax.naming.Context;
 import javax.xml.ws.WebServiceException;
@@ -115,7 +116,8 @@
      * performs injection.
      */
     protected void configureHandlers() throws Exception {
-        HandlerChainsType handlerChains = this.portInfo.getHandlers(HandlerChainsType.class);
+        String xml = this.portInfo.getHandlersAsXML();
+        HandlerChainsType handlerChains = xml == null ? null : HandlerChainsDocument.Factory.parse(xml).getHandlerChains();
         Axis2HandlerResolver handlerResolver =
             new Axis2HandlerResolver(endpointInstance.getClass().getClassLoader(),
                                    endpointInstance.getClass(),

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2HandlerResolverTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2HandlerResolverTest.java?view=diff&rev=520746&r1=520745&r2=520746
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2HandlerResolverTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/test/java/org/apache/geronimo/axis2/Axis2HandlerResolverTest.java
Tue Mar 20 21:47:54 2007
@@ -16,22 +16,17 @@
  */
 package org.apache.geronimo.axis2;
 
-import java.io.InputStream;
-import java.util.List;
+import org.apache.geronimo.testsupport.TestSupport;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsDocument;
+import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
+import org.apache.xmlbeans.XmlException;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
 import javax.xml.namespace.QName;
-import javax.xml.transform.stream.StreamSource;
-
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.PortInfo;
-
-import org.apache.geronimo.xbeans.javaee.HandlerChainsType;
-
-import org.apache.geronimo.testsupport.TestSupport;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
 
 public class Axis2HandlerResolverTest extends TestSupport {
 
@@ -53,7 +48,7 @@
     public void testServiceMatching() throws Exception {
         InputStream in = getClass().getResourceAsStream("/handlers_service.xml");
         assertTrue(in != null);
-        HandlerChainsType handlerChains = toHandlerChains(in); 
+        HandlerChainsType handlerChains = toHandlerChains(in);
         assertEquals(3, handlerChains.getHandlerChainArray().length);
         
         Axis2HandlerResolver resolver = 
@@ -166,15 +161,8 @@
         assertEquals(1, handlers.size());
     }
     
-    private static HandlerChainsType toHandlerChains(InputStream input)
-            throws JAXBException {
-        JAXBContext ctx = JAXBContext.newInstance(HandlerChainsType.class);
-        Unmarshaller unmarshaller = ctx.createUnmarshaller();
-        StreamSource in = new StreamSource(input);
-        JAXBElement handlerElement = unmarshaller.unmarshal(in,
-                HandlerChainsType.class);
-
-        return (HandlerChainsType) handlerElement.getValue();
+    private static HandlerChainsType toHandlerChains(InputStream input) throws IOException,
XmlException {
+        return HandlerChainsDocument.Factory.parse(input).getHandlerChains();
     }
     
     private static class TestPortInfo implements PortInfo {

Modified: geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java?view=diff&rev=520746&r1=520745&r2=520746
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/PortInfo.java
Tue Mar 20 21:47:54 2007
@@ -164,4 +164,12 @@
         return "[" + serviceName + ":" + portName + ":" + seiInterfaceName
                 + ":" + wsdlFile + "]";
     }
+
+    public String getHandlersAsXML() {
+        return handlersAsXML;
+    }
+
+    public void setHandlersAsXML(String handlersAsXML) {
+        this.handlersAsXML = handlersAsXML;
+    }
 }



Mime
View raw message