Thread: [Httpunit-commit] SF.net SVN: httpunit:[1078] trunk/httpunit (Page 2)
Brought to you by:
russgold
From: <wol...@us...> - 2011-04-07 14:36:15
|
Revision: 1078 http://httpunit.svn.sourceforge.net/httpunit/?rev=1078&view=rev Author: wolfgang_fahl Date: 2011-04-07 14:36:09 +0000 (Thu, 07 Apr 2011) Log Message: ----------- removed unused import Modified Paths: -------------- trunk/httpunit/.classpath trunk/httpunit/examples/MultiDownload.java trunk/httpunit/examples/YouTubeVisitor.java Modified: trunk/httpunit/.classpath =================================================================== --- trunk/httpunit/.classpath 2011-01-29 08:26:57 UTC (rev 1077) +++ trunk/httpunit/.classpath 2011-04-07 14:36:09 UTC (rev 1078) @@ -1,21 +1,22 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="test"/> - <classpathentry kind="src" path="pending-tests"/> - <classpathentry kind="src" path="examples"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="jars/quicksite.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/junit/junit/3.8.1/junit-3.8.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/nekohtml/nekohtml/0.9.5/nekohtml-0.9.5.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/rhino/js/1.6R5/js-1.6R5.jar" sourcepath="/pub/2008/rhino1_6R5.zip"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/xerces/xmlParserAPIs/2.6.1/xmlParserAPIs-2.6.1.jar" sourcepath="/pub/2008/Xerces-J-src.2.6.1.zip"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar"/> - <classpathentry kind="lib" path="META-INF"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/activation/activation/1.1/activation-1.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/mail/mail/1.4/mail-1.4.jar"/> - <classpathentry kind="lib" path="jars/maven-ant-tasks-2.0.9.jar"/> - <classpathentry kind="output" path="bin"/> -</classpath> +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="test"/> + <classpathentry kind="src" path="pending-tests"/> + <classpathentry kind="src" path="examples"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="jars/quicksite.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/junit/junit/3.8.1/junit-3.8.1.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/nekohtml/nekohtml/0.9.5/nekohtml-0.9.5.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/rhino/js/1.6R5/js-1.6R5.jar" sourcepath="/pub/2008/rhino1_6R5.zip"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/xerces/xmlParserAPIs/2.6.1/xmlParserAPIs-2.6.1.jar" sourcepath="/pub/2008/Xerces-J-src.2.6.1.zip"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar"/> + <classpathentry kind="lib" path="META-INF"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/activation/activation/1.1/activation-1.1.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/mail/mail/1.4/mail-1.4.jar"/> + <classpathentry kind="lib" path="jars/maven-ant-tasks-2.0.9.jar"/> + <classpathentry kind="var" path="MAVEN_REPOSITORY"/> + <classpathentry kind="output" path="bin"/> +</classpath> Modified: trunk/httpunit/examples/MultiDownload.java =================================================================== --- trunk/httpunit/examples/MultiDownload.java 2011-01-29 08:26:57 UTC (rev 1077) +++ trunk/httpunit/examples/MultiDownload.java 2011-04-07 14:36:09 UTC (rev 1078) @@ -13,8 +13,8 @@ import org.xml.sax.SAXException; -import sun.tools.tree.ThisExpression; + /** * an example that shows how to automate downloads * Modified: trunk/httpunit/examples/YouTubeVisitor.java =================================================================== --- trunk/httpunit/examples/YouTubeVisitor.java 2011-01-29 08:26:57 UTC (rev 1077) +++ trunk/httpunit/examples/YouTubeVisitor.java 2011-04-07 14:36:09 UTC (rev 1078) @@ -12,8 +12,8 @@ import org.xml.sax.SAXException; -import sun.tools.tree.ThisExpression; + /** * an example that shows how to automate visits you tube * please see This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rus...@us...> - 2012-09-09 17:16:48
|
Revision: 1081 http://httpunit.svn.sourceforge.net/httpunit/?rev=1081&view=rev Author: russgold Date: 2012-09-09 17:16:39 +0000 (Sun, 09 Sep 2012) Log Message: ----------- switch to JUnit4 Modified Paths: -------------- trunk/httpunit/pending-tests/com/meterware/httpunit/NewParsingTests.java trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingEngineTests.java trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingTests.java trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/Base64Test.java trunk/httpunit/src/test/java/com/meterware/httpunit/EncodingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/FileUploadTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/FormParametersTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/FormSubmitTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/HtmlTablesTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/HttpUnitTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/MessageBodyRequestTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/NormalizeURLTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/RequestTargetTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/TextBlockTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebAppletTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebClientTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebFormTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebFrameTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebImageTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebLinkTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebPageTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/WebWindowTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/XMLPageTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/cookies/CookieTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/AbstractHTMLElementTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/AttributesTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/DocumentImportTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/DomEventScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/DomScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/DomWindowTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/HTMLDocumentTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/HTMLElementTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/HTMLFormSubmitTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/HTMLFormTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/HTMLSelectTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/HTMLTableTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/NodeTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/TestWindowProxy.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/AbstractJavaScriptTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/DocumentScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/EventHandlingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/FormScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/FrameScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/HTMLElementTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/NekoEnhancedScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/ScriptingTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/parsing/HTMLParserListenerTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/parsing/ParserPropertiesTest.java trunk/httpunit/src/test/java/com/meterware/httpunit/ssl/HttpsProtocolSupportTest.java trunk/httpunit/src/test/java/com/meterware/pseudoserver/PseudoServerTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/ConfigTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/ErrorTests.java trunk/httpunit/src/test/java/com/meterware/servletunit/EventAwareTestBase.java trunk/httpunit/src/test/java/com/meterware/servletunit/FailingTests.java trunk/httpunit/src/test/java/com/meterware/servletunit/HttpServletRequestTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/HttpServletResponseTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/JUnitServletTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/ListenersTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/NavigationTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/PassingTests.java trunk/httpunit/src/test/java/com/meterware/servletunit/PostTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/RequestContextTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/RequestDispatcherTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/ServletAccessTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/ServletUnitTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/SessionTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/StatefulTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/StatelessTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/WebXMLString.java trunk/httpunit/src/test/java/com/meterware/servletunit/WebXMLTest.java Added Paths: ----------- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java trunk/httpunit/src/test/java/com/meterware/servletunit/FiltersTestCase.java Removed Paths: ------------- trunk/httpunit/src/test/java/com/meterware/httpunit/ConditionalTestSuite.java trunk/httpunit/src/test/java/com/meterware/httpunit/HttpUnitSuite.java trunk/httpunit/src/test/java/com/meterware/httpunit/dom/DomTestSuite.java trunk/httpunit/src/test/java/com/meterware/httpunit/javascript/JavaScriptTestSuite.java trunk/httpunit/src/test/java/com/meterware/httpunit/parsing/ParsingTestSuite.java trunk/httpunit/src/test/java/com/meterware/servletunit/FiltersTest.java trunk/httpunit/src/test/java/com/meterware/servletunit/ServletUnitSuite.java Modified: trunk/httpunit/pending-tests/com/meterware/httpunit/NewParsingTests.java =================================================================== --- trunk/httpunit/pending-tests/com/meterware/httpunit/NewParsingTests.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/pending-tests/com/meterware/httpunit/NewParsingTests.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -19,12 +19,6 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ -import com.meterware.httpunit.HttpUnitTest; -import com.meterware.httpunit.WebClient; -import com.meterware.httpunit.WebConversation; -import com.meterware.httpunit.WebForm; -import com.meterware.httpunit.WebLink; -import com.meterware.httpunit.WebResponse; import junit.framework.Test; import junit.framework.TestSuite; @@ -62,10 +56,10 @@ */ public void testLinkUrlAcrossLineBreaks() throws Exception { WebConversation wc = new WebConversation(); - defineWebPage( "Initial", "<a id='midbreak' href='http://loc\nalhost/somewhere'</a>" + - "<a id='endbreak' href='http://localhost/somewhere\n'</a>" ); + pseudoServerTestSupport.defineWebPage("Initial", "<a id='midbreak' href='http://loc\nalhost/somewhere'</a>" + + "<a id='endbreak' href='http://localhost/somewhere\n'</a>"); - WebResponse response = wc.getResponse( getHostPath() + "/Initial.html" ); + WebResponse response = wc.getResponse(pseudoServerTestSupport.getHostPath() + "/Initial.html" ); String endbreak=response.getLinkWithID( "endbreak" ).getRequest().getURL().toExternalForm() ; assertEquals( "URL with break at end", endbreak,"http://localhost/somewhere"); //System.err.println("endbreak='"+endbreak+"'"); @@ -83,8 +77,8 @@ public void testParamReplacement() throws Exception { String expected = "/cgi-bin/bar?foo=a"; String nogood = "/cgi-bin/bar?arg=replaced&foo=a"; - defineResource( nogood, "not good" ); - defineResource( expected, "excellent" ); + pseudoServerTestSupport.defineResource(nogood, "not good"); + pseudoServerTestSupport.defineResource(expected, "excellent"); String html = "<FORM NAME=Bethsheba METHOD=GET ACTION=/cgi-bin/bar?arg=replaced>" + "<INPUT TYPE=TEXT NAME=foo>" + @@ -94,8 +88,8 @@ "<!--JavaScript submit:" + "<a href=\"javascript:document.Bethsheba.submit()\">go</a>" + "-->"; - defineWebPage( "test", html ); - WebResponse resp = _wc.getResponse( getHostPath() + "/test.html" ); + pseudoServerTestSupport.defineWebPage("test", html); + WebResponse resp = _wc.getResponse(pseudoServerTestSupport.getHostPath() + "/test.html" ); WebForm form = resp.getFormWithName( "Bethsheba" ); form.setParameter( "foo", "a" ); resp = form.submit(); @@ -115,7 +109,7 @@ "</SCRIPT>\n" + "<iframe name=\"iframe_after_lessthan_in_javascript\"\n" + "src=\"c.html\"></iframe>"; - defineWebPage( "iframe", html ); + pseudoServerTestSupport.defineWebPage("iframe", html); WebResponse response = _wc.getFrameContents( "iframe_after_lessthan_in_javascript" ); assertNotNull( "Iframe was not recognized", response ); } @@ -127,11 +121,11 @@ * @throws Exception on anuncaught error */ public void testFindNonHrefLinks() throws Exception { - defineResource( "NonHref.html", "<html><head><title>NonHref Links</title></head><body>\n" + + pseudoServerTestSupport.defineResource("NonHref.html", "<html><head><title>NonHref Links</title></head><body>\n" + "<a onclick='javascript:followlink()'>I am a clickable link after all</a>\n" + - "</body></html>" ); + "</body></html>"); WebConversation wc = new WebConversation(); - WebResponse response = wc.getResponse( getHostPath() + "/NonHref.html" ); + WebResponse response = wc.getResponse(pseudoServerTestSupport.getHostPath() + "/NonHref.html" ); WebLink[] links = response.getLinks(); assertNotNull( links ); assertEquals( "number of non-href anchor tags", 1, links.length ); Modified: trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingEngineTests.java =================================================================== --- trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingEngineTests.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingEngineTests.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -20,7 +20,6 @@ * *******************************************************************************************************************/ import com.meterware.httpunit.*; -import com.meterware.httpunit.javascript.AbstractJavaScriptTest; import junit.framework.TestSuite; import junit.textui.TestRunner; @@ -52,13 +51,13 @@ * @throws Exception on uncaught problem */ public void testCreateElement() throws Exception { - defineResource( "OnCommand.html", + pseudoServerTestSupport.defineResource("OnCommand.html", "<html><head><title>Amazing!</title></head>" + - "<body onLoad='var elem=document.createElement(\"input\");elem.id=\"hellothere\";alert(elem.id);'></body>" ); + "<body onLoad='var elem=document.createElement(\"input\");elem.id=\"hellothere\";alert(elem.id);'></body>"); WebConversation wc = new WebConversation(); boolean oldDebug = HttpUnitUtils.setEXCEPTION_DEBUG( false ); try { - wc.getResponse( getHostPath() + "/OnCommand.html" ); + wc.getResponse(pseudoServerTestSupport.getHostPath() + "/OnCommand.html" ); // used to throw: // com.meterware.httpunit.ScriptException: Event 'var elem=document.createElement("input");elem.id="hellothere";alert(elem.id);' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot find function createElement. assertEquals( "Alert message", "hellothere", wc.popNextAlert() ); @@ -87,7 +86,7 @@ * @throws Exception on any uncaught problem */ public void testDOM() throws Exception { - defineResource( "testSelect.html", "<html><head><script type='text/javascript'>\n" + + pseudoServerTestSupport.defineResource("testSelect.html", "<html><head><script type='text/javascript'>\n" + "<!--\n" + "function testDOM() {\n" + " var sel = document.getElementById('the_select');\n" + @@ -112,9 +111,9 @@ " </table>" + "</form>" + "<script type='text/javascript'>testDOM();</script>" + - "</body></html>" ); + "</body></html>"); WebConversation wc = new WebConversation(); - wc.getResponse( getHostPath() + "/testSelect.html" ); + wc.getResponse(pseudoServerTestSupport.getHostPath() + "/testSelect.html" ); assertEquals( "Message 1", "TD", wc.popNextAlert().toUpperCase() ); assertEquals( "Message 2", "SELECT", wc.popNextAlert().toUpperCase() ); } Modified: trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingTests.java =================================================================== --- trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingTests.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/pending-tests/com/meterware/httpunit/javascript/NewScriptingTests.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -22,7 +22,6 @@ import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.HttpUnitOptions; -import com.meterware.httpunit.javascript.AbstractJavaScriptTest; import junit.textui.TestRunner; import junit.framework.TestSuite; @@ -68,9 +67,9 @@ "<body onload=\"dumpargs('a','b')\"> " + "</body></html> "; - defineResource( "OnCommand.html", html ); + pseudoServerTestSupport.defineResource("OnCommand.html", html); WebConversation wc = new WebConversation(); - wc.getResponse( getHostPath() + "/OnCommand.html" ); + wc.getResponse(pseudoServerTestSupport.getHostPath() + "/OnCommand.html" ); assertEquals( "alert message 1", "2 arguments", wc.popNextAlert() ); assertEquals( "alert message 2", "0: a", wc.popNextAlert() ); assertEquals( "alert message 3", "1: b", wc.popNextAlert() ); Modified: trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java =================================================================== --- trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -24,68 +24,66 @@ import java.util.StringTokenizer; import java.io.IOException; -import junit.framework.TestCase; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import static org.junit.Assert.fail; +import static org.junit.Assert.assertEquals; + /** * A base class for test cases that use the pseudo server. * @author <a href="mailto:rus...@ht...">Russell Gold</a> **/ -public class HttpUserAgentTest extends TestCase { +public class HttpUserAgentTest { - private String _hostPath; - private PseudoServer _server; + private static final PseudoServerTestSupport testSupport = new PseudoServerTestSupport(); - public HttpUserAgentTest( String name ) { - super( name ); + @BeforeClass + static public void setUpHttpUserAgentTest() throws Exception { + testSupport.setUpServer(); } - public void setUp() throws Exception { - _server = new PseudoServer(); - _hostPath = "http://localhost:" + _server.getConnectedPort(); + @AfterClass + static public void tearDownHttpUserAgentTest() throws Exception { + testSupport.tearDownServer(); } - public void tearDown() throws Exception { - if (_server != null) _server.shutDown(); - } - - protected void defineResource( String resourceName, PseudoServlet servlet ) { - _server.setResource( resourceName, servlet ); + testSupport.defineResource(resourceName, servlet); } protected void defineResource( String resourceName, String value ) { - _server.setResource( resourceName, value ); + testSupport.defineResource(resourceName, value); } protected void defineResource( String resourceName, byte[] value, String contentType ) { - _server.setResource( resourceName, value, contentType ); + testSupport.defineResource(resourceName, value, contentType); } protected void defineResource( String resourceName, String value, int statusCode ) { - _server.setErrorResource( resourceName, statusCode, value ); + testSupport.defineResource(resourceName, value, statusCode); } protected void defineResource( String resourceName, String value, String contentType ) { - _server.setResource( resourceName, value, contentType ); + testSupport.defineResource(resourceName, value, contentType); } protected void addResourceHeader( String resourceName, String header ) { - _server.addResourceHeader( resourceName, header ); + testSupport.addResourceHeader(resourceName, header); } protected void setResourceCharSet( String resourceName, String setName, boolean reportCharSet ) { - _server.setCharacterSet( resourceName, setName ); - _server.setSendCharacterSet( resourceName, reportCharSet ); + testSupport.setResourceCharSet(resourceName, setName, reportCharSet); } /** @@ -96,17 +94,8 @@ * @param body */ protected void defineWebPage( String xmlns,String pageName, String body ) { - String preamble=""; - if (xmlns==null) - xmlns=""; - else { - preamble ="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"; - preamble+="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; - xmlns=" xmlns=\""+xmlns+"\""; - } - defineResource( pageName + ".html", preamble+"<html"+xmlns+">\n<head><title>" + pageName + "</title></head>\n" + - "<body>\n" + body + "\n</body>\n</html>" ); - } + testSupport.defineWebPage(xmlns, pageName, body); + } /** * define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page @@ -114,32 +103,32 @@ * @param body */ protected void defineWebPage( String pageName, String body ) { - defineWebPage(null,pageName,body); + testSupport.defineWebPage(pageName, body); } protected void mapToClasspath( String directory ) { - _server.mapToClasspath( directory ); + testSupport.mapToClasspath(directory); } protected PseudoServer getServer() { - return _server; + return testSupport.getServer(); } protected void setServerDebug( boolean enabled ) { - _server.setDebug( enabled ); + testSupport.setServerDebug(enabled); } protected String getHostPath() { - return _hostPath; + return testSupport.getHostPath(); } protected int getHostPort() throws IOException { - return _server.getConnectedPort(); + return testSupport.getHostPort(); } @@ -148,23 +137,6 @@ } - - protected void assertEquals( String comment, Object[] expected, Object[] found ) { - if (!equals( expected, found )) { - fail( comment + " expected: " + asText( expected ) + " but found " + asText( found ) ); - } - } - - - private boolean equals( Object[] first, Object[] second ) { - if (first.length != second.length) return false; - for (int i = 0; i < first.length; i++) { - if (!first[ i ].equals( second[ i ] )) return false; - } - return true; - } - - protected void assertImplement( String comment, Object[] objects, Class expectedClass ) { if (objects.length == 0) fail( "No " + comment + " found." ); for (int i = 0; i < objects.length; i++) { @@ -254,11 +226,6 @@ } - protected void assertEquals( String comment, byte[] expected, byte[] actual ) { - assertEquals(comment,toString(expected),toString(actual)); - } - - private boolean equals( byte[] first, byte[] second ) { if (first.length != second.length) return false; for (int i = 0; i < first.length; i++) { Added: trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java =================================================================== --- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java (rev 0) +++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -0,0 +1,98 @@ +package com.meterware.pseudoserver; + +import java.io.IOException; + +public class PseudoServerTestSupport { + private String _hostPath; + private PseudoServer _server; + + public void setUpServer() throws IOException { + _server = new PseudoServer(); + _hostPath = "http://localhost:" + _server.getConnectedPort(); + } + + public void tearDownServer() { + if (_server != null) _server.shutDown(); + } + + + public void mapToClasspath( String directory ) { + _server.mapToClasspath(directory); + } + + public void defineResource(String resourceName, PseudoServlet servlet) { + _server.setResource(resourceName, servlet); + } + + public void defineResource(String resourceName, String value) { + _server.setResource(resourceName, value); + } + + public void defineResource(String resourceName, byte[] value, String contentType) { + _server.setResource(resourceName, value, contentType); + } + + public void defineResource(String resourceName, String value, int statusCode) { + _server.setErrorResource(resourceName, statusCode, value); + } + + public void defineResource(String resourceName, String value, String contentType) { + _server.setResource(resourceName, value, contentType); + } + + public void addResourceHeader(String resourceName, String header) { + _server.addResourceHeader(resourceName, header); + } + + public void setResourceCharSet(String resourceName, String setName, boolean reportCharSet) { + _server.setCharacterSet(resourceName, setName); + _server.setSendCharacterSet(resourceName, reportCharSet); + } + + /** + * define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page + * use the given xml names space if it is not null + * + * @param xmlns + * @param pageName + * @param body + */ + public void defineWebPage(String xmlns, String pageName, String body) { + String preamble = ""; + if (xmlns == null) + xmlns = ""; + else { + preamble = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"; + preamble += "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; + xmlns = " xmlns=\"" + xmlns + "\""; + } + defineResource(pageName + ".html", preamble + "<html" + xmlns + ">\n<head><title>" + pageName + "</title></head>\n" + + "<body>\n" + body + "\n</body>\n</html>"); + } + + /** + * define a Web Page with the given page name and boy adding the html and body tags with pageName as the title of the page + * + * @param pageName + * @param body + */ + public void defineWebPage(String pageName, String body) { + defineWebPage(null, pageName, body); + } + + public PseudoServer getServer() { + return _server; + } + + public void setServerDebug(boolean enabled) { + _server.setDebug(enabled); + } + + public String getHostPath() { + return _hostPath; + } + + public int getHostPort() throws IOException { + return _server.getConnectedPort(); + } +} \ No newline at end of file Modified: trunk/httpunit/src/test/java/com/meterware/httpunit/Base64Test.java =================================================================== --- trunk/httpunit/src/test/java/com/meterware/httpunit/Base64Test.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/src/test/java/com/meterware/httpunit/Base64Test.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -1,71 +1,60 @@ package com.meterware.httpunit; /******************************************************************************************************************** -* $Id$ -* -* Copyright (c) 2000-2001, Russell Gold -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -* documentation files (the "Software"), to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -* to permit persons to whom the Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all copies or substantial portions -* of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -* -*******************************************************************************************************************/ -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; + * $Id$ + * + * Copyright (c) 2000-2001, Russell Gold + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + * to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + *******************************************************************************************************************/ +import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + /** * Tests the base64 converter. * * @author <a href="mailto:rus...@ac...">Russell Gold</a> - * @author <a href="mailto:mta...@si...">Marcos Tarruella</a> - **/ -public class Base64Test extends TestCase { + * @author <a href="mailto:mta...@si...">Marcos Tarruella</a> + */ +public class Base64Test { - public static void main( String[] args ) { - junit.textui.TestRunner.run( suite() ); - } - - - public static Test suite() { - return new TestSuite( Base64Test.class ); - } - - - public Base64Test( String name ) { - super( name ); - } - - + @Test public void testEncode() { - assertEquals( "Result of encoding", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==", Base64.encode( "Aladdin:open sesame" ) ); - assertEquals( "Result of encoding", "QWRtaW46Zm9vYmFy", Base64.encode( "Admin:foobar" ) ); + assertEquals("Result of encoding", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==", Base64.encode("Aladdin:open sesame")); + assertEquals("Result of encoding", "QWRtaW46Zm9vYmFy", Base64.encode("Admin:foobar")); } + @Test public void testDecode() { - assertEquals( "Result of decoding", "Aladdin:open sesame", Base64.decode( "QWxhZGRpbjpvcGVuIHNlc2FtZQ==" ) ); - assertEquals( "Result of decoding", "Admin:foobar", Base64.decode( "QWRtaW46Zm9vYmFy" ) ); + assertEquals("Result of decoding", "Aladdin:open sesame", Base64.decode("QWxhZGRpbjpvcGVuIHNlc2FtZQ==")); + assertEquals("Result of decoding", "Admin:foobar", Base64.decode("QWRtaW46Zm9vYmFy")); } + @Test public void testExceptionDecoding() { try { - Base64.decode( "123"); + Base64.decode("123"); fail("valid Base64 codes have a multiple of 4 characters"); } catch (Exception e) { assertEquals("valid Base64 codes have a multiple of 4 characters", - e.getMessage()); + e.getMessage()); } } Deleted: trunk/httpunit/src/test/java/com/meterware/httpunit/ConditionalTestSuite.java =================================================================== --- trunk/httpunit/src/test/java/com/meterware/httpunit/ConditionalTestSuite.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/src/test/java/com/meterware/httpunit/ConditionalTestSuite.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -1,54 +0,0 @@ -package com.meterware.httpunit; -/******************************************************************************************************************** - * $Id$ - * - * Copyright (c) 2002-2004, Russell Gold - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO - * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - *******************************************************************************************************************/ -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - -import junit.framework.TestSuite; -import junit.framework.TestCase; - -/** - * - * @author <a href="mailto:rus...@ht...">Russell Gold</a> - **/ -public class ConditionalTestSuite { - - private static Class[] NO_PARAMETERS = new Class[ 0 ]; - - - protected static void addOptionalTestCase( TestSuite testSuite, String testCaseName ) { - try { - final Class testClass = Class.forName( testCaseName ); - Method suiteMethod = testClass.getMethod( "suite", ConditionalTestSuite.NO_PARAMETERS ); - if (suiteMethod != null && Modifier.isStatic( suiteMethod.getModifiers() )) { - testSuite.addTest( (TestSuite) suiteMethod.invoke( null, ConditionalTestSuite.NO_PARAMETERS ) ); - } else if (TestCase.class.isAssignableFrom( testClass )) { - testSuite.addTest( new TestSuite( testClass ) ); - } else { - System.out.println( "Note: test suite " + testCaseName + " not a TestClass and has no suite() method" ); - } - } catch (ClassNotFoundException e) { - System.out.println( "Note: skipping optional test suite " + testCaseName + " since it was not built." ); - } catch (Exception e) { - System.out.println( "Note: unable to add " + testCaseName + ": " + e ); - } - } -} Modified: trunk/httpunit/src/test/java/com/meterware/httpunit/EncodingTest.java =================================================================== --- trunk/httpunit/src/test/java/com/meterware/httpunit/EncodingTest.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/src/test/java/com/meterware/httpunit/EncodingTest.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2004, Russell Gold + * Copyright (c) 2004-2012, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -19,270 +19,275 @@ * DEALINGS IN THE SOFTWARE. * *******************************************************************************************************************/ -import junit.framework.TestSuite; + import com.meterware.pseudoserver.PseudoServlet; import com.meterware.pseudoserver.WebResource; +import org.junit.Test; +import java.io.UnsupportedEncodingException; +import static org.junit.Assert.assertEquals; + + /** * Tests handling of non-Latin scripts. * * @author <a href="mailto:rus...@ht...">Russell Gold</a> * @author <a href="mailto:mat...@qu...">Kazuaki Matsuhashi</a> - **/ + */ public class EncodingTest extends HttpUnitTest { - public static void main( String args[] ) { - junit.textui.TestRunner.run( suite() ); - } - - - public static TestSuite suite() { - return new TestSuite( EncodingTest.class ); - } - - - public EncodingTest( String name ) { - super( name ); - } - - + @Test public void testDecodeWithCharacterSetAsArg() throws Exception { String expected = "newpage\u30b5\u30f3\u30d7\u30eb"; // "\u30b5\u30f3\u30d7\u30eb" means "SAMPLE" in Japanese EUC-JP characterSet String encodedString = "newpage%A5%B5%A5%F3%A5%D7%A5%EB"; - String actual = HttpUnitUtils.decode( encodedString , "EUC-JP" ); - assertEquals( "decoded string" , expected , actual); + String actual = HttpUnitUtils.decode(encodedString, "EUC-JP"); + assertEquals("decoded string", expected, actual); } - + /** * test parseContentHeader + * * @throws Exception */ + @Test public void testParseContentHeader() throws Exception { - String headers[]={ - "", - "text/plain", - "text/html; charset=Cp1252", - "text/html; charset=iso-8859-8", - "text/html; charset=EUC-JP", - "text/html charset=windows-1251", - "text/html; charset=utf-8", - "text/html; charset = utf-8", - "text/html; charset=\"iso-8859-8\"" - }; - String expected[][]={ - {"text/plain",null}, - {"text/plain",null}, - {"text/html","Cp1252"}, - {"text/html","iso-8859-8"}, - {"text/html","EUC-JP"}, - {"text/html","windows-1251"}, - {"text/html","utf-8"}, - {"text/html","utf-8"}, - {"text/html","iso-8859-8"} - }; - for (int i=0;i<headers.length;i++) { - String result[]=HttpUnitUtils.parseContentTypeHeader(headers[i]); - assertEquals(2, result.length); - assertEquals( "header "+i , expected[i][0] , result[0]); - assertEquals( "header "+i , expected[i][1] , result[1]); - } // for + String headers[] = { + "", + "text/plain", + "text/html; charset=Cp1252", + "text/html; charset=iso-8859-8", + "text/html; charset=EUC-JP", + "text/html charset=windows-1251", + "text/html; charset=utf-8", + "text/html; charset = utf-8", + "text/html; charset=\"iso-8859-8\"" + }; + String expected[][] = { + {"text/plain", null}, + {"text/plain", null}, + {"text/html", "Cp1252"}, + {"text/html", "iso-8859-8"}, + {"text/html", "EUC-JP"}, + {"text/html", "windows-1251"}, + {"text/html", "utf-8"}, + {"text/html", "utf-8"}, + {"text/html", "iso-8859-8"} + }; + for (int i = 0; i < headers.length; i++) { + String result[] = HttpUnitUtils.parseContentTypeHeader(headers[i]); + assertEquals(2, result.length); + assertEquals("header " + i, expected[i][0], result[0]); + assertEquals("header " + i, expected[i][1], result[1]); + } // for } + @Test public void testSpecifiedEncoding() throws Exception { String hebrewTitle = "\u05d0\u05d1\u05d2\u05d3"; String page = "<html><head><title>" + hebrewTitle + "</title></head>\n" + - "<body>This has no data\n" + - "</body></html>\n"; - defineResource( "SimplePage.html", page ); - setResourceCharSet( "SimplePage.html", "iso-8859-8", true ); + "<body>This has no data\n" + + "</body></html>\n"; + defineResource("SimplePage.html", page); + setResourceCharSet("SimplePage.html", "iso-8859-8", true); WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); - WebResponse simplePage = wc.getResponse( request ); + WebRequest request = new GetMethodWebRequest(getHostPath() + "/SimplePage.html"); + WebResponse simplePage = wc.getResponse(request); - assertEquals( "Title", hebrewTitle, simplePage.getTitle() ); - assertEquals( "Character set", "iso-8859-8", simplePage.getCharacterSet() ); + assertEquals("Title", hebrewTitle, simplePage.getTitle()); + assertEquals("Character set", "iso-8859-8", simplePage.getCharacterSet()); } + @Test public void testQuotedEncoding() throws Exception { String hebrewTitle = "\u05d0\u05d1\u05d2\u05d3"; String page = "<html><head><title>" + hebrewTitle + "</title></head>\n" + - "<body>This has no data\n" + - "</body></html>\n"; - defineResource( "SimplePage.html", page ); - setResourceCharSet( "SimplePage.html", "\"iso-8859-8\"", true ); + "<body>This has no data\n" + + "</body></html>\n"; + defineResource("SimplePage.html", page); + setResourceCharSet("SimplePage.html", "\"iso-8859-8\"", true); WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); - WebResponse simplePage = wc.getResponse( request ); + WebRequest request = new GetMethodWebRequest(getHostPath() + "/SimplePage.html"); + WebResponse simplePage = wc.getResponse(request); - assertEquals( "Title", hebrewTitle, simplePage.getTitle() ); - assertEquals( "Character set", "iso-8859-8", simplePage.getCharacterSet() ); + assertEquals("Title", hebrewTitle, simplePage.getTitle()); + assertEquals("Character set", "iso-8859-8", simplePage.getCharacterSet()); } + @Test public void testUnspecifiedEncoding() throws Exception { String hebrewTitle = "\u05d0\u05d1\u05d2\u05d3"; String page = "<html><head><title>" + hebrewTitle + "</title></head>\n" + - "<body>This has no data\n" + - "</body></html>\n"; - defineResource( "SimplePage.html", page ); - setResourceCharSet( "SimplePage.html", "iso-8859-8", false ); + "<body>This has no data\n" + + "</body></html>\n"; + defineResource("SimplePage.html", page); + setResourceCharSet("SimplePage.html", "iso-8859-8", false); - HttpUnitOptions.setDefaultCharacterSet( "iso-8859-8" ); + HttpUnitOptions.setDefaultCharacterSet("iso-8859-8"); WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); - WebResponse simplePage = wc.getResponse( request ); + WebRequest request = new GetMethodWebRequest(getHostPath() + "/SimplePage.html"); + WebResponse simplePage = wc.getResponse(request); - assertEquals( "Character set", "iso-8859-8", simplePage.getCharacterSet() ); - assertEquals( "Title", hebrewTitle, simplePage.getTitle() ); + assertEquals("Character set", "iso-8859-8", simplePage.getCharacterSet()); + assertEquals("Title", hebrewTitle, simplePage.getTitle()); } - public void testMetaEncoding() throws Exception { - String hebrewTitle = "\u05d0\u05d1\u05d2\u05d3"; - String page = "<html><head><title>" + hebrewTitle + "</title>" + - "<meta Http_equiv=content-type content=\"text/html; charset=iso-8859-8\"></head>\n" + - "<body>This has no data\n" + - "</body></html>\n"; - defineResource( "SimplePage.html", page ); - setResourceCharSet( "SimplePage.html", "iso-8859-8", false ); + @Test + public void testMetaEncoding() throws Exception { + String hebrewTitle = "\u05d0\u05d1\u05d2\u05d3"; + String page = "<html><head><title>" + hebrewTitle + "</title>" + + "<meta Http_equiv=content-type content=\"text/html; charset=iso-8859-8\"></head>\n" + + "<body>This has no data\n" + + "</body></html>\n"; + defineResource("SimplePage.html", page); + setResourceCharSet("SimplePage.html", "iso-8859-8", false); - WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); - WebResponse simplePage = wc.getResponse( request ); + WebConversation wc = new WebConversation(); + WebRequest request = new GetMethodWebRequest(getHostPath() + "/SimplePage.html"); + WebResponse simplePage = wc.getResponse(request); - assertEquals( "Character set", "iso-8859-8", simplePage.getCharacterSet() ); - assertEquals( "Title", hebrewTitle, simplePage.getTitle() ); + assertEquals("Character set", "iso-8859-8", simplePage.getCharacterSet()); + assertEquals("Title", hebrewTitle, simplePage.getTitle()); } + @Test public void testHebrewForm() throws Exception { String hebrewName = "\u05d0\u05d1\u05d2\u05d3"; - defineResource( "HebrewForm.html", - "<html><head></head>" + + defineResource("HebrewForm.html", + "<html><head></head>" + "<form method=POST action=\"SayHello\">" + - "<input type=text name=name><input type=submit></form></body></html>" ); - setResourceCharSet( "HebrewForm.html", "iso-8859-8", true ); - defineResource( "SayHello", new PseudoServlet() { + "<input type=text name=name><input type=submit></form></body></html>"); + setResourceCharSet("HebrewForm.html", "iso-8859-8", true); + defineResource("SayHello", new PseudoServlet() { public WebResource getPostResponse() { try { - String name = getParameter( "name" )[0]; - WebResource result = new WebResource( "<html><body><table><tr><td>Hello, " + - new String( name.getBytes( "iso-8859-1" ), "iso-8859-8" ) + - "</td></tr></table></body></html>" ); - result.setCharacterSet( "iso-8859-8" ); - result.setSendCharacterSet( true ); + String name = getParameter("name")[0]; + WebResource result = new WebResource("<html><body><table><tr><td>Hello, " + + new String(name.getBytes("iso-8859-1"), "iso-8859-8") + + "</td></tr></table></body></html>"); + result.setCharacterSet("iso-8859-8"); + result.setSendCharacterSet(true); return result; - } catch (java.io.UnsupportedEncodingException e) { + } catch (UnsupportedEncodingException e) { return null; } } - } ); + }); WebConversation wc = new WebConversation(); - WebResponse formPage = wc.getResponse( getHostPath() + "/HebrewForm.html" ); + WebResponse formPage = wc.getResponse(getHostPath() + "/HebrewForm.html"); WebForm form = formPage.getForms()[0]; WebRequest request = form.getRequest(); - request.setParameter( "name", hebrewName ); + request.setParameter("name", hebrewName); - WebResponse answer = wc.getResponse( request ); + WebResponse answer = wc.getResponse(request); String[][] cells = answer.getTables()[0].asText(); - assertEquals( "Message", "Hello, " + hebrewName, cells[0][0] ); - assertEquals( "Character set", "iso-8859-8", answer.getCharacterSet() ); + assertEquals("Message", "Hello, " + hebrewName, cells[0][0]); + assertEquals("Character set", "iso-8859-8", answer.getCharacterSet()); } + @Test public void testEncodedRequestWithoutForm() throws Exception { String hebrewName = "\u05d0\u05d1\u05d2\u05d3"; - defineResource( "SayHello", new PseudoServlet() { + defineResource("SayHello", new PseudoServlet() { public WebResource getPostResponse() { try { - String name = getParameter( "name" )[0]; - WebResource result = new WebResource( "<html><body><table><tr><td>Hello, " + - new String( name.getBytes( "iso-8859-1" ), "iso-8859-8" ) + - "</td></tr></table></body></html>" ); - result.setCharacterSet( "iso-8859-8" ); - result.setSendCharacterSet( true ); + String name = getParameter("name")[0]; + WebResource result = new WebResource("<html><body><table><tr><td>Hello, " + + new String(name.getBytes("iso-8859-1"), "iso-8859-8") + + "</td></tr></table></body></html>"); + result.setCharacterSet("iso-8859-8"); + result.setSendCharacterSet(true); return result; - } catch (java.io.UnsupportedEncodingException e) { + } catch (UnsupportedEncodingException e) { return null; } } - } ); + }); WebConversation wc = new WebConversation(); - HttpUnitOptions.setDefaultCharacterSet( "iso-8859-8" ); - WebRequest request = new PostMethodWebRequest( getHostPath() + "/SayHello" ); - request.setParameter( "name", hebrewName ); + HttpUnitOptions.setDefaultCharacterSet("iso-8859-8"); + WebRequest request = new PostMethodWebRequest(getHostPath() + "/SayHello"); + request.setParameter("name", hebrewName); - WebResponse answer = wc.getResponse( request ); + WebResponse answer = wc.getResponse(request); String[][] cells = answer.getTables()[0].asText(); - assertEquals( "Message", "Hello, " + hebrewName, cells[0][0] ); - assertEquals( "Character set", "iso-8859-8", answer.getCharacterSet() ); + assertEquals("Message", "Hello, " + hebrewName, cells[0][0]); + assertEquals("Character set", "iso-8859-8", answer.getCharacterSet()); } + @Test public void testUnsupportedEncoding() throws Exception { - defineResource( "SimplePage.html", "not much here" ); - addResourceHeader( "SimplePage.html", "Content-type: text/plain; charset=BOGUS"); + defineResource("SimplePage.html", "not much here"); + addResourceHeader("SimplePage.html", "Content-type: text/plain; charset=BOGUS"); WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest( getHostPath() + "/SimplePage.html" ); - WebResponse simplePage = wc.getResponse( request ); + WebRequest request = new GetMethodWebRequest(getHostPath() + "/SimplePage.html"); + WebResponse simplePage = wc.getResponse(request); - assertEquals( "Text", "not much here", simplePage.getText() ); - assertEquals( "Character set", WebResponse.getDefaultEncoding(), simplePage.getCharacterSet() ); + assertEquals("Text", "not much here", simplePage.getText()); + assertEquals("Character set", WebResponse.getDefaultEncoding(), simplePage.getCharacterSet()); } + @Test public void testJapaneseLinkParamNameWithValue() throws Exception { String japaneseUrl = "request?%A5%D8%A5%EB%A5%D7=2"; - defineWebPage( "Linker", "<a id='link' href='" + japaneseUrl + "'>goThere</a>" ); - setResourceCharSet( "Linker.html", "EUC-JP", true ); - defineResource( japaneseUrl, "You made it!" ); + defineWebPage("Linker", "<a id='link' href='" + japaneseUrl + "'>goThere</a>"); + setResourceCharSet("Linker.html", "EUC-JP", true); + defineResource(japaneseUrl, "You made it!"); WebConversation wc = new WebConversation(); - WebResponse formPage = wc.getResponse( getHostPath() + "/Linker.html" ); - WebResponse target = formPage.getLinkWithID( "link" ).click(); - assertEquals( "Resultant page", "You made it!", target.getText() ); + WebResponse formPage = wc.getResponse(getHostPath() + "/Linker.html"); + WebResponse target = formPage.getLinkWithID("link").click(); + assertEquals("Resultant page", "You made it!", target.getText()); } + @Test public void testJapaneseLinkParamNameWithoutValue() throws Exception { String japaneseUrl = "request?%A5%D8%A5%EB%A5%D7"; - defineWebPage( "Linker", "<a id='link' href='" + japaneseUrl + "'>goThere</a>" ); - setResourceCharSet( "Linker.html", "EUC-JP", true ); - defineResource( japaneseUrl, "You made it!" ); + defineWebPage("Linker", "<a id='link' href='" + japaneseUrl + "'>goThere</a>"); + setResourceCharSet("Linker.html", "EUC-JP", true); + defineResource(japaneseUrl, "You made it!"); WebConversation wc = new WebConversation(); - WebResponse formPage = wc.getResponse( getHostPath() + "/Linker.html" ); - WebResponse target = formPage.getLinkWithID( "link" ).click(); - assertEquals( "Resultant page", "You made it!", target.getText() ); + WebResponse formPage = wc.getResponse(getHostPath() + "/Linker.html"); + WebResponse target = formPage.getLinkWithID("link").click(); + assertEquals("Resultant page", "You made it!", target.getText()); } + @Test public void testSimpleEntityReplacement() throws Exception { String rawString = "Cox&&Forkum"; - assertEquals( "After substitution", "Cox&&Forkum", HttpUnitUtils.replaceEntities( rawString ) ); + assertEquals("After substitution", "Cox&&Forkum", HttpUnitUtils.replaceEntities(rawString)); } + @Test public void testSkipEntityReplacementOnBadString() throws Exception { String rawString = "Cox&Forkum"; - assertEquals( "After substitution", "Cox&Forkum", HttpUnitUtils.replaceEntities( rawString ) ); + assertEquals("After substitution", "Cox&Forkum", HttpUnitUtils.replaceEntities(rawString)); } + @Test public void testSkipEntityReplacementOnUnhandledEntity() throws Exception { String rawString = "<something>"; - assertEquals( "After substitution", "<something>", HttpUnitUtils.replaceEntities( rawString ) ); + assertEquals("After substitution", "<something>", HttpUnitUtils.replaceEntities(rawString)); } Modified: trunk/httpunit/src/test/java/com/meterware/httpunit/FileUploadTest.java =================================================================== --- trunk/httpunit/src/test/java/com/meterware/httpunit/FileUploadTest.java 2012-09-07 12:36:13 UTC (rev 1080) +++ trunk/httpunit/src/test/java/com/meterware/httpunit/FileUploadTest.java 2012-09-09 17:16:39 UTC (rev 1081) @@ -1,31 +1,32 @@ package com.meterware.httpunit; /******************************************************************************************************************** -* $Id$ -* -* Copyright (c) 2000-2002, 2007, Russell Gold -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -* documentation files (the "Software"), to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and -* to permit persons to whom the Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all copies or substantial portions -* of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -* DEALINGS IN THE SOFTWARE. -* -*******************************************************************************************************************/ + * $Id$ + * + * Copyright (c) 2000-2002, 2007, Russell Gold + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + * to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + *******************************************************************************************************************/ + import com.meterware.pseudoserver.PseudoServlet; import com.meterware.pseudoserver.WebResource; import com.meterware.httpunit.protocol.UploadFileSpec; +import org.junit.Test; import java.io.*; import java.util.StringTokenizer; -import java.net.URL; import java.net.URLEncoder; import javax.activation.DataSource; @@ -34,192 +35,180 @@ import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMultipart; -import junit.framework.Test; -import junit.framework.TestSuite; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; /** * A unit test of the file upload simulation capability. - **/ + */ public class FileUploadTest extends HttpUnitTest { - public static void main(String args[]) { - junit.textui.TestRunner.run( suite() ); - } - - - public static Test suite() { - return new TestSuite( FileUploadTest.class ); - } - - - public FileUploadTest( String name ) { - super( name ); - } - - - public void setUp() throws Exception { - super.setUp(); - } - - + @Test public void testParametersMultipartEncoding() throws Exception { - defineResource( "ListParams", new MimeEcho() ); - defineWebPage( "Default", "<form method=POST action = \"ListParams\" enctype=\"multipart/form-data\"> " + - "<Input type=text name=age value=12>" + - "<Textarea name=comment>first\nsecond</textarea>" + - "<Input type=submit name=update value=age>" + - "</form>" ); + defineResource("ListParams", new MimeEcho()); + defineWebPage("Default", "<form method=POST action = \"ListParams\" enctype=\"multipart/form-data\"> " + + "<Input type=text name=age value=12>" + + "<Textarea name=comment>first\nsecond</textarea>" + + "<Input type=submit name=update value=age>" + + "</form>"); WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest( getHostPath() + "/Default.html" ); - WebResponse simplePage = wc.getResponse( request ); + WebRequest request = new GetMethodWebRequest(getHostPath() + "/Default.html"); + WebResponse simplePage = wc.getResponse(request); WebRequest formSubmit = simplePage.getForms()[0].getRequest(); - WebResponse encoding = wc.getResponse( formSubmit ); - assertEquals( "http://dummy?age=12&comment=first%0D%0Asecond&update=age", "http://dummy?" + encoding.getText().trim() ); + WebResponse encoding = wc.getResponse(formSubmit); + assertEquals("http://dummy?age=12&comment=first%0D%0Asecond&update=age", "http://dummy?" + encoding.getText().trim()); } + @Test public void testFileParameterValidation() throws Exception { - defineWebPage( "Default", "<form method=POST action = \"ListParams\" enctype=\"multipart/form-data\"> " + - "<Input type=file name=message>" + - "<Input type=submit name=update value=age>" + - "... [truncated message content] |
From: <wol...@us...> - 2012-09-12 12:21:29
|
Revision: 1086 http://httpunit.svn.sourceforge.net/httpunit/?rev=1086&view=rev Author: wolfgang_fahl Date: 2012-09-12 12:21:19 +0000 (Wed, 12 Sep 2012) Log Message: ----------- converted to m2eclipse project Modified Paths: -------------- trunk/httpunit/.classpath trunk/httpunit/.project trunk/httpunit/.settings/org.eclipse.jdt.core.prefs Added Paths: ----------- trunk/httpunit/.settings/org.eclipse.core.resources.prefs trunk/httpunit/.settings/org.eclipse.m2e.core.prefs Modified: trunk/httpunit/.classpath =================================================================== --- trunk/httpunit/.classpath 2012-09-10 01:42:55 UTC (rev 1085) +++ trunk/httpunit/.classpath 2012-09-12 12:21:19 UTC (rev 1086) @@ -1,22 +1,9 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src"/> - <classpathentry kind="src" path="test"/> - <classpathentry kind="src" path="pending-tests"/> - <classpathentry kind="src" path="examples"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="lib" path="jars/quicksite.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/junit/junit/3.8.1/junit-3.8.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/nekohtml/nekohtml/0.9.5/nekohtml-0.9.5.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/rhino/js/1.6R5/js-1.6R5.jar" sourcepath="/pub/2008/rhino1_6R5.zip"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/xerces/xmlParserAPIs/2.6.1/xmlParserAPIs-2.6.1.jar" sourcepath="/pub/2008/Xerces-J-src.2.6.1.zip"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/xerces/xercesImpl/2.6.1/xercesImpl-2.6.1.jar"/> - <classpathentry kind="lib" path="META-INF"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/activation/activation/1.1/activation-1.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY/javax/mail/mail/1.4/mail-1.4.jar"/> - <classpathentry kind="lib" path="jars/maven-ant-tasks-2.0.9.jar"/> - <classpathentry kind="var" path="MAVEN_REPOSITORY"/> - <classpathentry kind="output" path="bin"/> -</classpath> +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="META-INF"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> Modified: trunk/httpunit/.project =================================================================== --- trunk/httpunit/.project 2012-09-10 01:42:55 UTC (rev 1085) +++ trunk/httpunit/.project 2012-09-12 12:21:19 UTC (rev 1086) @@ -1,17 +1,23 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>httpunit</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>httpunit</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/httpunit/.settings/org.eclipse.core.resources.prefs =================================================================== --- trunk/httpunit/.settings/org.eclipse.core.resources.prefs (rev 0) +++ trunk/httpunit/.settings/org.eclipse.core.resources.prefs 2012-09-12 12:21:19 UTC (rev 1086) @@ -0,0 +1,6 @@ +#Wed Sep 12 14:20:08 CEST 2012 +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/<project>=UTF-8 +encoding/META-INF=UTF-8 Property changes on: trunk/httpunit/.settings/org.eclipse.core.resources.prefs ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: trunk/httpunit/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/httpunit/.settings/org.eclipse.jdt.core.prefs 2012-09-10 01:42:55 UTC (rev 1085) +++ trunk/httpunit/.settings/org.eclipse.jdt.core.prefs 2012-09-12 12:21:19 UTC (rev 1086) @@ -1,70 +1,70 @@ -#Mon Jun 29 17:49:25 CEST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=ignore -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=ignore -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 +#Wed Sep 12 14:20:08 CEST 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=ignore +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.5 Added: trunk/httpunit/.settings/org.eclipse.m2e.core.prefs =================================================================== --- trunk/httpunit/.settings/org.eclipse.m2e.core.prefs (rev 0) +++ trunk/httpunit/.settings/org.eclipse.m2e.core.prefs 2012-09-12 12:21:19 UTC (rev 1086) @@ -0,0 +1,5 @@ +#Wed Sep 12 14:20:07 CEST 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 Property changes on: trunk/httpunit/.settings/org.eclipse.m2e.core.prefs ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2012-09-12 20:16:54
|
Revision: 1092 http://httpunit.svn.sourceforge.net/httpunit/?rev=1092&view=rev Author: wolfgang_fahl Date: 2012-09-12 20:16:44 +0000 (Wed, 12 Sep 2012) Log Message: ----------- switch to latest jtidy release as asked for by BR 2880636 by Chuck Betts Modified Paths: -------------- trunk/httpunit/pom.xml trunk/httpunit/src/main/java/com/meterware/httpunit/parsing/JTidyHTMLParser.java Modified: trunk/httpunit/pom.xml =================================================================== --- trunk/httpunit/pom.xml 2012-09-12 20:05:28 UTC (rev 1091) +++ trunk/httpunit/pom.xml 2012-09-12 20:16:44 UTC (rev 1092) @@ -1,271 +1,177 @@ <?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.sonatype.oss</groupId> - <artifactId>oss-parent</artifactId> - <version>7</version> - </parent> + <parent> + <groupId>org.sonatype.oss</groupId> + <artifactId>oss-parent</artifactId> + <version>7</version> + </parent> - <groupId>org.httpunit</groupId> - <artifactId>httpunit</artifactId> - <name>HttpUnit</name> - <version>1.7.2-SNAPSHOT</version> - <description>A library for testing websites programmatically</description> + <groupId>org.httpunit</groupId> + <artifactId>httpunit</artifactId> + <name>HttpUnit</name> + <version>1.7.2-SNAPSHOT</version> + <description>A library for testing websites programmatically</description> - <url>http://www.httpunit.org</url> + <url>http://www.httpunit.org</url> - <licenses> - <license> - <name>MIT</name> - <url>http://www.opensource.org/licenses/mit-license.php</url> - </license> - </licenses> + <licenses> + <license> + <name>MIT</name> + <url>http://www.opensource.org/licenses/mit-license.php</url> + </license> + </licenses> - <scm> - <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit</url> - <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit</developerConnection> - <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit</connection> - </scm> + <scm> + <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit</url> + <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit</developerConnection> + <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit</connection> + </scm> - <developers> - <developer> - <id>russgold</id> - <name>Russell Gold</name> - <organization>Oracle, Inc.</organization> - <roles> - <role>lead</role> - <role>developer</role> - </roles> - </developer> - <developer> - <id>wolfgang_fahl</id> - <name>Wolfgang Fahl</name> - <organization>BitPlan</organization> - <roles> - <role>lead</role> - <role>developer</role> - </roles> - </developer> - </developers> + <developers> + <developer> + <id>russgold</id> + <name>Russell Gold</name> + <organization>Oracle, Inc.</organization> + <roles> + <role>lead</role> + <role>developer</role> + </roles> + </developer> + <developer> + <id>wolfgang_fahl</id> + <name>Wolfgang Fahl</name> + <organization>BitPlan</organization> + <roles> + <role>lead</role> + <role>developer</role> + </roles> + </developer> + </developers> - <issueManagement> - <system>Sourceforge</system> - <url>http://sourceforge.net/tracker/?group_id=6550&atid=106550</url> - </issueManagement> + <issueManagement> + <system>Sourceforge</system> + <url>http://sourceforge.net/tracker/?group_id=6550&atid=106550</url> + </issueManagement> - <dependencies> - <dependency> - <groupId>rhino</groupId> - <artifactId>js</artifactId> - <version>1.6R5</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.7</version> - </dependency> - <dependency> - <groupId>nekohtml</groupId> - <artifactId>nekohtml</artifactId> - <version>0.9.5</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - </dependency> - <dependency> - <groupId>jtidy</groupId> - <artifactId>jtidy</artifactId> - <version>4aug2000r7-dev</version> - </dependency> - <dependency> - <groupId>xerces</groupId> - <artifactId>xercesImpl</artifactId> - <version>2.6.1</version> - </dependency> - <dependency> - <groupId>xerces</groupId> - <artifactId>xmlParserAPIs</artifactId> - <version>2.6.1</version> - </dependency> - <dependency> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - <version>1.4</version> - <scope>test</scope> - </dependency> - </dependencies> + <dependencies> + <dependency> + <groupId>rhino</groupId> + <artifactId>js</artifactId> + <version>1.6R5</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + </dependency> + <dependency> + <groupId>nekohtml</groupId> + <artifactId>nekohtml</artifactId> + <version>0.9.5</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + </dependency> + <!-- Java port of html tidy http://jtidy.sourceforge.net/ --> + <dependency> + <groupId>net.sf.jtidy</groupId> + <artifactId>jtidy</artifactId> + <version>r938</version> + </dependency> + <!-- <dependency> <groupId>jtidy</groupId> <artifactId>jtidy</artifactId> + <version>4aug2000r7-dev</version> </dependency> --> + <dependency> + <groupId>xerces</groupId> + <artifactId>xercesImpl</artifactId> + <version>2.6.1</version> + </dependency> + <dependency> + <groupId>xerces</groupId> + <artifactId>xmlParserAPIs</artifactId> + <version>2.6.1</version> + </dependency> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + <scope>test</scope> + </dependency> + </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.5</source> - <target>1.5</target> - <compilerArgument>-proc:none</compilerArgument> - </configuration> - </plugin> - </plugins> - <testResources> - <testResource> - <directory>META-INF</directory> - </testResource> - </testResources> - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>findbugs-maven-plugin</artifactId> - <version>2.5.1</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>2.5.1</version> - </plugin> - </plugins> - </reporting> - -<!-- - <build> - <sourceDirectory>src</sourceDirectory> - <testSourceDirectory>test</testSourceDirectory> - <testResources> - <testResource> - <directory>META-INF</directory> - </testResource> - </testResources> - <resources> - <resource> - <directory>META-INF</directory> - </resource> - </resources> <plugins> <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <executions> - <execution> - <id>attach-sources</id> - <phase>package</phase> - <goals> - <goal>jar</goal> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>1.0</version> - <executions> - <execution> - <id>add-source</id> - <phase>generate-sources</phase> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>src-1.4</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.3.2</version> <configuration> - <forkMode>never</forkMode> - <!- Assertions diasabled due to a bug in xmlbeans - https://issues.apache.org/jira/browse/XMLBEANS-317 -> - <enableAssertions>false</enableAssertions> - <excludes> - <exclude>**/TestSuite$1.class</exclude> - <exclude>**/EventAwareTestBase.class</exclude> - <exclude>**/WebClientTest.class</exclude> - <exclude>**/WebPageTest.class</exclude> - </excludes> + <source>1.5</source> + <target>1.5</target> + <compilerArgument>-proc:none</compilerArgument> </configuration> </plugin> </plugins> - + <testResources> + <testResource> + <directory>META-INF</directory> + </testResource> + </testResources> </build> + <reporting> <plugins> <plugin> - <artifactId>maven-javadoc-plugin</artifactId> - </plugin> - <plugin> - <artifactId>maven-surefire-report-plugin</artifactId> - <configuration> - <additionalClasspathElements> - <additionalClasspathElement> - META-INF - </additionalClasspathElement> - </additionalClasspathElements> - </configuration> - </plugin> - <plugin> - <artifactId>maven-jxr-plugin</artifactId> - </plugin> - <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> - <configuration> - <threshold>Normal</threshold> - </configuration> + <version>2.5.1</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> + <version>2.5.1</version> </plugin> </plugins> - </reporting> ---> - <!-- Jetty libraries needed for Testing BR [ 2264431 ] form.submit() sends multiple HTTP POSTS - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty</artifactId> - <version>6.1.4</version> - </dependency> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-naming</artifactId> - <version>6.1.4</version> - </dependency> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-plus</artifactId> - <version>6.1.4</version> - </dependency> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-util</artifactId> - <version>6.1.4</version> - </dependency> --> + <!-- <build> <sourceDirectory>src</sourceDirectory> <testSourceDirectory>test</testSourceDirectory> + <testResources> <testResource> <directory>META-INF</directory> </testResource> + </testResources> <resources> <resource> <directory>META-INF</directory> </resource> + </resources> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> + <executions> <execution> <id>attach-sources</id> <phase>package</phase> <goals> + <goal>jar</goal> <goal>test-jar</goal> </goals> </execution> </executions> + </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> + <version>1.0</version> <executions> <execution> <id>add-source</id> <phase>generate-sources</phase> + <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>src-1.4</source> + </sources> </configuration> </execution> </executions> </plugin> <plugin> + <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> + </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> + <configuration> <forkMode>never</forkMode> <!- Assertions diasabled due to + a bug in xmlbeans https://issues.apache.org/jira/browse/XMLBEANS-317 -> <enableAssertions>false</enableAssertions> + <excludes> <exclude>**/TestSuite$1.class</exclude> <exclude>**/EventAwareTestBase.class</exclude> + <exclude>**/WebClientTest.class</exclude> <exclude>**/WebPageTest.class</exclude> + </excludes> </configuration> </plugin> </plugins> </build> <reporting> <plugins> + <plugin> <artifactId>maven-javadoc-plugin</artifactId> </plugin> <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> <configuration> <additionalClasspathElements> + <additionalClasspathElement> META-INF </additionalClasspathElement> </additionalClasspathElements> + </configuration> </plugin> <plugin> <artifactId>maven-jxr-plugin</artifactId> + </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> + <configuration> <threshold>Normal</threshold> </configuration> </plugin> + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> + </plugin> </plugins> </reporting> --> + + <!-- Jetty libraries needed for Testing BR [ 2264431 ] form.submit() sends + multiple HTTP POSTS <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> + <version>6.1.4</version> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-naming</artifactId> <version>6.1.4</version> </dependency> + <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-plus</artifactId> + <version>6.1.4</version> </dependency> <dependency> <groupId>org.mortbay.jetty</groupId> + <artifactId>jetty-util</artifactId> <version>6.1.4</version> </dependency> --> </project> Modified: trunk/httpunit/src/main/java/com/meterware/httpunit/parsing/JTidyHTMLParser.java =================================================================== --- trunk/httpunit/src/main/java/com/meterware/httpunit/parsing/JTidyHTMLParser.java 2012-09-12 20:05:28 UTC (rev 1091) +++ trunk/httpunit/src/main/java/com/meterware/httpunit/parsing/JTidyHTMLParser.java 2012-09-12 20:16:44 UTC (rev 1092) @@ -85,9 +85,16 @@ final private static String UTF_ENCODING = "UTF-8"; + /** + * get the parser of the given url + * @param url + * @return the parser + */ private static Tidy getParser( URL url ) { Tidy tidy = new Tidy(); - tidy.setCharEncoding( org.w3c.tidy.Configuration.UTF8 ); + // BR 2880636 httpunit 1.7 does not work with latest Tidy release r918 + // tidy.setCharEncoding( org.w3c.tidy.Configuration.UTF8 ); + tidy.setInputEncoding("UTF8"); tidy.setQuiet( true ); tidy.setShowWarnings( HTMLParserFactory.isParserWarningsEnabled() ); if (!HTMLParserFactory.getHTMLParserListeners().isEmpty()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2012-09-13 08:01:49
|
Revision: 1098 http://httpunit.svn.sourceforge.net/httpunit/?rev=1098&view=rev Author: wolfgang_fahl Date: 2012-09-13 08:01:38 +0000 (Thu, 13 Sep 2012) Log Message: ----------- fixes FR 2836664 make WebRequestSource.getDestination() public by Dan Lipofsky and makes sure FR records will show up in release notes Modified Paths: -------------- trunk/httpunit/src/main/java/com/meterware/httpunit/WebRequestSource.java trunk/httpunit/svnlog2releasenotes.ksh Modified: trunk/httpunit/src/main/java/com/meterware/httpunit/WebRequestSource.java =================================================================== --- trunk/httpunit/src/main/java/com/meterware/httpunit/WebRequestSource.java 2012-09-13 07:35:31 UTC (rev 1097) +++ trunk/httpunit/src/main/java/com/meterware/httpunit/WebRequestSource.java 2012-09-13 08:01:38 UTC (rev 1098) @@ -199,7 +199,13 @@ return _baseURL; } - protected String getDestination() { + /** + * get the Destination + * made public per FR 2836664 make WebRequestSource.getDestination() public + * by Dan Lipofsky + * @return + */ + public String getDestination() { return getElement().getAttribute(_destinationAttribute); } Modified: trunk/httpunit/svnlog2releasenotes.ksh =================================================================== --- trunk/httpunit/svnlog2releasenotes.ksh 2012-09-13 07:35:31 UTC (rev 1097) +++ trunk/httpunit/svnlog2releasenotes.ksh 2012-09-13 08:01:38 UTC (rev 1098) @@ -92,6 +92,7 @@ buglink ="&group_id=6550&atid=106550" supportlink="&group_id=6550&atid=206550" patchlink ="&group_id=6550&atid=306550" + featurelink ="&group_id=6550&atid=356550" for (rev in text) { current=text[rev] # look for bug report or patch number - must have 6 digits + @@ -105,6 +106,8 @@ postfix=patchlink } else if (match(current,"SR")) { postfix=supportlink + } else if (match(current,"FR")) { + postfix=featurelink } else { postfix=buglink } @@ -129,4 +132,4 @@ fromdate=$1 getsvnlog -reformat \ No newline at end of file +reformat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2012-09-13 10:30:49
|
Revision: 1099 http://httpunit.svn.sourceforge.net/httpunit/?rev=1099&view=rev Author: wolfgang_fahl Date: 2012-09-13 10:30:38 +0000 (Thu, 13 Sep 2012) Log Message: ----------- added svn log results from 2009-09 to 2012-09 modified svnlog2releasenotes to use gawk and sort results and add date of modification in ISO format Modified Paths: -------------- trunk/httpunit/doc/release_notes.html trunk/httpunit/svnlog2releasenotes.ksh Modified: trunk/httpunit/doc/release_notes.html =================================================================== --- trunk/httpunit/doc/release_notes.html 2012-09-13 08:01:38 UTC (rev 1098) +++ trunk/httpunit/doc/release_notes.html 2012-09-13 10:30:38 UTC (rev 1099) @@ -1,5 +1,5 @@ <html> -<head><title>httpunit 1.7 release notes</title></head> +<head><title>httpunit 1.7.2 release notes</title></head> <body> <h1>HttpUnit release notes</h1> <pre> @@ -15,7 +15,8 @@ </ol> <h3>Limitations:</h3> <ol> - <li>JDK 1.4.2 or higher is required</li> + <li>JDK 1.5 or higher is required</li> + <li>JDK 1.4.2 or higher may be used by slightly modifying the source code</li> <li>JavaScript support does not include some DOM properties</li> <li>The JavaScript assignment Document.cookie= does not restrict the cookie by path and domain</li> <li>Only table cells and explicit paragraphs are recognized as text blocks</li> @@ -23,7 +24,7 @@ <h2>Revision History:</h2> -<h3>Version 1.7.x to be Released some time in the future after 2009-08-20</h3> +<h3>Version 1.7.2 Release 2012-10</h3> <h4>Acknowledgements:</h4> <ul> <li>Marc Guillemot for his change request to add the response to a HttpException</li> @@ -48,6 +49,163 @@ <li>redsonic and Adam Heath for proposing a patch to solve problems with getFormWithId()</li> <li>Oliver Wahlen for asking for a solution to get the bytes for a download result - WebResponse.getBytes() is now available for this purpose</li> </ul> +Please find more references to helpful people in the subversion history below. +<h4>Recent subversion history</h4> +<ol> + <li>2009-08-20: svn keywords set + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1045">r1045</a>) + </li> + <li>2009-08-20: test case for double quoted cookie problem pointed out by Mario V + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1046">r1046</a>) + </li> + <li>2009-08-20: Patch by Antoine Vernois: it implements getServerName() and getServerPort of ServletUnitHttpRequest. ServerName and ServerPort are extracted from request's URL instead of always returning localhost and 0. + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1047">r1047</a>) + </li> + <li>2009-08-20: 2009-08-20: 2009-08-20: Patch by Rick Huff: to implement the <br />getElementsWithClassName() method. This method returns those nodes <br />where there are more than one class name on the element. + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1048">r1048</a>) + </li> + <li>2009-08-21: Patch by Matthew Boedicker: post with authentication using inputstream + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1049">r1049</a>) + </li> + <li>2009-08-21: Patch by Dan Lipofsky - reset Listeners and allow switching off parsing. Switch off parsing for Head method. + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1050">r1050</a>) + </li> + <li>2009-08-21: fix for BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2534057&group_id=6550&atid=106550">2534057</a> by Igor Kanshin + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1051">r1051</a>) + </li> + <li>2009-08-21: add getSocketFactory convenience method as proposed by Florian Weimar + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1053">r1053</a>) + </li> + <li>2009-08-21: fixed examples (e.g. for changed behaviour of target web sites) + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1054">r1054</a>) + </li> + <li>2009-08-21: 2009-08-21: [ <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1163753&group_id=6550&atid=306550">1163753</a> ] partial patch for bug 771335 (DOM2 Events support) by <br />Rafal Krzewski + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1055">r1055</a>) + </li> + <li>2009-08-21: Svn Keywords set + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1056">r1056</a>) + </li> + <li>2009-08-21: Testcase for patch + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1057">r1057</a>) + </li> + <li>2009-08-21: Svn Keywords set + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1058">r1058</a>) + </li> + <li>2009-09-10: This patch adds support for creating and testing HTTP DELETE requests. - by Matthew M. Boedicker + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1061">r1061</a>) + </li> + <li>2009-12-22: 2009-12-22: Patch for issue when server returns empty content type value + workaround for regression<br />problem - do not try to redefine resources + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1062">r1062</a>) + </li> + <li>2010-05-06: comment for BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1672385&group_id=6550&atid=106550">1672385</a> of 2010-04-22 + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1063">r1063</a>) + </li> + <li>2010-05-06: type fixed as outlined in BR<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2595566&group_id=6550&atid=106550">2595566</a> by Sebastian Lisken + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1064">r1064</a>) + </li> + <li>2010-05-07: comment typo fixed + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1065">r1065</a>) + </li> + <li>2010-05-07: patch by Izzy Alanis - but test not working yet + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1066">r1066</a>) + </li> + <li>2010-05-07: patch for parseContentTypeHeader by Serge Maslyukov + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1067">r1067</a>) + </li> + <li>2010-05-07: patch by Serge Maslyukov for Triple dotted path handling + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1068">r1068</a>) + </li> + <li>2011-01-10: improved documentation and changed proxy settings to constants. Added System.out message to explain how to modify this example + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1069">r1069</a>) + </li> + <li>2011-01-10: fixed according to changes on simple.wiktionary.org + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1070">r1070</a>) + </li> + <li>2011-01-10: add suport for getDesktop if available + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1071">r1071</a>) + </li> + <li>2011-01-10: fixed to use Google Maps direction API + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1072">r1072</a>) + </li> + <li>2011-01-10: leave xml output untouched + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1073">r1073</a>) + </li> + <li>2011-01-11: You Tube Visitor example + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1074">r1074</a>) + </li> + <li>2011-01-11: new example + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1075">r1075</a>) + </li> + <li>2011-01-29: removed superfluous call - added comment + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1076">r1076</a>) + </li> + <li>2011-01-29: fix of BR<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2822484&group_id=6550&atid=306550">2822484</a> by gcc with supplied patch file httpunit-textarea-090923.patch + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1077">r1077</a>) + </li> + <li>2011-04-07: removed unused import + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1078">r1078</a>) + </li> + <li>2011-12-19: modified version number to 1.7.1 for maven builds + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1079">r1079</a>) + </li> + <li>2012-09-07: switch to full maven build to prepare for sync to maven central + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1080">r1080</a>) + </li> + <li>2012-09-09: switch to JUnit4 + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1081">r1081</a>) + </li> + <li>2012-09-10: fix jetty comment + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1082">r1082</a>) + </li> + <li>2012-09-10: [maven-release-plugin] prepare release httpunit-1.7.1 + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1083">r1083</a>) + </li> + <li>2012-09-10: [maven-release-plugin] copy for tag httpunit-1.7.1 + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1084">r1084</a>) + </li> + <li>2012-09-10: [maven-release-plugin] prepare for next development iteration + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1085">r1085</a>) + </li> + <li>2012-09-12: converted to m2eclipse project + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1086">r1086</a>) + </li> + <li>2012-09-12: add checks for InvocationContextFactory - clearly ServletAccessTest can not be run on it's own with this change + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1087">r1087</a>) + </li> + <li>2012-09-12: 2012-09-12: modified for BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2825872&group_id=6550&atid=106550">2825872</a> Cookie domains not stored correctly - ID: 2825872<br />by aptivate + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1088">r1088</a>) + </li> + <li>2012-09-12: 2012-09-12: adds fix for BR BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2822957&group_id=6550&atid=106550">2822957</a> Cannot remove file upload parameter once set in WebForm<br />by Chris Wilson + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1089">r1089</a>) + </li> + <li>2012-09-12: 2012-09-12: Fixes BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2834933&group_id=6550&atid=106550">2834933</a> There is no facility to allow recursive redirects<br />by Aptivate + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1090">r1090</a>) + </li> + <li>2012-09-12: 2012-09-12: switch to latest jtidy release as asked for by BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2880636&group_id=6550&atid=106550">2880636</a><br />by Chuck Betts + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1092">r1092</a>) + </li> + <li>2012-09-12: 2012-09-12: fixes BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2883515&group_id=6550&atid=106550">2883515</a> noscript tag parsing incorrect<br />by Matthias Hanisch + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1093">r1093</a>) + </li> + <li>2012-09-12: 2012-09-12: fix BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2946821&group_id=6550&atid=106550">2946821</a> getDOM changes since 1.5.4<br />by max + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1094">r1094</a>) + </li> + <li>2012-09-12: 2012-09-12: fixes BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2957505&group_id=6550&atid=106550">2957505</a> No 'opaque' causes NPE when attempting DigestAuthentication<br />by Jason McSwain + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1095">r1095</a>) + </li> + <li>2012-09-13: 2012-09-13: fixes BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=3076917&group_id=6550&atid=106550">3076917</a> Missing port number in URL from ServletUnitHtt<br />by bbogg + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1096">r1096</a>) + </li> + <li>2012-09-13: 2012-09-13: mostly fixes BR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=3301056&group_id=6550&atid=106550">3301056</a> ServletUnit handling Content-Type incorrectly<br />by Kevin Hunter - the default Content-Type can not be set to null or any other value at this time + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1097">r1097</a>) + </li> + <li>2012-09-13: 2012-09-13: 2012-09-13: fixes FR <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2836664&group_id=6550&atid=356550">2836664</a> make WebRequestSource.getDestination() public<br />by Dan Lipofsky<br />and makes sure FR records will show up in release notes + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1098">r1098</a>) + </li> + <li>2012-09-13: added svn log results from 2009-09 to 2012-09 + (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=1044">r1099</a>) + </li> +</ol> <h4>Problems fixed:</h4> <li>BR [<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1055450&group_id=6550&atid=106550">1055450</a> ] Error loading included script aborts entire request</li> <li>BR [<a href="http://sourceforge.net/tracker/index.php?func=detail&aid=2034998&group_id=6550&atid=106550">2034998</a> ] by Tiago Luchini + fix of another bug (<a href="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=991">r991</a>) </li> Modified: trunk/httpunit/svnlog2releasenotes.ksh =================================================================== --- trunk/httpunit/svnlog2releasenotes.ksh 2012-09-13 08:01:38 UTC (rev 1098) +++ trunk/httpunit/svnlog2releasenotes.ksh 2012-09-13 10:30:38 UTC (rev 1099) @@ -1,135 +1,145 @@ -# -# script for httpunit release notes formatting -# WF 2008-04-19 -# $Header$ -# - -# -# -# show usage -# -usage() { - echo "usage: svnlog2releasenotes [fromdate]" - echo " get the subversion repository notes and reformat to release notes" - echo " example: rnotes 2007-12 > recent.html" - exit 1 -} - - -# -# get the subversion log -# -getsvnlog() { - svn log https://httpunit.svn.sourceforge.net/svnroot/httpunit > svnlog.txt -} - -# -# reformat the subversion log to release notes format -# -reformat() { - cat svnlog.txt | awk -v fromdate="$fromdate" -v todate="$todate" ' -BEGIN { - FS="|" - quote="\x22" - amp="\x26" - ignores[i++]="comment added" - ignores[i++]="comments fixed" - ignores[i++]="comment improved" - ignores[i++]="^comment$" - ignores[i++]="^improved$" - ignores[i++]="^keywords$" - ignores[i++]="header" - ignores[i++]="^keywords$" - ignores[i++]="^removed duplicate$" - ignores[i++]="Header added" - ignores[i++]="Copyright year" - ignores[i++]="copyright year" - ignores[i++]="source formatting" - ignores[i++]="source code layout" - ignores[i++]="not for release notes" -} -/^------------------------------------------------------------------------/{ - svnindex++; next -} -/^r[0-9]+/ { - match($0,"^r[0-9]+") - rev=substr($0,RSTART+1,RLENGTH-1); - author=$2 - date=gsub(" ","",$3) - date=substr($3,1,10) - if (date>=fromdate) { - collect=(1==1) - } else { - collect=(1==0) - } - if (collect) { - # print rev,author,date - } - next -} -{ - for (ignore in ignores) { - echo ignores[ignore] - if (match($0,ignores[ignore])) { - collect=(1==0) - } - } - if (collect && length($0)>0){ - current=$0 - # encode html tags - gsub("<","\\<",current); - gsub(">","\\>",current); - if (text[rev]!="") - text[rev]=text[rev]"<br />" - text[rev]=text[rev]current - } - next -} -END { - print "<ol>" - repositorylink="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=" - baselink="http://sourceforge.net/tracker/index.php?func=detail" - buglink ="&group_id=6550&atid=106550" - supportlink="&group_id=6550&atid=206550" - patchlink ="&group_id=6550&atid=306550" - featurelink ="&group_id=6550&atid=356550" - for (rev in text) { - current=text[rev] - # look for bug report or patch number - must have 6 digits + - if (match(current,"[0-9][0-9][0-9][0-9][0-9][0-9]+")) { - rs=RSTART - rl=RLENGTH - # get the bug or patch number - linkno=substr(current,RSTART,RLENGTH) - # patch or bug? - if (match(current,"[p|P]atch")) { - postfix=patchlink - } else if (match(current,"SR")) { - postfix=supportlink - } else if (match(current,"FR")) { - postfix=featurelink - } else { - postfix=buglink - } - # replace number with link to sourceforge tracker - link=sprintf("<a href=%s%s&aid=%s%s%s>%s</a>",quote,baselink,linkno,postfix,quote,linkno); - current=substr(current,1,rs-1) link substr(current,rs+rl,length(current)) - } - printf(" <li>%s\n (<a href=%s%s%s%s>r%s</a>)\n </li>\n",current,quote,repositorylink,rev,quote,rev); - } - print "</ol>" -} -' -} - -# -# check number of command line parameters -# -if [ $# -lt 1 ] -then - usage -fi - -fromdate=$1 -getsvnlog -reformat +#!/bin/bash +# +# script for httpunit release notes formatting +# WF 2008-04-19 +# WF 2012-09-13 modified to use gawk and sort +# +# $Header$ +# + +# +# +# show usage +# +usage() { + echo "usage: svnlog2releasenotes [fromdate]" + echo " get the subversion repository notes and reformat to release notes" + echo " example: svnlog2releasenotes 2007-12 > recent.html" + exit 1 +} + + +# +# get the subversion log +# +getsvnlog() { + svn log https://httpunit.svn.sourceforge.net/svnroot/httpunit > svnlog.txt +} + +# +# reformat the subversion log to release notes format +# +reformat() { + cat svnlog.txt | gawk -v fromdate="$fromdate" -v todate="$todate" ' +BEGIN { + FS="|" + quote="\x22" + amp="\x26" + ignores[i++]="comment added" + ignores[i++]="comments fixed" + ignores[i++]="comment improved" + ignores[i++]="^comment$" + ignores[i++]="^improved$" + ignores[i++]="^keywords$" + ignores[i++]="header" + ignores[i++]="^keywords$" + ignores[i++]="^removed duplicate$" + ignores[i++]="Header added" + ignores[i++]="Copyright year" + ignores[i++]="copyright year" + ignores[i++]="source formatting" + ignores[i++]="source code layout" + ignores[i++]="not for release notes" +} +/^------------------------------------------------------------------------/{ + svnindex++; next +} +/^r[0-9]+/ { + match($0,"^r[0-9]+") + rev=substr($0,RSTART+1,RLENGTH-1); + # format revision to 0000 format + frev=sprintf("%04d",rev); + author=$2 + date=gsub(" ","",$3) + date=substr($3,1,10) + if (date>=fromdate) { + collect=(1==1) + } else { + collect=(1==0) + } + if (collect) { + # print rev,author,date + } + next +} +{ + for (ignore in ignores) { + echo ignores[ignore] + if (match($0,ignores[ignore])) { + collect=(1==0) + } + } + if (collect && length($0)>0){ + current=$0 + # encode html tags + gsub("<","\\<",current); + gsub(">","\\>",current); + if (text[frev]!="") + text[frev]=text[frev]"<br />" + text[frev]=date": "text[frev]current + } + next +} +END { + print "<ol>" + repositorylink="http://httpunit.svn.sourceforge.net/viewvc/httpunit?view=rev&revision=" + baselink="http://sourceforge.net/tracker/index.php?func=detail" + buglink ="&group_id=6550&atid=106550" + supportlink="&group_id=6550&atid=206550" + patchlink ="&group_id=6550&atid=306550" + featurelink ="&group_id=6550&atid=356550" + # sort + count=asorti(text,stext) + for (i=1;i<=count;i++) { + frev=stext[i] + current=text[frev] + # unformat revision from 0000 format + rev=sprintf("%d",frev) + # look for bug report or patch number - must have 6 digits + + if (match(current,"[0-9][0-9][0-9][0-9][0-9][0-9]+")) { + rs=RSTART + rl=RLENGTH + # get the bug or patch number + linkno=substr(current,RSTART,RLENGTH) + # patch or bug? + if (match(current,"[p|P]atch")) { + postfix=patchlink + } else if (match(current,"SR")) { + postfix=supportlink + } else if (match(current,"FR")) { + postfix=featurelink + } else { + postfix=buglink + } + # replace number with link to sourceforge tracker + link=sprintf("<a href=%s%s&aid=%s%s%s>%s</a>",quote,baselink,linkno,postfix,quote,linkno); + current=substr(current,1,rs-1) link substr(current,rs+rl,length(current)) + } + printf(" <li>%s\n (<a href=%s%s%s%s>r%s</a>)\n </li>\n",current,quote,repositorylink,rev,quote,rev); + } + print "</ol>" +} +' +} + +# +# check number of command line parameters +# +if [ $# -lt 1 ] +then + usage +fi + +fromdate=$1 +getsvnlog +reformat This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wol...@us...> - 2012-10-09 09:52:25
|
Revision: 1101 http://httpunit.svn.sourceforge.net/httpunit/?rev=1101&view=rev Author: wolfgang_fahl Date: 2012-10-09 09:52:14 +0000 (Tue, 09 Oct 2012) Log Message: ----------- fixes regression of tests due to JUnit 4.7 not properly handling order of @before annotations. Needs JUnit 4.10 to work patch supplied by Kai Moritz Modified Paths: -------------- trunk/httpunit/pom.xml trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java Property Changed: ---------------- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java Modified: trunk/httpunit/pom.xml =================================================================== --- trunk/httpunit/pom.xml 2012-09-20 05:51:54 UTC (rev 1100) +++ trunk/httpunit/pom.xml 2012-10-09 09:52:14 UTC (rev 1101) @@ -45,7 +45,7 @@ <developer> <id>wolfgang_fahl</id> <name>Wolfgang Fahl</name> - <organization>BitPlan</organization> + <organization>BITPlan GmbH http://www.bitplan.com</organization> <roles> <role>lead</role> <role>developer</role> @@ -67,7 +67,7 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.7</version> + <version>4.10</version> </dependency> <dependency> <groupId>nekohtml</groupId> Modified: trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java =================================================================== --- trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java 2012-09-20 05:51:54 UTC (rev 1100) +++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/HttpUserAgentTest.java 2012-10-09 09:52:14 UTC (rev 1101) @@ -2,7 +2,7 @@ /******************************************************************************************************************** * $Id$ * - * Copyright (c) 2002-2004, Russell Gold + * Copyright (c) 2002-2012, Russell Gold * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation @@ -26,6 +26,7 @@ import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Rule; import static org.junit.Assert.fail; import static org.junit.Assert.assertEquals; @@ -37,21 +38,8 @@ **/ public class HttpUserAgentTest { - private static final PseudoServerTestSupport testSupport = new PseudoServerTestSupport(); + @Rule public PseudoServerTestSupport testSupport = new PseudoServerTestSupport(); - - @BeforeClass - static public void setUpHttpUserAgentTest() throws Exception { - testSupport.setUpServer(); - } - - - @AfterClass - static public void tearDownHttpUserAgentTest() throws Exception { - testSupport.tearDownServer(); - } - - protected void defineResource( String resourceName, PseudoServlet servlet ) { testSupport.defineResource(resourceName, servlet); } Modified: trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java =================================================================== --- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java 2012-09-20 05:51:54 UTC (rev 1100) +++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java 2012-10-09 09:52:14 UTC (rev 1101) @@ -1,11 +1,46 @@ package com.meterware.pseudoserver; - +/******************************************************************************************************************** + * $Id$ + * + * Copyright (c) 2002-2012, Russell Gold + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + * to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + *******************************************************************************************************************/ import java.io.IOException; -public class PseudoServerTestSupport { +import org.junit.rules.ExternalResource; + +/** + * helper class for JUnit Tests of httpunit + * + */ +public class PseudoServerTestSupport extends ExternalResource { private String _hostPath; private PseudoServer _server; + @Override + public void before() throws Throwable { + setUpServer(); + } + + @Override + public void after() { + tearDownServer(); + } + public void setUpServer() throws IOException { _server = new PseudoServer(); _hostPath = "http://localhost:" + _server.getConnectedPort(); Property changes on: trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServerTestSupport.java ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |