|
From: <pe...@us...> - 2003-12-12 12:32:52
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/test-cactus/org/neuclear/xml/soap
In directory sc8-pr-cvs1:/tmp/cvs-serv4502/src/test-cactus/org/neuclear/xml/soap
Modified Files:
SOAPServletTest.java
Log Message:
Working on getting the SOAPServletTest working under cactus
Index: SOAPServletTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/test-cactus/org/neuclear/xml/soap/SOAPServletTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SOAPServletTest.java 24 Nov 2003 23:37:33 -0000 1.1
--- SOAPServletTest.java 12 Dec 2003 12:32:49 -0000 1.2
***************
*** 3,11 ****
import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
! import org.apache.cactus.WebResponse;
! import org.dom4j.DocumentHelper;
import javax.servlet.ServletException;
import java.io.IOException;
/*
--- 3,15 ----
import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
! import org.neuclear.commons.NeuClearException;
! import org.neuclear.xml.XMLException;
!
import javax.servlet.ServletException;
import java.io.IOException;
+ import java.io.ByteArrayOutputStream;
+ import java.io.ByteArrayInputStream;
+ import java.security.GeneralSecurityException;
/*
***************
*** 29,32 ****
--- 33,39 ----
$Id$
$Log$
+ Revision 1.2 2003/12/12 12:32:49 pelle
+ Working on getting the SOAPServletTest working under cactus
+
Revision 1.1 2003/11/24 23:37:33 pelle
Testcase for SOAPServlet
***************
*** 40,57 ****
*/
public class SOAPServletTest extends ServletTestCase{
! /*
! public void beginSoapRequest(WebRequest theRequest){
theRequest.setContentType("text/xml");
! DocumentHelper.
! theRequest.
! }
! public void testSoapRequest() throws ServletException, IOException {
! EchoSOAPServlet servlet=new EchoSOAPServlet();
servlet.init(config);
! servlet.doPost(request,response);
! }
! public void endSoapRequest(WebResponse theResponse){
}
- */
}
--- 47,68 ----
*/
public class SOAPServletTest extends ServletTestCase{
!
! public void beginReceiveSOAP(WebRequest theRequest) throws GeneralSecurityException, NeuClearException, XMLException, IOException {
!
theRequest.setContentType("text/xml");
! theRequest.addHeader("SOAPAction:","/Receive");
! theRequest.setURL("http://users.neuclear.org", "/test", "/Service",
! null, null);
! ByteArrayOutputStream bos=new ByteArrayOutputStream();
! SOAPTools.createSoapRequestString(bos,"<test/");
! theRequest.setUserData(new ByteArrayInputStream(bos.toByteArray()));
! }
!
! public void testReceiveSOAP() throws ServletException, IOException {
! EchoSOAPServlet servlet = new EchoSOAPServlet();
servlet.init(config);
! servlet.service(request, response);
! assertNotNull(servlet.getLast());
}
}
|