Modified: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestServletWebRequest.java URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestServletWebRequest.java?rev=368414&r1=368413&r2=368414&view=diff ============================================================================== --- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestServletWebRequest.java (original) +++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestServletWebRequest.java Thu Jan 12 09:15:43 2006 @@ -1,4 +1,4 @@ -// Copyright 2005 The Apache Software Foundation +// Copyright 2005, 2006 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,19 +34,20 @@ */ public class TestServletWebRequest extends BaseWebTestCase { + private HttpServletRequest newRequest() { - return (HttpServletRequest) newMock(HttpServletRequest.class); + return (HttpServletRequest)newMock(HttpServletRequest.class); } private HttpServletResponse newResponse() { - return (HttpServletResponse) newMock(HttpServletResponse.class); + return (HttpServletResponse)newMock(HttpServletResponse.class); } private RequestDispatcher newDispatcher() { - return (RequestDispatcher) newMock(RequestDispatcher.class); + return (RequestDispatcher)newMock(RequestDispatcher.class); } public void testGetParameterNames() @@ -92,8 +93,7 @@ HttpServletRequest request = newRequest(); HttpServletResponse response = newResponse(); - String[] values = - { "William Orbit", "Steely Dan" }; + String[] values = { "William Orbit", "Steely Dan" }; request.getParameterValues("artist"); setReturnValue(request, values); @@ -242,7 +242,7 @@ private HttpSession newSession() { - return (HttpSession) newMock(HttpSession.class); + return (HttpSession)newMock(HttpSession.class); } public void testGetScheme() @@ -313,7 +313,8 @@ verifyControls(); } - public void testForwardInternal() throws Exception + public void testForwardInternal() + throws Exception { HttpServletRequest request = newRequest(); HttpServletResponse response = newResponse(); @@ -332,7 +333,8 @@ verifyControls(); } - public void testForwardNull() throws Exception + public void testForwardNull() + throws Exception { HttpServletRequest request = newRequest(); HttpServletResponse response = newResponse(); @@ -351,14 +353,14 @@ verifyControls(); } - private void trainGetRequestDispatcher(HttpServletRequest request, String path, - RequestDispatcher dispatcher) + private void trainGetRequestDispatcher(HttpServletRequest request, String path, RequestDispatcher dispatcher) { request.getRequestDispatcher(path); setReturnValue(request, dispatcher); } - public void testForwardInternalNoDispatcher() throws Exception + public void testForwardInternalNoDispatcher() + throws Exception { HttpServletRequest request = newRequest(); HttpServletResponse response = newResponse(); @@ -376,15 +378,14 @@ } catch (ApplicationRuntimeException ex) { - assertEquals( - "Unable to find a request dispatcher for local resource '/local.html'.", - ex.getMessage()); + assertEquals("Unable to find a request dispatcher for local resource '/local.html'.", ex.getMessage()); } verifyControls(); } - public void testForwardInternalFailure() throws Exception + public void testForwardInternalFailure() + throws Exception { HttpServletRequest request = newRequest(); HttpServletResponse response = newResponse(); @@ -408,9 +409,8 @@ } catch (ApplicationRuntimeException ex) { - assertEquals( - "Unable to forward to local resource '/servlet-exception.html': Mock Servlet Exception", - ex.getMessage()); + assertEquals("Unable to forward to local resource '/servlet-exception.html': Mock Servlet Exception", ex + .getMessage()); assertSame(t1, ex.getRootCause()); } @@ -432,16 +432,15 @@ } catch (ApplicationRuntimeException ex) { - assertEquals( - "Unable to forward to local resource '/io-exception.html': Mock IO Exception", - ex.getMessage()); + assertEquals("Unable to forward to local resource '/io-exception.html': Mock IO Exception", ex.getMessage()); assertSame(t2, ex.getRootCause()); } verifyControls(); } - public void testForwardExternal() throws Exception + public void testForwardExternal() + throws Exception { HttpServletRequest request = newRequest(); HttpServletResponse response = newResponse(); @@ -460,11 +459,12 @@ verifyControls(); } - public void testForwardExternalFailure() throws Exception + public void testForwardExternalFailure() + throws Exception { HttpServletRequest request = newRequest(); MockControl responsec = newControl(HttpServletResponse.class); - HttpServletResponse response = (HttpServletResponse) responsec.getMock(); + HttpServletResponse response = (HttpServletResponse)responsec.getMock(); Throwable t = new IOException("Mock IO Exception"); @@ -525,4 +525,4 @@ verifyControls(); } -} \ No newline at end of file +}
Modified: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestWebUtils.java URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestWebUtils.java?rev=368414&r1=368413&r2=368414&view=diff ============================================================================== --- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestWebUtils.java (original) +++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/TestWebUtils.java Thu Jan 12 09:15:43 2006 @@ -1,4 +1,4 @@ -// Copyright 2005 The Apache Software Foundation +// Copyright 2005, 2006 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import java.util.List; import org.apache.hivemind.test.HiveMindTestCase; -import org.apache.tapestry.web.WebUtils; /** * Tests for [EMAIL PROTECTED] org.apache.tapestry.web.WebUtils}. @@ -30,6 +29,7 @@ */ public class TestWebUtils extends HiveMindTestCase { + public void testToSortedList() { List l = new ArrayList(); @@ -65,4 +65,4 @@ assertSame(Collections.EMPTY_LIST, sorted); } -} \ No newline at end of file +} Modified: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/WebContextResourceTest.java URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/WebContextResourceTest.java?rev=368414&r1=368413&r2=368414&view=diff ============================================================================== --- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/WebContextResourceTest.java (original) +++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/web/WebContextResourceTest.java Thu Jan 12 09:15:43 2006 @@ -1,4 +1,4 @@ -// Copyright 2005 The Apache Software Foundation +// Copyright 2005, 2006 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,9 +28,10 @@ */ public class WebContextResourceTest extends HiveMindTestCase { + private WebContext newContext() { - return (WebContext) newMock(WebContext.class); + return (WebContext)newMock(WebContext.class); } public void testConstructor() @@ -52,7 +53,8 @@ verifyControls(); } - public void testLocalizationExists() throws Exception + public void testLocalizationExists() + throws Exception { WebContext context = newContext(); @@ -76,7 +78,8 @@ setReturnValue(context, url); } - public void testLocalizationSame() throws Exception + public void testLocalizationSame() + throws Exception { WebContext context = newContext(); @@ -94,7 +97,8 @@ verifyControls(); } - public void testLocalizationMissing() throws Exception + public void testLocalizationMissing() + throws Exception { WebContext context = newContext(); @@ -124,7 +128,8 @@ verifyControls(); } - public void testGetExtensionlessResource() throws Exception + public void testGetExtensionlessResource() + throws Exception { WebContext context = newContext(); @@ -141,4 +146,4 @@ verifyControls(); } -} \ No newline at end of file +} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
