[Httpunit-commit] SF.net SVN: httpunit:[1101] trunk/httpunit
Brought to you by:
russgold
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. |