Author: rsearls
Date: 2013-11-06 09:00:26 -0500 (Wed, 06 Nov 2013)
New Revision: 18064
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java
Log:
BZ-1016090 file renamed making test name unique.
Copied:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java
(from rev 18063,
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084TestCase.java)
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/saaj/jbws3084/JBWS3084CxfTestCase.java 2013-11-06
14:00:26 UTC (rev 18064)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.saaj.jbws3084;
+
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPMessage;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * [JBWS-3084] Enable control of chunked encoding when using SOAPConnection.
+ *
+ * @author sberyozk(a)redhat.com
+ */
+public class JBWS3084CxfTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JBWS3084CxfTestCase.class,
"saaj-soap-connection.war");
+ }
+
+ public void testSoapConnectionGet() throws Exception
+ {
+ final String serviceURL = "http://" + getServerHost() +
":8080/saaj-soap-connection/greetMe";
+ SOAPConnectionFactory conFac = SOAPConnectionFactory.newInstance();
+
+ SOAPConnection con = conFac.createConnection();
+ URL endpoint = new URL(serviceURL);
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage msg = msgFactory.createMessage();
+ msg.getSOAPBody().addBodyElement(new
QName("http://www.jboss.org/jbossws/saaj", "greetMe"));
+ SOAPMessage response = con.call(msg, endpoint);
+ QName greetMeResp = new
QName("http://www.jboss.org/jbossws/saaj",
"greetMeResponse");
+
+ Iterator<?> sayHiRespIterator =
response.getSOAPBody().getChildElements(greetMeResp);
+ SOAPElement soapElement = (SOAPElement) sayHiRespIterator.next();
+ assertNotNull(soapElement);
+
+ assertEquals(1, response.countAttachments());
+ }
+}