You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wo...@apache.org on 2008/03/03 19:48:24 UTC
svn commit: r633234 [8/24] - in /webservices/axis2/trunk/java: ./
modules/jaxws-integration/ modules/jaxws-integration/test/
modules/jaxws-integration/test/client/ modules/jaxws-integration/test/org/
modules/jaxws-integration/test/org/apache/ modules/j...
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/i18n/JaxwsMessageBundleTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/i18n/JaxwsMessageBundleTests.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/i18n/JaxwsMessageBundleTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/i18n/JaxwsMessageBundleTests.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,48 @@
+/*
+ * 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 org.apache.axis2.jaxws.i18n;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests basic function of the Message Bundle
+ *
+ */
+public class JaxwsMessageBundleTests extends TestCase {
+
+ public JaxwsMessageBundleTests() {
+ super();
+ }
+
+ public JaxwsMessageBundleTests(String arg) {
+ super(arg);
+ }
+
+ /**
+ * @testStrategy: Test that the resource bundle
+ * is installed by obtaining a message
+ */
+ public void testMessages() throws Exception {
+ final String str = "This string is a test string 01.";
+ String tempStr = Messages.getMessage("test01");
+ // Check the String for accuracy
+ assertTrue(str.equals(tempStr));
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl1.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,52 @@
+/*
+ * 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 org.apache.axis2.jaxws.injection;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+public class ResourceInjectionTestImpl1 {
+
+ @Resource
+ public WebServiceContext ctx = null;
+
+ public ResourceInjectionTestImpl1() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ @PostConstruct
+ public void initialize(){
+ //Called after resource injection and before a method is called.
+ TestLogger.logger.debug("Calling PostConstruct to Initialize");
+ }
+
+ @PreDestroy
+ public void distructor(){
+ //Called before the scope of request or session or application ends.
+
+ TestLogger.logger.debug("Calling PreDestroy ");
+
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl2.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,57 @@
+/*
+ * 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 org.apache.axis2.jaxws.injection;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+
+public class ResourceInjectionTestImpl2{
+
+
+ public WebServiceContext ctx = null;
+
+ public ResourceInjectionTestImpl2() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ @PostConstruct
+ public void initialize(){
+ //Called after resource injection and before a method is called.
+ TestLogger.logger.debug("Calling PostConstruct to Initialize");
+ }
+
+ @PreDestroy
+ public void distructor(){
+ //Called before the scope of request or session or application ends.
+
+ TestLogger.logger.debug("Calling PreDestroy ");
+
+ }
+ @Resource
+ public void setCtx(WebServiceContext ctx) {
+ this.ctx = ctx;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl3.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,55 @@
+/*
+ * 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 org.apache.axis2.jaxws.injection;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+public class ResourceInjectionTestImpl3 {
+
+ @Resource
+ private WebServiceContext ctx = null;
+
+ public ResourceInjectionTestImpl3() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ @PostConstruct
+ public void initialize(){
+ //Called after resource injection and before a method is called.
+ TestLogger.logger.debug("Calling PostConstruct to Initialize");
+ }
+
+ @PreDestroy
+ public void distructor(){
+ //Called before the scope of request or session or application ends.
+
+ TestLogger.logger.debug("Calling PreDestroy ");
+
+ }
+ public WebServiceContext getCtx(){
+ return ctx;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl4.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,60 @@
+/*
+ * 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 org.apache.axis2.jaxws.injection;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+public class ResourceInjectionTestImpl4 {
+
+
+ private WebServiceContext ctx = null;
+
+ public ResourceInjectionTestImpl4() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ @PostConstruct
+ public void initialize(){
+ //Called after resource injection and before a method is called.
+ TestLogger.logger.debug("Calling PostConstruct to Initialize");
+ }
+
+ @PreDestroy
+ public void distructor(){
+ //Called before the scope of request or session or application ends.
+
+ TestLogger.logger.debug("Calling PreDestroy ");
+
+ }
+ @Resource
+ private void setCtx(WebServiceContext ctx) {
+ this.ctx = ctx;
+ }
+
+ public WebServiceContext getCtx(){
+ return ctx;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTestImpl5.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,53 @@
+/*
+ * 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 org.apache.axis2.jaxws.injection;
+
+import org.apache.axis2.jaxws.TestLogger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+
+public class ResourceInjectionTestImpl5 {
+
+ @Resource(type=WebServiceContext.class)
+ public WebServiceContext ctx = null;
+
+ public ResourceInjectionTestImpl5() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ @PostConstruct
+ public void initialize(){
+ //Called after resource injection and before a method is called.
+ TestLogger.logger.debug("Calling PostConstruct to Initialize");
+ }
+
+ @PreDestroy
+ public void distructor(){
+ //Called before the scope of request or session or application ends.
+
+ TestLogger.logger.debug("Calling PreDestroy ");
+
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/injection/ResourceInjectionTests.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,145 @@
+/*
+ * 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 org.apache.axis2.jaxws.injection;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceContext;
+
+import junit.framework.TestCase;
+import org.apache.axis2.jaxws.context.WebServiceContextImpl;
+import org.apache.axis2.jaxws.resourceinjection.sei.ResourceInjectionPortType;
+import org.apache.axis2.jaxws.resourceinjection.sei.ResourceInjectionService;
+import org.apache.axis2.jaxws.server.endpoint.injection.ResourceInjector;
+import org.apache.axis2.jaxws.server.endpoint.injection.factory.ResourceInjectionFactory;
+import org.apache.axis2.jaxws.TestLogger;
+
+public class ResourceInjectionTests extends TestCase {
+ String axisEndpoint = "http://localhost:6060/axis2/services/ResourceInjectionService.ResourceInjectionPortTypeImplPort";
+
+ private Object resource = new WebServiceContextImpl();
+ public ResourceInjectionTests() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public void testInjectionOnField(){
+ Object serviceInstance = new ResourceInjectionTestImpl1();
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
+ injector.inject(resource, serviceInstance);
+ ResourceInjectionTestImpl1 serviceImpl =(ResourceInjectionTestImpl1)serviceInstance;
+ assertNotNull(serviceImpl.ctx);
+ TestLogger.logger.debug("Resource Injected on Field");
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testInjectionOnMethod(){
+ Object serviceInstance = new ResourceInjectionTestImpl2();
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
+ injector.inject(resource, serviceInstance);
+ ResourceInjectionTestImpl2 serviceImpl =(ResourceInjectionTestImpl2)serviceInstance;
+ assertNotNull(serviceImpl.ctx);
+ TestLogger.logger.debug("Resource Injected on Method");
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testInjectionOnPrivateField(){
+ Object serviceInstance = new ResourceInjectionTestImpl3();
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
+ injector.inject(resource, serviceInstance);
+ ResourceInjectionTestImpl3 serviceImpl =(ResourceInjectionTestImpl3)serviceInstance;
+ assertNotNull(serviceImpl.getCtx());
+ TestLogger.logger.debug("Resource Injected on Private Field");
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testInjectionOnProvateMethod(){
+ Object serviceInstance = new ResourceInjectionTestImpl4();
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
+ injector.inject(resource, serviceInstance);
+ ResourceInjectionTestImpl4 serviceImpl =(ResourceInjectionTestImpl4)serviceInstance;
+ assertNotNull(serviceImpl.getCtx());
+ TestLogger.logger.debug("Resource Injected using private Method");
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+ public void testTypedResourceInjectionOnField(){
+ Object serviceInstance = new ResourceInjectionTestImpl5();
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ ResourceInjector injector = ResourceInjectionFactory.createResourceInjector(WebServiceContext.class);
+ injector.inject(resource, serviceInstance);
+ ResourceInjectionTestImpl5 serviceImpl =(ResourceInjectionTestImpl5)serviceInstance;
+ assertNotNull(serviceImpl.ctx);
+ TestLogger.logger.debug("Resource Injected on Field");
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+
+ public void testEchoWithResourceInjectionAndLifecycleMethods(){
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ ResourceInjectionService service = new ResourceInjectionService();
+ ResourceInjectionPortType proxy = service.getResourceInjectionPort();
+ BindingProvider p = (BindingProvider) proxy;
+ p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);
+
+ String response = proxy.echo("echo Request");
+ TestLogger.logger.debug("Response String = " + response);
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ e.printStackTrace();
+ fail();
+ }
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuote.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuote.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuote.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuote.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,71 @@
+
+/*
+ * 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 org.apache.axis2.jaxws.jaxb.mfquote;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebServiceClient(name = "StockQuote", targetNamespace = "http://org/apache/axis2/jaxws/test", wsdlLocation = "StockQuote.wsdl")
+public class StockQuote
+ extends Service
+{
+
+ private final static URL STOCKQUOTE_WSDL_LOCATION;
+
+ static {
+ URL url = null;
+ try {
+ url = new URL("file:/C:/temp/StockQuote.wsdl");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ STOCKQUOTE_WSDL_LOCATION = url;
+ }
+
+ public StockQuote(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public StockQuote() {
+ super(STOCKQUOTE_WSDL_LOCATION, new QName("http://org/apache/axis2/jaxws/test", "StockQuote"));
+ }
+
+ /**
+ *
+ * @return
+ * returns StockQuoteIF
+ */
+ @WebEndpoint(name = "StockQuotePort")
+ public StockQuoteIF getStockQuotePort() {
+ return (StockQuoteIF)super.getPort(new QName("http://org/apache/axis2/jaxws/test", "StockQuotePort"), StockQuoteIF.class);
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuoteIF.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuoteIF.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuoteIF.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/mfquote/StockQuoteIF.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,60 @@
+
+/*
+ * 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 org.apache.axis2.jaxws.jaxb.mfquote;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "StockQuoteIF", targetNamespace = "http://org/apache/axis2/jaxws/test")
+public interface StockQuoteIF {
+
+
+ /**
+ *
+ * @param 10Holdings
+ * @param fund
+ * @param nav
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(action = "http://tempuri.org/StockQuote/getPrice")
+ @WebResult(name = "price", targetNamespace = "")
+ @RequestWrapper(localName = "getPrice", targetNamespace = "urn://stock1.test.org", className = "org.test.stock1.GetPrice")
+ @ResponseWrapper(localName = "getPriceResponse", targetNamespace = "urn://stock1.test.org", className = "org.test.stock1.StockPrice")
+ public String getPrice(
+ @WebParam(name = "fund", targetNamespace = "")
+ String fund,
+ @WebParam(name = "_10holdings", targetNamespace = "")
+ String _10Holdings,
+ @WebParam(name = "nav", targetNamespace = "")
+ String nav);
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuote.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuote.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuote.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuote.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,71 @@
+
+/*
+ * 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 org.apache.axis2.jaxws.jaxb.stockquote;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebServiceClient(name = "StockQuote", targetNamespace = "http://org/apache/axis2/jaxws/test", wsdlLocation = "StockQuote.wsdl")
+public class StockQuote
+ extends Service
+{
+
+ private final static URL STOCKQUOTE_WSDL_LOCATION;
+
+ static {
+ URL url = null;
+ try {
+ url = new URL("http://org/apache/axis2/jaxws/test/StockQuote.wsdl");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ STOCKQUOTE_WSDL_LOCATION = url;
+ }
+
+ public StockQuote(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public StockQuote() {
+ super(STOCKQUOTE_WSDL_LOCATION, new QName("http://org/apache/axis2/jaxws/test", "StockQuote"));
+ }
+
+ /**
+ *
+ * @return
+ * returns StockQuoteIF
+ */
+ @WebEndpoint(name = "StockQuotePort")
+ public StockQuoteIF getStockQuotePort() {
+ return (StockQuoteIF)super.getPort(new QName("http://org/apache/axis2/jaxws/test", "StockQuotePort"), StockQuoteIF.class);
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuoteIF.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuoteIF.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuoteIF.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/stockquote/StockQuoteIF.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,54 @@
+
+/*
+ * 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 org.apache.axis2.jaxws.jaxb.stockquote;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "StockQuoteIF", targetNamespace = "http://org/apache/axis2/jaxws/test")
+public interface StockQuoteIF {
+
+
+ /**
+ *
+ * @param symbol
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(action = "http://tempuri.org/StockQuote/getPrice")
+ @WebResult(name = "price", targetNamespace = "")
+ @RequestWrapper(localName = "getPrice", targetNamespace = "urn://stock2.test.org", className = "org.test.stock2.GetPrice")
+ @ResponseWrapper(localName = "getPriceResponse", targetNamespace = "urn://stock2.test.org", className = "org.test.stock2.StockPrice")
+ public String getPrice(
+ @WebParam(name = "symbol", targetNamespace = "")
+ String symbol);
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/jaxb/wrapper/WrapperToolTest.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,137 @@
+/*
+ * 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 org.apache.axis2.jaxws.jaxb.wrapper;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import junit.framework.TestCase;
+import org.apache.axis2.jaxws.wrapper.JAXBWrapperTool;
+import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException;
+import org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl;
+import org.apache.axis2.jaxws.TestLogger;
+
+public class WrapperToolTest extends TestCase {
+ public void testWrapStockQuote(){
+ try{
+ JAXBWrapperTool wrapper = new JAXBWrapperToolImpl();
+
+ String jaxbClassName = "org.test.stock2.GetPrice";
+ Class jaxbClass;
+ try {
+ jaxbClass = Class.forName(jaxbClassName, false, ClassLoader.getSystemClassLoader());
+ } catch (Exception e){
+ jaxbClass = Class.forName(jaxbClassName, false, this.getClass().getClassLoader());
+ }
+ ArrayList<String> childNames = new ArrayList<String>();
+ String childName = "symbol";
+ childNames.add(childName);
+ String symbolObj = new String("IBM");
+ Map<String, Object> childObjects= new WeakHashMap<String, Object>();
+ childObjects.put(childName, symbolObj);
+ Object jaxbObject = wrapper.wrap(jaxbClass, childNames, childObjects);
+ org.test.stock2.GetPrice getPrice = (org.test.stock2.GetPrice)jaxbObject;
+
+ }catch(JAXBWrapperException e){
+ e.printStackTrace();
+ }catch(ClassNotFoundException e){
+ e.printStackTrace();
+ }
+ }
+
+ public void testUnwrapStockQuote(){
+ try{
+ JAXBWrapperTool wrapper = new JAXBWrapperToolImpl();
+ org.test.stock2.GetPrice price = new org.test.stock2.GetPrice();
+ price.setSymbol("IBM");
+
+ ArrayList<String> childNames = new ArrayList<String>();
+ String childName = "symbol";
+ childNames.add(childName);
+
+ Object[] jaxbObjects = wrapper.unWrap(price, childNames);
+
+ }catch(JAXBWrapperException e){
+ e.printStackTrace();
+ }
+ }
+
+ public void testWrapMFQuote(){
+ try{
+ JAXBWrapperTool wrapper = new JAXBWrapperToolImpl();
+
+ String jaxbClassName = "org.test.stock1.GetPrice";
+ Class jaxbClass;
+ try {
+ jaxbClass = Class.forName(jaxbClassName, false, ClassLoader.getSystemClassLoader());
+ } catch (Exception e){
+ jaxbClass = Class.forName(jaxbClassName, false, this.getClass().getClassLoader());
+ }
+ ArrayList<String> childNames = new ArrayList<String>();
+ String fund ="fund";
+ String fundName = new String("PRGFX");
+ String holding = "holdings.";
+ String topHolding = new String("GE");
+ String nav ="nav";
+ String navInMillion = new String("700");
+
+ childNames.add(fund);
+ childNames.add(holding);
+ childNames.add(nav);
+
+ Map<String, Object> childObjects= new WeakHashMap<String, Object>();
+
+ childObjects.put(fund, fundName);
+ childObjects.put(holding, topHolding);
+ childObjects.put(nav, navInMillion);
+
+ Object jaxbObject = wrapper.wrap(jaxbClass, childNames, childObjects);
+ org.test.stock1.GetPrice getPrice = (org.test.stock1.GetPrice)jaxbObject;
+
+ }catch(JAXBWrapperException e){
+ e.printStackTrace();
+ }catch(ClassNotFoundException e){
+ e.printStackTrace();
+ }
+ }
+
+ public void testUnwrapMFQuote(){
+ try{
+ JAXBWrapperTool wrapper = new JAXBWrapperToolImpl();
+ org.test.stock1.GetPrice price = new org.test.stock1.GetPrice();
+ price.setFund("PRGFX");
+ price.setHoldings("GE");
+ price.setNav("700");
+
+ ArrayList<String> childNames = new ArrayList<String>();
+ String fund ="fund";
+ childNames.add(fund);
+ String holding = "holdings.";
+ childNames.add(holding);
+ String nav ="nav";
+ childNames.add(nav);
+
+ Object[] jaxbObjects = wrapper.unWrap(price, childNames);
+ }catch(JAXBWrapperException e){
+ e.printStackTrace();
+ }
+ }
+}
Added: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java?rev=633234&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/lifecycle/EndpointLifecycleTests.java Mon Mar 3 10:47:38 2008
@@ -0,0 +1,103 @@
+/*
+ * 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 org.apache.axis2.jaxws.lifecycle;
+
+import junit.framework.TestCase;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
+import org.apache.axis2.jaxws.resourceinjection.ResourceInjectionPortTypeImpl;
+import org.apache.axis2.jaxws.server.endpoint.lifecycle.EndpointLifecycleManager;
+import org.apache.axis2.jaxws.server.endpoint.lifecycle.factory.EndpointLifecycleManagerFactory;
+import org.apache.axis2.jaxws.TestLogger;
+
+public class EndpointLifecycleTests extends TestCase {
+ Object endpointInstance = new ResourceInjectionPortTypeImpl();
+ Object badObject = new Object();
+ public EndpointLifecycleTests() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param arg0
+ */
+ public EndpointLifecycleTests(String arg0) {
+ super(arg0);
+ // TODO Auto-generated constructor stub
+ }
+
+ public void testPostConstruct(){
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
+ assertNotNull(elmf);
+ EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(endpointInstance);
+ assertNotNull(elmf);
+ elm.invokePostConstruct();
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ fail(e.getMessage());
+ }
+ }
+
+ public void testPreDestroy(){
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
+ assertNotNull(elmf);
+ EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(endpointInstance);
+ assertNotNull(elm);
+ elm.invokePreDestroy();
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ fail(e.getMessage());
+ }
+ }
+
+ public void testBadPostConstruct(){
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
+ assertNotNull(elmf);
+ EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(badObject);
+ assertNotNull(elmf);
+ elm.invokePostConstruct();
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ fail(e.getMessage());
+ }
+ }
+
+ public void testBadPreDestroy(){
+ TestLogger.logger.debug("------------------------------");
+ TestLogger.logger.debug("Test : " + getName());
+ try{
+ EndpointLifecycleManagerFactory elmf = (EndpointLifecycleManagerFactory)FactoryRegistry.getFactory(EndpointLifecycleManagerFactory.class);
+ assertNotNull(elmf);
+ EndpointLifecycleManager elm = elmf.createEndpointLifecycleManager(badObject);
+ assertNotNull(elm);
+ elm.invokePreDestroy();
+ TestLogger.logger.debug("------------------------------");
+ }catch(Exception e){
+ fail(e.getMessage());
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org