I'm working with the CVS version of Tapestry 4.0, and could not get the
tests to pass. I've started patching the tests that are failing. I don't
know if this patch is right, but the test now passes. This patch should be
able to be applied using Eclipse, or any other patch capability.
Index: TestRestartService.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tapestry/framework/src/test/org/apache/tapestry/engi
ne/TestRestartService.java,v
retrieving revision 1.5
diff -u -r1.5 TestRestartService.java
--- TestRestartService.java 18 Apr 2005 17:07:51 -0000 1.5
+++ TestRestartService.java 12 May 2005 16:52:01 -0000
@@ -19,6 +19,7 @@
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
+import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.engine.RestartService;
import org.apache.tapestry.junit.TapestryTestCase;
import org.apache.tapestry.services.AbsoluteURLBuilder;
@@ -41,16 +42,22 @@
MockControl builderControl = newControl(AbsoluteURLBuilder.class);
AbsoluteURLBuilder builder = (AbsoluteURLBuilder)
builderControl.getMock();
+
+ MockControl cycleControl = newControl(IRequestCycle.class);
+ IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();
// Training
request.getSession();
requestControl.setReturnValue(null);
- builder.constructURL("/app");
+ builder.constructURL("http://myserver/app");
builderControl.setReturnValue("http://myserver/app");
response.sendRedirect("http://myserver/app");
+
+ cycle.getAbsoluteURL("/app");
+ cycleControl.setReturnValue("http://myserver/app");
replayControls();
@@ -60,7 +67,7 @@
s.setResponse(response);
s.setServletPath("/app");
- s.service(null);
+ s.service(cycle);
verifyControls();
}
@@ -77,6 +84,9 @@
HttpSession session = (HttpSession) newMock(HttpSession.class);
+ MockControl cycleControl = newControl(IRequestCycle.class);
+ IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();
+
// Training
request.getSession();
@@ -84,11 +94,14 @@
session.invalidate();
- builder.constructURL("/tap");
+ builder.constructURL("http://myserver/tap");
builderControl.setReturnValue("http://myserver/tap");
response.sendRedirect("http://myserver/tap");
+ cycle.getAbsoluteURL("/tap");
+ cycleControl.setReturnValue("http://myserver/tap");
+
replayControls();
RestartService s = new RestartService();
@@ -97,7 +110,7 @@
s.setResponse(response);
s.setServletPath("/tap");
- s.service(null);
+ s.service(cycle);
verifyControls();
}
@@ -118,6 +131,9 @@
Log log = (Log) newMock(Log.class);
IllegalStateException ex = new IllegalStateException();
+
+ MockControl cycleControl = newControl(IRequestCycle.class);
+ IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();
// Training
@@ -129,11 +145,14 @@
log.warn("Exception thrown invalidating HttpSession.", ex);
- builder.constructURL("/app");
+ builder.constructURL("http://myserver/app");
builderControl.setReturnValue("http://myserver/app");
response.sendRedirect("http://myserver/app");
+ cycle.getAbsoluteURL("/app");
+ cycleControl.setReturnValue("http://myserver/app");
+
replayControls();
RestartService s = new RestartService();
@@ -143,7 +162,7 @@
s.setLog(log);
s.setServletPath("/app");
- s.service(null);
+ s.service(cycle);
verifyControls();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]