cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r630672 - in /incubator/cxf/trunk/systests/src/test: java/org/apache/cxf/systest/aegis/ java/org/apache/cxf/systest/aegis/bean/ resources/
Date Sun, 24 Feb 2008 20:25:33 GMT
Author: bimargulies
Date: Sun Feb 24 12:25:17 2008
New Revision: 630672

URL: http://svn.apache.org/viewvc?rev=630672&view=rev
Log:
Add a test for Aegis+JaxWs. it all passes now, but part of it might fail if backported to
2.0.4 
(hint).

Added:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
  (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
  (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
  (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java
  (with props)
    incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml   (with props)

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java?rev=630672&view=auto
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
Sun Feb 24 12:25:17 2008
@@ -0,0 +1,50 @@
+/**
+ * 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.cxf.systest.aegis;
+
+import java.util.Map;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+import org.apache.cxf.systest.aegis.bean.AddItemWrapper;
+
+/**
+ * 
+ */
+@WebService(name = "AegisJaxWs")
+public interface AegisJaxWs {
+    @WebMethod
+    @Oneway
+    void addItem(@WebParam(name = "item") AddItemWrapper item);
+
+
+    @WebMethod(operationName = "getItemsAsMap")
+    Map getItemsMap();
+    
+    @WebMethod(operationName = "getItemsAsMapSpecified")
+    Map<Integer, AddItemWrapper> getItemsMapSpecified();    
+    
+    @WebMethod
+    AddItemWrapper getItemByKey(@WebParam(name = "key1") String key1, 
+                                @WebParam(name = "key2") String key2);
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java?rev=630672&view=auto
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
Sun Feb 24 12:25:17 2008
@@ -0,0 +1,56 @@
+/**
+ * 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.cxf.systest.aegis;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.feature.Features;
+import org.apache.cxf.systest.aegis.bean.AddItemWrapper;
+
+@Features(features = "org.apache.cxf.feature.LoggingFeature")
+@WebService (endpointInterface = "org.apache.cxf.systest.aegis.AegisJaxWs")
+public class AegisJaxWsImpl implements AegisJaxWs {
+    
+    Map<Integer, AddItemWrapper> items = new HashMap<Integer, AddItemWrapper>();
+
+    public void addItem(AddItemWrapper item) {
+        items.put(item.getKey(), item);
+    }
+
+    public Map getItemsMap() {
+        return items;
+    }
+
+    public Map<Integer, AddItemWrapper> getItemsMapSpecified() {
+        return items;
+    }
+
+    public AddItemWrapper getItemByKey(String key1, String key2) {
+        AddItemWrapper fake = new AddItemWrapper();
+        fake.setKey(new Integer(33));
+        fake.setData("and a third");
+        return fake;
+    }
+    
+    
+
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java?rev=630672&view=auto
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
Sun Feb 24 12:25:17 2008
@@ -0,0 +1,80 @@
+/**
+ * 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.cxf.systest.aegis;
+
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.systest.aegis.bean.AddItemWrapper;
+import org.junit.Test;
+import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
+
+/**
+ * 
+ */
+public class AegisJaxWsTest extends AbstractDependencyInjectionSpringContextTests {
+    
+    private AegisJaxWs client;
+    
+    public AegisJaxWsTest() {
+    }
+    
+    @Override
+    protected String[] getConfigLocations() {
+        return new String[] {"classpath:aegisJaxWsBeans.xml"};
+    }
+    
+    private void setupForTest() throws Exception {
+        
+        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
+        factory.setServiceClass(AegisJaxWs.class);
+        factory.setAddress("http://localhost:9167/aegisJaxWs");
+        factory.getServiceFactory().setDataBinding(new AegisDatabinding());
+
+        client = (AegisJaxWs)factory.create();
+    }
+    
+    @Test
+    public void testGetItem() throws Exception {
+        setupForTest();
+        client.getItemByKey("a", "b");
+    }
+    
+    @Test 
+    public void testMapSpecified() throws Exception {
+        setupForTest();
+        AddItemWrapper item = new AddItemWrapper();
+        item.setKey(new Integer(42));
+        item.setData("Godzilla");
+        client.addItem(item);
+        
+        Map<Integer, AddItemWrapper> items = client.getItemsMapSpecified();
+        assertNotNull(items);
+        assertEquals(1, items.size());
+        Map.Entry<Integer, AddItemWrapper> entry = items.entrySet().iterator().next();
+        assertNotNull(entry);
+        AddItemWrapper item2 = entry.getValue();
+        Integer key2 = entry.getKey();
+        assertEquals(42, key2.intValue());
+        assertEquals("Godzilla", item2.getData());
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java?rev=630672&view=auto
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java
Sun Feb 24 12:25:17 2008
@@ -0,0 +1,41 @@
+/**
+ * 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.cxf.systest.aegis.bean;
+
+/**
+ * 
+ */
+public class AddItemWrapper {
+    private Integer key;
+    private String data;
+
+    public Integer getKey() {
+        return key;
+    }
+    public void setKey(Integer key) {
+        this.key = key;
+    }
+    public String getData() {
+        return data;
+    }
+    public void setData(String data) {
+        this.data = data;
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/aegis/bean/AddItemWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml?rev=630672&view=auto
==============================================================================
--- incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml (added)
+++ incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml Sun Feb 24 12:25:17
2008
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:simple="http://cxf.apache.org/simple"
+	xmlns:jaxws="http://cxf.apache.org/jaxws"
+	xmlns:cxf="http://cxf.apache.org/core"
+	xsi:schemaLocation="
+http://www.springframework.org/schema/beans 
+http://www.springframework.org/schema/beans/spring-beans.xsd
+http://cxf.apache.org/simple
+http://cxf.apache.org/schemas/simple.xsd
+http://cxf.apache.org/jaxws
+http://cxf.apache.org/schemas/jaxws.xsd
+http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
+
+	<import resource="classpath:META-INF/cxf/cxf.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
+	<import
+		resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
+
+	<bean id="aegisBean"
+		class="org.apache.cxf.aegis.databinding.AegisDatabinding"
+		scope="prototype" />
+
+	<bean id="jaxws-and-aegis-service-factory"
+		class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
+		scope="prototype">
+		<property name="dataBinding" ref="aegisBean" />
+	</bean>
+
+	<bean id="impl" class="org.apache.cxf.systest.aegis.AegisJaxWsImpl" />
+
+	<jaxws:endpoint id="aegisRPCImpl" implementor="#impl"
+		address="http://localhost:9167/aegisJaxWs">
+		<jaxws:serviceFactory>
+			<ref bean='jaxws-and-aegis-service-factory' />
+		</jaxws:serviceFactory>
+		<jaxws:inInterceptors>
+			<bean
+				class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
+		</jaxws:inInterceptors>
+	</jaxws:endpoint>
+</beans>
\ No newline at end of file

Propchange: incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/systests/src/test/resources/aegisJaxWsBeans.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message