Update of /cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24918/fitplugin/test/net/sourceforge/jwebunit/fit
Modified Files:
PseudoWebApp.java WebFixtureTest.java
Log Message:
Completed the transition to jetty based tests by adding servlets to handle the
post requests. Now all but two of the old tests pass without modification.
Index: WebFixtureTest.java
===================================================================
RCS file:
/cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit/WebFixtureTest.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** WebFixtureTest.java 3 Jan 2006 15:57:55 -0000 1.24
--- WebFixtureTest.java 3 Jan 2006 16:41:18 -0000 1.25
***************
*** 12,21 ****
--- 12,28 ----
import net.sourceforge.jwebunit.WebTester;
+ import net.sourceforge.jwebunit.fit.testservlets.ColorPostServlet;
+ import net.sourceforge.jwebunit.fit.testservlets.MoriaPostServlet;
+ import net.sourceforge.jwebunit.fit.testservlets.PersonalInfoPostServlet;
import org.mortbay.http.HttpContext;
+ import org.mortbay.http.HttpException;
+ import org.mortbay.http.HttpRequest;
+ import org.mortbay.http.HttpResponse;
import org.mortbay.http.HttpServer;
import org.mortbay.http.SocketListener;
import org.mortbay.http.handler.DumpHandler;
import org.mortbay.http.handler.ResourceHandler;
+ import org.mortbay.jetty.servlet.ServletHandler;
import org.mortbay.util.Resource;
***************
*** 126,136 ****
private void setUpContextHandlers(HttpContext context) {
// handle static HTML
context.addHandler(getStaticHTMLResourceHandler());
- //context.addHandler(new DumpHandler());
}
private ResourceHandler getStaticHTMLResourceHandler() {
! return new ResourceHandler() {
protected Resource getResource(String pathInContext) throws
IOException {
Resource r = super.getResource(pathInContext);
--- 133,148 ----
private void setUpContextHandlers(HttpContext context) {
+ // servlet handlers for the post requests from old .fit files
+ ServletHandler handler= new ServletHandler();
+ handler.addServlet("colorPost","/colorPost",
ColorPostServlet.class.getName());
+ handler.addServlet("moriaPost","/moriaPost",
MoriaPostServlet.class.getName());
+ handler.addServlet("personalInfoPost", "/personalInfoPost",
PersonalInfoPostServlet.class.getName());
+ context.addHandler(handler);
// handle static HTML
context.addHandler(getStaticHTMLResourceHandler());
}
private ResourceHandler getStaticHTMLResourceHandler() {
! ResourceHandler handler = new ResourceHandler() {
protected Resource getResource(String pathInContext) throws
IOException {
Resource r = super.getResource(pathInContext);
***************
*** 138,145 ****
--- 150,161 ----
r =
super.getResource(oldUrls.get(pathInContext).toString());
}
+ if (!r.exists()) {
+
+ }
assertTrue("The requested resource '" + pathInContext + "'
must exist", r.exists());
return r;
}
};
+ return handler;
}
Index: PseudoWebApp.java
===================================================================
RCS file:
/cvsroot/jwebunit/jWebUnit/fitplugin/test/net/sourceforge/jwebunit/fit/PseudoWebApp.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PseudoWebApp.java 29 Mar 2003 15:17:34 -0000 1.11
--- PseudoWebApp.java 3 Jan 2006 16:41:18 -0000 1.12
***************
*** 7,10 ****
--- 7,13 ----
import java.io.*;
+ /**
+ * @deprecated Jetty and servlets is used instead.
+ */
public class PseudoWebApp {
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development