Author: nthaker Date: Wed Apr 28 19:23:09 2010 New Revision: 939058 URL: http://svn.apache.org/viewvc?rev=939058&view=rev Log: Adding Debug information in metadata module and test cases for Legacy @Webmethod changes made in revision 939003.
Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/LegacyMethodRetrieverImpl.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLExtensionUtils.java axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java Wed Apr 28 19:23:09 2010 @@ -233,7 +233,7 @@ public class DescriptionFactoryImpl { public static List<ServiceDescription> createServiceDescriptionFromDBCMap( HashMap<String, DescriptionBuilderComposite> dbcMap, ConfigurationContext configContext, boolean performVaidation) { if (log.isDebugEnabled()) { - log.debug("createServiceDescriptionFromDBCMap(Hashmap<String,DescriptionBuilderComposite>,ConfigurationContext,boolean isValid " ); + log.debug("createServiceDescriptionFromDBCMap(Hashmap<String,DescriptionBuilderComposite>,ConfigurationContext,boolean performVaidation " ); } List<ServiceDescription> serviceDescriptionList = new ArrayList<ServiceDescription>(); Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Wed Apr 28 19:23:09 2010 @@ -340,7 +340,7 @@ public class EndpointDescriptionImpl properties, Integer portCompositeIndex) { if (log.isDebugEnabled()) { - log.debug("entry "); + log.debug("entry EndpointDescriptionImpl(ServiceDescriptionImpl, String, Map<String, Object>, Integer)"); log.debug(" parent=" + parent); log.debug(" serviceImplName=" + parent); log.debug(" portCompositeIndex=" + portCompositeIndex); @@ -605,7 +605,7 @@ public class EndpointDescriptionImpl setupReleaseResources(composite.getConfigurationContext()); releaseAxisServiceResources(); if (log.isDebugEnabled()) { - log.debug("exit"); + log.debug("exit EndpointDescriptionImpl(ServiceDescriptionImpl, String, Map<String, Object>, Integer)"); } } @@ -1697,6 +1697,9 @@ public class EndpointDescriptionImpl //configuration can be overridden. Should only be called on the //server side. private void configureWebServiceFeatures() { + if(log.isDebugEnabled()){ + log.debug("Start configureWebServiceFeatures()."); + } String bindingType = getBindingType(); Set<String> ids = ServerConfiguratorRegistry.getIds(); @@ -1726,7 +1729,10 @@ public class EndpointDescriptionImpl if (log.isDebugEnabled()) { log.debug("No WebServiceFeatureAnnotation instances were found on the composite."); } - } + } + if(log.isDebugEnabled()){ + log.debug("Exit configureWebServiceFeatures()."); + } } public Definition getWSDLDefinition() { Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/LegacyMethodRetrieverImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/LegacyMethodRetrieverImpl.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/LegacyMethodRetrieverImpl.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/LegacyMethodRetrieverImpl.java Wed Apr 28 19:23:09 2010 @@ -143,7 +143,6 @@ public class LegacyMethodRetrieverImpl e retrieveList = removeOverriddenMethods(retrieveList, dbc, eid); }//Done with implied SEI's - return retrieveList.iterator(); } Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/feature/ServerFramework.java Wed Apr 28 19:23:09 2010 @@ -81,6 +81,9 @@ public class ServerFramework { } public void configure(EndpointDescription endpointDescription) { + if(log.isDebugEnabled()){ + log.debug("Start ServerFramework.conigure(EndpointDescription)"); + } for (Annotation annotation : getAllAnnotations()) { WebServiceFeatureAnnotation wsfAnnotation = getWebServiceFeatureAnnotation(annotation); ServerConfigurator configurator = configuratorMap.get(wsfAnnotation.id()); @@ -96,6 +99,9 @@ public class ServerFramework { log.debug("Completed " + configurator.getClass().getName() + ".configure()"); } } + if(log.isDebugEnabled()){ + log.debug("Exit ServerFramework.conigure(EndpointDescription)"); + } } private WebServiceFeatureAnnotation getWebServiceFeatureAnnotation(Annotation annotation) { Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/server/config/RespectBindingConfigurator.java Wed Apr 28 19:23:09 2010 @@ -65,6 +65,9 @@ public class RespectBindingConfigurator * @see org.apache.axis2.jaxws.feature.WebServiceFeatureConfigurator#configure(org.apache.axis2.jaxws.description.EndpointDescription) */ public void configure(EndpointDescription endpointDescription) { + if(log.isDebugEnabled()){ + log.debug("Invoking RespectBindingConfiguration.configure() on Server"); + } RespectBinding annotation = (RespectBinding) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(RespectBindingFeature.ID); @@ -95,6 +98,9 @@ public class RespectBindingConfigurator log.debug("No @RespectBinding annotation was found."); } } + if(log.isDebugEnabled()){ + log.debug("Exit from RespectBindingConfiguration.configure() on Server."); + } } /* * (non-Javadoc) Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLExtensionUtils.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLExtensionUtils.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLExtensionUtils.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/util/WSDLExtensionUtils.java Wed Apr 28 19:23:09 2010 @@ -134,6 +134,9 @@ public class WSDLExtensionUtils { } private static void processWSDLElement(WSDLElement wsdlElement, Set<WSDLValidatorElement> set, List<QName> unusedExtensions){ + if(log.isDebugEnabled()){ + log.debug("Start processWSDLElement"); + } List list = wsdlElement.getExtensibilityElements(); if (list == null || list.size() == 0) { return; @@ -172,6 +175,9 @@ public class WSDLExtensionUtils { } } } + if(log.isDebugEnabled()){ + log.debug("Exit processWSDLElement"); + } } public static void processExtensions(EndpointDescription endpointDescription){ Modified: axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java?rev=939058&r1=939057&r2=939058&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/test/org/apache/axis2/jaxws/description/AnnotationServiceImplDescriptionTests.java Wed Apr 28 19:23:09 2010 @@ -23,8 +23,14 @@ package org.apache.axis2.jaxws.descripti import junit.framework.TestCase; import org.apache.axis2.description.AxisService; import org.apache.axis2.description.Parameter; +import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite; import org.apache.axis2.jaxws.description.builder.MDQConstants; +import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite; import org.apache.axis2.jaxws.description.echo.EchoServiceImplWithSEI; +import org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl; +import org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl; +import org.apache.axis2.jaxws.description.impl.EndpointInterfaceDescriptionImpl; +import org.apache.axis2.jaxws.description.impl.LegacyMethodRetrieverImpl; import org.apache.axis2.jaxws.util.WSToolingUtils; import org.apache.log4j.BasicConfigurator; @@ -39,6 +45,7 @@ import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; import java.io.IOException; +import java.util.Iterator; /** * Tests the creation of the Description classes based on a service implementation bean and various @@ -546,7 +553,31 @@ public class AnnotationServiceImplDescri //Less than 2.1.6 so should fail assertFalse(WSToolingUtils.isValidVersion("2.1.1")); } + + public void testWebMethodOldBehavior3() { + try { + + if (WSToolingUtils.isValidVersion(WSToolingUtils.getWsGenVersion())) { + System.setProperty(MDQConstants.USE_LEGACY_WEB_METHOD_RULES, "true"); + //Try new behavior + } + } catch (ClassNotFoundException e) { + } catch (IOException ioex) { + } + EndpointInterfaceDescriptionImpl testEndpointInterfaceDesc = + (EndpointInterfaceDescriptionImpl)getEndpointInterfaceDesc(WebMethodLegacyCheck.class); + + DescriptionBuilderComposite dbc = DescriptionTestUtils.getServiceDescriptionComposite(testEndpointInterfaceDesc.getEndpointDescription().getServiceDescription()); + dbc.setCorrespondingClass(WebMethodLegacyCheck.class); + LegacyMethodRetrieverImpl retrive = new LegacyMethodRetrieverImpl(dbc, testEndpointInterfaceDesc); + Iterator<MethodDescriptionComposite> iter = retrive.retrieveMethods(); + while(iter.hasNext()){ + MethodDescriptionComposite mdc = iter.next(); + String name = mdc.getMethodName(); + assertNotNull(name); + } + } //This test verifies that the old WebMethod behavior has not changed if the system flag is //not set, slightly redundant but still a safety check public void testWebMethodOldBehavior1() { @@ -684,7 +715,7 @@ public class AnnotationServiceImplDescri //testing new rules return; } - } catch (ClassNotFoundException e) { + } catch (ClassNotFoundException e) { } catch (IOException ioex) { } @@ -1498,6 +1529,17 @@ public String method5(String s) { // ============================================================================= // testWebMethod service implementaiton class // ============================================================================= +...@webservice +class WebMethodLegacyCheck { + + @WebMethod() + public String echoanno(String s){return s;} + + // under old jax-ws (default) behavior, legacywm=true, this unannotated method would not be exposed, + // but under the new rules, it is exposed. + //@WebMethod() + public String echonoanno(String s){return s;} +} @WebService class WebMethodTestImpl {