cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/engine TestRestartService.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/engine TestRestartService.java

hlship
hlship      2005/05/12 11:56:26

  Modified:    .        status.xml
               framework/src/test/org/apache/tapestry/engine
                        TestRestartService.java
  Log:
  Fix TestRestartService test suite.
 
  Revision  Changes    Path
  1.105     +3 -2      jakarta-tapestry/status.xml
 
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/status.xml,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- status.xml 12 May 2005 18:18:18 -0000 1.104
  +++ status.xml 12 May 2005 18:56:26 -0000 1.105
  @@ -52,14 +52,15 @@
       -->
     </todo>
     <changes>
  -    <release version="4.0-alpha-3-snapshot" date="unrelease">
  +    <release version="4.0-alpha-3-snapshot" date="unreleased">
         <action type="add" dev="HLS">Add initial support for the validator: binding prefix.</action>
         <action type="add" dev="PF" fixes-bug="TAPESTRY-317">Fixed workbench build script so that generated war file will include the required ognl jar.</action>
         <action type="fix" dev="HLS" fixes-bug="TAPESTRY-166">Allow Submits to defer invoking their listener.</action>
  -      <action type="fix" dev="HLS" fixes-bug="TAPESTRY-320"> Property seperate data from different users stored using the tapestry.persist.ClientPropertyPersistenceStrategy service.</action>
  +      <action type="fix" dev="HLS" fixes-bug="TAPESTRY-320"> Properly seperate data from different users stored using the tapestry.persist.ClientPropertyPersistenceStrategy service.</action>
         <action type="add" dev="HLS"> Store the Registry as a ServletContext attribute, so that it may be accessed from other servlets. </action>
         <action type="add" dev="HLS" fixes-bug="TAPESTRY-323"> Allow control over the ErrorHandler used when building the HiveMind Registry. </action>
         <action type="update" dev="HLS"> Remove &lt;inject-state&gt;, and add type attribute to &lt;inject&gt;.</action>
  +      <action type="fix" due-to="Richard Hensley">Fix some problems with the TestRestartService test suite.</action>
       </release>
       <release version="4.0-alpha-2" date="May 5 2005">
         <action type="update" dev="HLS"> Coordinate Locale changes with the hivemind.ThreadLocale service. </action>
 
 
 
  1.6       +25 -7     jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/TestRestartService.java
 
  Index: TestRestartService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/engine/TestRestartService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestRestartService.java 18 Apr 2005 17:07:51 -0000 1.5
  +++ TestRestartService.java 12 May 2005 18:56:26 -0000 1.6
  @@ -19,7 +19,7 @@
   import javax.servlet.http.HttpSession;
   
   import org.apache.commons.logging.Log;
  -import org.apache.tapestry.engine.RestartService;
  +import org.apache.tapestry.IRequestCycle;
   import org.apache.tapestry.junit.TapestryTestCase;
   import org.apache.tapestry.services.AbsoluteURLBuilder;
   import org.easymock.MockControl;
  @@ -42,12 +42,18 @@
           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");
  +        cycle.getAbsoluteURL("/app");
  +        cycleControl.setReturnValue("http://myserver/app");
  +
  +        builder.constructURL("http://myserver/app");
           builderControl.setReturnValue("http://myserver/app");
   
           response.sendRedirect("http://myserver/app");
  @@ -60,7 +66,7 @@
           s.setResponse(response);
           s.setServletPath("/app");
   
  -        s.service(null);
  +        s.service(cycle);
   
           verifyControls();
       }
  @@ -75,6 +81,9 @@
           MockControl builderControl = newControl(AbsoluteURLBuilder.class);
           AbsoluteURLBuilder builder = (AbsoluteURLBuilder) builderControl.getMock();
   
  +        MockControl cycleControl = newControl(IRequestCycle.class);
  +        IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();
  +
           HttpSession session = (HttpSession) newMock(HttpSession.class);
   
           // Training
  @@ -84,7 +93,10 @@
   
           session.invalidate();
   
  -        builder.constructURL("/tap");
  +        cycle.getAbsoluteURL("/tap");
  +        cycleControl.setReturnValue("http://myserver/tap");
  +
  +        builder.constructURL("http://myserver/tap");
           builderControl.setReturnValue("http://myserver/tap");
   
           response.sendRedirect("http://myserver/tap");
  @@ -97,7 +109,7 @@
           s.setResponse(response);
           s.setServletPath("/tap");
   
  -        s.service(null);
  +        s.service(cycle);
   
           verifyControls();
       }
  @@ -115,6 +127,9 @@
           MockControl sessionControl = newControl(HttpSession.class);
           HttpSession session = (HttpSession) sessionControl.getMock();
   
  +        MockControl cycleControl = newControl(IRequestCycle.class);
  +        IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();
  +
           Log log = (Log) newMock(Log.class);
   
           IllegalStateException ex = new IllegalStateException();
  @@ -129,7 +144,10 @@
   
           log.warn("Exception thrown invalidating HttpSession.", ex);
   
  -        builder.constructURL("/app");
  +        cycle.getAbsoluteURL("/app");
  +        cycleControl.setReturnValue("http://myserver/app");
  +
  +        builder.constructURL("http://myserver/app");
           builderControl.setReturnValue("http://myserver/app");
   
           response.sendRedirect("http://myserver/app");
  @@ -143,7 +161,7 @@
           s.setLog(log);
           s.setServletPath("/app");
   
  -        s.service(null);
  +        s.service(cycle);
   
           verifyControls();
       }
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]