httpunit-commit Mailing List for httpunit
Brought to you by:
russgold
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(31) |
Oct
(39) |
Nov
(18) |
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(8) |
Feb
(5) |
Mar
(8) |
Apr
(25) |
May
(20) |
Jun
(23) |
Jul
(28) |
Aug
(10) |
Sep
(3) |
Oct
(32) |
Nov
(61) |
Dec
(24) |
| 2002 |
Jan
(50) |
Feb
(34) |
Mar
(35) |
Apr
(3) |
May
(25) |
Jun
(25) |
Jul
(30) |
Aug
(146) |
Sep
(49) |
Oct
(156) |
Nov
(121) |
Dec
(54) |
| 2003 |
Jan
(12) |
Feb
(79) |
Mar
(88) |
Apr
(26) |
May
(67) |
Jun
(29) |
Jul
(8) |
Aug
(16) |
Sep
(20) |
Oct
(17) |
Nov
|
Dec
(5) |
| 2004 |
Jan
|
Feb
(40) |
Mar
(30) |
Apr
(5) |
May
|
Jun
(83) |
Jul
(34) |
Aug
(20) |
Sep
(44) |
Oct
(46) |
Nov
|
Dec
(14) |
| 2005 |
Jan
(4) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(1) |
| 2006 |
Jan
|
Feb
|
Mar
(26) |
Apr
(8) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(36) |
May
(38) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(4) |
Oct
|
Nov
(18) |
Dec
(4) |
| 2009 |
Jan
|
Feb
(2) |
Mar
(3) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(35) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(9) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
(18) |
Nov
(1) |
Dec
|
|
From: <wol...@us...> - 2012-11-12 08:39:37
|
Revision: 1119
http://httpunit.svn.sourceforge.net/httpunit/?rev=1119&view=rev
Author: wolfgang_fahl
Date: 2012-11-12 08:39:31 +0000 (Mon, 12 Nov 2012)
Log Message:
-----------
javadoc comment added, Test for no servleet mapping defined added
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/servletunit/WebApplication.java
trunk/httpunit/src/test/java/com/meterware/servletunit/ConfigTest.java
Modified: trunk/httpunit/src/main/java/com/meterware/servletunit/WebApplication.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/servletunit/WebApplication.java 2012-10-22 11:06:16 UTC (rev 1118)
+++ trunk/httpunit/src/main/java/com/meterware/servletunit/WebApplication.java 2012-11-12 08:39:31 UTC (rev 1119)
@@ -787,6 +787,11 @@
}
+ /**
+ * get the Servlet
+ * @return the Servlet from the configuration
+ * @throws ServletException - e.g. if no configuration is available
+ */
public Servlet getServlet() throws ServletException {
if (getConfiguration() == null) throw new HttpNotFoundException( "No servlet mapping defined", _url );
Modified: trunk/httpunit/src/test/java/com/meterware/servletunit/ConfigTest.java
===================================================================
--- trunk/httpunit/src/test/java/com/meterware/servletunit/ConfigTest.java 2012-10-22 11:06:16 UTC (rev 1118)
+++ trunk/httpunit/src/test/java/com/meterware/servletunit/ConfigTest.java 2012-11-12 08:39:31 UTC (rev 1119)
@@ -20,9 +20,11 @@
*
*******************************************************************************************************************/
+import com.meterware.httpunit.HttpNotFoundException;
import com.meterware.httpunit.WebClient;
import com.meterware.httpunit.WebResponse;
import org.junit.Test;
+import org.xml.sax.SAXException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -52,8 +54,31 @@
assertEquals("content type", "text/plain", response.getContentType());
assertEquals("servlet name is " + ConfigServlet.class.getName(), response.getText());
}
+
+ @Test
+ /**
+ * Test added by WF 2012-11-12 to answer question on developers mailing list
+ * @throws Exception
+ */
+ public void testInvalidConfig() throws Exception {
+ final String resourceName = "something/interesting";
+ ServletRunner sr = new ServletRunner();
+ sr.registerServlet(resourceName, ConfigServlet.class.getName());
+ WebClient wc = sr.newClient();
+ try {
+ WebResponse response = wc.getResponse("http://localhost/" + "ISB/"+ resourceName);
+ fail("No Exception thrown");
+ } catch (Throwable th) {
+ // com.meterware.httpunit.HttpNotFoundException:
+ // Error on HTTP request: 404 No servlet mapping defined [http://localhost/ISB/something/interesting]
+ String expected="Error on HTTP request: 404 No servlet mapping defined [http://localhost/ISB/something/interesting]";
+ assertTrue("HttpNotFoundException expected",th instanceof HttpNotFoundException);
+ assertEquals("wrong exception message",expected,th.getMessage());
+ }
+ }
+
@Test
public void testContextAttributes() throws Exception {
final String servlet1Name = "something/interesting";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 11:06:27
|
Revision: 1118
http://httpunit.svn.sourceforge.net/httpunit/?rev=1118&view=rev
Author: russgold
Date: 2012-10-22 11:06:16 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 11:06:13 UTC (rev 1117)
+++ trunk/httpunit/pom.xml 2012-10-22 11:06:16 UTC (rev 1118)
@@ -33,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.2</version>
+ <version>1.7.3-SNAPSHOT</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -47,9 +47,9 @@
<scm>
- <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit/tags/httpunit-1.7.2</url>
- <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</developerConnection>
- <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</connection>
+ <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit</url>
+ <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</developerConnection>
+ <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</connection>
</scm>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 11:06:19
|
Revision: 1117
http://httpunit.svn.sourceforge.net/httpunit/?rev=1117&view=rev
Author: russgold
Date: 2012-10-22 11:06:13 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] copy for tag httpunit-1.7.2
Added Paths:
-----------
tags/httpunit-1.7.2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 11:06:16
|
Revision: 1116
http://httpunit.svn.sourceforge.net/httpunit/?rev=1116&view=rev
Author: russgold
Date: 2012-10-22 11:06:04 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] prepare release httpunit-1.7.2
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 11:04:17 UTC (rev 1115)
+++ trunk/httpunit/pom.xml 2012-10-22 11:06:04 UTC (rev 1116)
@@ -33,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.3-SNAPSHOT</version>
+ <version>1.7.2</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -47,9 +47,9 @@
<scm>
- <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit</url>
- <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</developerConnection>
- <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</connection>
+ <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit/tags/httpunit-1.7.2</url>
+ <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</developerConnection>
+ <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</connection>
</scm>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 11:04:23
|
Revision: 1115
http://httpunit.svn.sourceforge.net/httpunit/?rev=1115&view=rev
Author: russgold
Date: 2012-10-22 11:04:17 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
remove incorrectly tagged 1.7.1 version
Removed Paths:
-------------
tags/httpunit-1.7.1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 11:01:29
|
Revision: 1114
http://httpunit.svn.sourceforge.net/httpunit/?rev=1114&view=rev
Author: russgold
Date: 2012-10-22 11:01:23 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
remove incorrectly tagged 1.7.2 version
Removed Paths:
-------------
tags/httpunit-1.7.2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 01:24:02
|
Revision: 1113
http://httpunit.svn.sourceforge.net/httpunit/?rev=1113&view=rev
Author: russgold
Date: 2012-10-22 01:23:56 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 01:23:53 UTC (rev 1112)
+++ trunk/httpunit/pom.xml 2012-10-22 01:23:56 UTC (rev 1113)
@@ -33,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.2</version>
+ <version>1.7.3-SNAPSHOT</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -47,9 +47,9 @@
<scm>
- <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit/tags/httpunit-1.7.2</url>
- <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</developerConnection>
- <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</connection>
+ <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit</url>
+ <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</developerConnection>
+ <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</connection>
</scm>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 01:23:59
|
Revision: 1112
http://httpunit.svn.sourceforge.net/httpunit/?rev=1112&view=rev
Author: russgold
Date: 2012-10-22 01:23:53 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] copy for tag httpunit-1.7.2
Added Paths:
-----------
tags/httpunit-1.7.2/httpunit/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 01:23:50
|
Revision: 1111
http://httpunit.svn.sourceforge.net/httpunit/?rev=1111&view=rev
Author: russgold
Date: 2012-10-22 01:23:44 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] prepare release httpunit-1.7.2
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 01:22:15 UTC (rev 1110)
+++ trunk/httpunit/pom.xml 2012-10-22 01:23:44 UTC (rev 1111)
@@ -33,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.7.2</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -47,9 +47,9 @@
<scm>
- <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit</url>
- <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</developerConnection>
- <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</connection>
+ <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit/tags/httpunit-1.7.2</url>
+ <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</developerConnection>
+ <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</connection>
</scm>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 01:22:21
|
Revision: 1110
http://httpunit.svn.sourceforge.net/httpunit/?rev=1110&view=rev
Author: russgold
Date: 2012-10-22 01:22:15 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
correct scm info
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 00:56:20 UTC (rev 1109)
+++ trunk/httpunit/pom.xml 2012-10-22 01:22:15 UTC (rev 1110)
@@ -33,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.3-SNAPSHOT</version>
+ <version>1.7.2-SNAPSHOT</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -48,8 +48,8 @@
<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>
+ <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</developerConnection>
+ <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/trunk/httpunit</connection>
</scm>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 00:56:28
|
Revision: 1109
http://httpunit.svn.sourceforge.net/httpunit/?rev=1109&view=rev
Author: russgold
Date: 2012-10-22 00:56:20 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] prepare for next development iteration
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 00:56:15 UTC (rev 1108)
+++ trunk/httpunit/pom.xml 2012-10-22 00:56:20 UTC (rev 1109)
@@ -33,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.2</version>
+ <version>1.7.3-SNAPSHOT</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -47,9 +47,9 @@
<scm>
- <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit/tags/httpunit-1.7.2</url>
- <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</developerConnection>
- <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</connection>
+ <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>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 00:56:21
|
Revision: 1108
http://httpunit.svn.sourceforge.net/httpunit/?rev=1108&view=rev
Author: russgold
Date: 2012-10-22 00:56:15 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] copy for tag httpunit-1.7.2
Added Paths:
-----------
tags/httpunit-1.7.2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 00:56:14
|
Revision: 1107
http://httpunit.svn.sourceforge.net/httpunit/?rev=1107&view=rev
Author: russgold
Date: 2012-10-22 00:56:08 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
[maven-release-plugin] prepare release httpunit-1.7.2
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-22 00:46:04 UTC (rev 1106)
+++ trunk/httpunit/pom.xml 2012-10-22 00:56:08 UTC (rev 1107)
@@ -21,8 +21,7 @@
*
*******************************************************************************************************************/
-->
-<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">
+<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>
@@ -34,7 +33,7 @@
<groupId>org.httpunit</groupId>
<artifactId>httpunit</artifactId>
<name>HttpUnit</name>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.7.2</version>
<description>A library for testing websites programmatically</description>
<url>http://www.httpunit.org</url>
@@ -48,9 +47,9 @@
<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>
+ <url>http://httpunit.svn.sourceforge.net/viewvc/httpunit/tags/httpunit-1.7.2</url>
+ <developerConnection>scm:svn:https://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</developerConnection>
+ <connection>scm:svn:http://httpunit.svn.sourceforge.net/svnroot/httpunit/tags/httpunit-1.7.2</connection>
</scm>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rus...@us...> - 2012-10-22 00:46:10
|
Revision: 1106
http://httpunit.svn.sourceforge.net/httpunit/?rev=1106&view=rev
Author: russgold
Date: 2012-10-22 00:46:04 +0000 (Mon, 22 Oct 2012)
Log Message:
-----------
from Kai Moritz: Remove ServerSocketFactory - PseudoServer no longer reuses sockets
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java
Modified: trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java 2012-10-09 10:35:31 UTC (rev 1105)
+++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java 2012-10-22 00:46:04 UTC (rev 1106)
@@ -113,11 +113,19 @@
public PseudoServer( int socketTimeout ) {
_socketTimeout = socketTimeout;
_serverNum = ++_numServers;
+
+ try {
+ _serverSocket = new ServerSocket(0);
+ _serverSocket.setSoTimeout(1000);
+ } catch( IOException e ) {
+ System.out.println("Error while creating socket: " + e);
+ throw new RuntimeException(e);
+ }
Thread t = new Thread( "PseudoServer " + _serverNum ) {
public void run() {
while (_active) {
try {
- handleNewConnection( getServerSocket().accept() );
+ handleNewConnection( _serverSocket.accept() );
Thread.sleep( 20 );
} catch (InterruptedIOException e) {
} catch (IOException e) {
@@ -129,9 +137,9 @@
}
}
try {
- if (_serverSocket != null) ServerSocketFactory.release( _serverSocket );
- _serverSocket = null;
+ _serverSocket.close();
} catch (IOException e) {
+ System.out.println("Error while closing socket: " + e);
}
debug( "Pseudoserver shutting down" );
}
@@ -156,7 +164,7 @@
private static String replaceDebugToken( String message, String token, String replacement ) {
- return message.indexOf( token ) < 0 ? message : message.replaceFirst( token, replacement );
+ return !message.contains(token) ? message : message.replaceFirst( token, replacement );
}
@@ -169,7 +177,7 @@
* Returns the port on which this server is listening.
**/
public int getConnectedPort() throws IOException {
- return getServerSocket().getLocalPort();
+ return _serverSocket.getLocalPort();
}
@@ -471,22 +479,6 @@
}
- private ServerSocket getServerSocket() throws IOException {
- synchronized (this) {
- // if the socket has not been initialized yet
- if (_serverSocket == null) {
- // create one - either using the factory (reusing sockets)
- // or with no factory - getting a new socket each time
- if (useFactory)
- _serverSocket = ServerSocketFactory.newServerSocket();
- else
- _serverSocket = ServerSocketFactory.createNewServerSocket();
- }
- }
- return _serverSocket;
- }
-
-
private ServerSocket _serverSocket;
}
@@ -605,77 +597,6 @@
}
-/**
- * Factory for Server sockets
- */
-class ServerSocketFactory {
-
-
- // the list of sockets that have been created by the factory
- static private ArrayList _sockets = new ArrayList();
-
- static private int _outstandingSockets;
-
- // synchronization object
- static private Object _releaseSemaphore = new Object();
-
- /**
- * create a new ServerSocket
- * @return a new ServerSocket
- * @throws IOException
- */
- static synchronized ServerSocket createNewServerSocket() throws IOException {
- ServerSocket serverSocket = new ServerSocket(0);
- serverSocket.setSoTimeout(PseudoServer.DEFAULT_SOCKET_TIMEOUT);
- return serverSocket;
- }
-
- /**
- * create a new Server Socket
- * @return a Server Socket
- * @throws IOException
- */
- static synchronized ServerSocket newServerSocket() throws IOException {
-
- if (_sockets.isEmpty()
- && _outstandingSockets > PseudoServer.getWaitThreshhold()) {
- try {
- synchronized (_releaseSemaphore) {
- _releaseSemaphore.wait(PseudoServer
- .getSocketReleaseWaitTime());
- }
- } catch (InterruptedException e) {
- }
- ;
- }
- _outstandingSockets++;
- if (!_sockets.isEmpty()) {
- return (ServerSocket) _sockets.remove(0);
- } else {
- ServerSocket serverSocket=createNewServerSocket();
- return serverSocket;
- }
- }
-
- /**
- * release the given server Socket
- * @param serverSocket
- * @throws IOException
- */
- static synchronized void release(ServerSocket serverSocket)
- throws IOException {
- if (_sockets.size() >= 2 * PseudoServer.getWaitThreshhold()) {
- serverSocket.close();
- } else {
- _sockets.add(serverSocket);
- _outstandingSockets--;
- synchronized (_releaseSemaphore) {
- _releaseSemaphore.notify();
- }
- }
- }
-} // ServerSocketFactory
-
class RecordingOutputStream extends OutputStream {
private OutputStream _nestedStream;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2012-10-09 10:35:42
|
Revision: 1105
http://httpunit.svn.sourceforge.net/httpunit/?rev=1105&view=rev
Author: wolfgang_fahl
Date: 2012-10-09 10:35:31 +0000 (Tue, 09 Oct 2012)
Log Message:
-----------
copyright header added
Modified Paths:
--------------
trunk/httpunit/pom.xml
Property Changed:
----------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-09 10:32:27 UTC (rev 1104)
+++ trunk/httpunit/pom.xml 2012-10-09 10:35:31 UTC (rev 1105)
@@ -1,4 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/********************************************************************************************************************
+* $Id$
+*
+* Copyright (c) 2008-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.
+*
+*******************************************************************************************************************/
+-->
<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>
Property changes on: trunk/httpunit/pom.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ LastChangedDate LastChangedBy Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2012-10-09 10:32:38
|
Revision: 1104
http://httpunit.svn.sourceforge.net/httpunit/?rev=1104&view=rev
Author: wolfgang_fahl
Date: 2012-10-09 10:32:27 +0000 (Tue, 09 Oct 2012)
Log Message:
-----------
fixes dependency conflict for xeresImpl as suggested by Kai Moritz
Modified Paths:
--------------
trunk/httpunit/pom.xml
Modified: trunk/httpunit/pom.xml
===================================================================
--- trunk/httpunit/pom.xml 2012-10-09 10:25:31 UTC (rev 1103)
+++ trunk/httpunit/pom.xml 2012-10-09 10:32:27 UTC (rev 1104)
@@ -73,6 +73,12 @@
<groupId>nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>0.9.5</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -85,7 +91,7 @@
<artifactId>jtidy</artifactId>
<version>r938</version>
</dependency>
- <!-- <dependency> <groupId>jtidy</groupId> <artifactId>jtidy</artifactId>
+ <!-- <dependency> <groupId>jtidy</groupId> <artifactId>jtidy</artifactId>
<version>4aug2000r7-dev</version> </dependency> -->
<dependency>
<groupId>xerces</groupId>
@@ -140,38 +146,43 @@
</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>
- <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>
+ <!-- <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>
+ <!-- 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>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2012-10-09 10:25:40
|
Revision: 1103
http://httpunit.svn.sourceforge.net/httpunit/?rev=1103&view=rev
Author: wolfgang_fahl
Date: 2012-10-09 10:25:31 +0000 (Tue, 09 Oct 2012)
Log Message:
-----------
use only one static int for the DEFAULT_SOCKET_TIMEOUT
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java
Modified: trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java 2012-10-09 10:21:42 UTC (rev 1102)
+++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java 2012-10-09 10:25:31 UTC (rev 1103)
@@ -40,7 +40,7 @@
*/
public static final boolean useFactory=false;
- private static final int DEFAULT_SOCKET_TIMEOUT = 1000;
+ static final int DEFAULT_SOCKET_TIMEOUT = 1000;
private static final int INPUT_POLL_INTERVAL = 10;
@@ -610,8 +610,6 @@
*/
class ServerSocketFactory {
- // the default timeout in millisecs
- static public int DEFAULT_TIMEOUT=1000;
// the list of sockets that have been created by the factory
static private ArrayList _sockets = new ArrayList();
@@ -628,7 +626,7 @@
*/
static synchronized ServerSocket createNewServerSocket() throws IOException {
ServerSocket serverSocket = new ServerSocket(0);
- serverSocket.setSoTimeout(DEFAULT_TIMEOUT);
+ serverSocket.setSoTimeout(PseudoServer.DEFAULT_SOCKET_TIMEOUT);
return serverSocket;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2012-10-09 10:21:53
|
Revision: 1102
http://httpunit.svn.sourceforge.net/httpunit/?rev=1102&view=rev
Author: wolfgang_fahl
Date: 2012-10-09 10:21:42 +0000 (Tue, 09 Oct 2012)
Log Message:
-----------
SocketFactory use can be switched off and is switched off by default as suggested by Kai Moritz
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java
Modified: trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java 2012-10-09 09:52:14 UTC (rev 1101)
+++ trunk/httpunit/src/main/java/com/meterware/pseudoserver/PseudoServer.java 2012-10-09 10:21:42 UTC (rev 1102)
@@ -34,6 +34,12 @@
**/
public class PseudoServer {
+ /**
+ * allow factory use to be switched on and off
+ * by default the factory is not used any more since there were problems with the test cases as of 2012-10-09
+ */
+ public static final boolean useFactory=false;
+
private static final int DEFAULT_SOCKET_TIMEOUT = 1000;
private static final int INPUT_POLL_INTERVAL = 10;
@@ -467,7 +473,15 @@
private ServerSocket getServerSocket() throws IOException {
synchronized (this) {
- if (_serverSocket == null) _serverSocket = ServerSocketFactory.newServerSocket();
+ // if the socket has not been initialized yet
+ if (_serverSocket == null) {
+ // create one - either using the factory (reusing sockets)
+ // or with no factory - getting a new socket each time
+ if (useFactory)
+ _serverSocket = ServerSocketFactory.newServerSocket();
+ else
+ _serverSocket = ServerSocketFactory.createNewServerSocket();
+ }
}
return _serverSocket;
}
@@ -591,41 +605,79 @@
}
-
+/**
+ * Factory for Server sockets
+ */
class ServerSocketFactory {
- static private ArrayList _sockets = new ArrayList();
+ // the default timeout in millisecs
+ static public int DEFAULT_TIMEOUT=1000;
+
+ // the list of sockets that have been created by the factory
+ static private ArrayList _sockets = new ArrayList();
- static private int _outstandingSockets;
+ static private int _outstandingSockets;
- static private Object _releaseSemaphore = new Object();
+ // synchronization object
+ static private Object _releaseSemaphore = new Object();
- static synchronized ServerSocket newServerSocket() throws IOException {
- if (_sockets.isEmpty() && _outstandingSockets > PseudoServer.getWaitThreshhold()) {
- try { synchronized( _releaseSemaphore) {_releaseSemaphore.wait( PseudoServer.getSocketReleaseWaitTime() ); } } catch (InterruptedException e) {};
- }
- _outstandingSockets++;
- if (!_sockets.isEmpty()) {
- return (ServerSocket) _sockets.remove(0);
- } else {
- ServerSocket serverSocket = new ServerSocket(0);
- serverSocket.setSoTimeout( 1000 );
- return serverSocket;
- }
- }
+ /**
+ * create a new ServerSocket
+ * @return a new ServerSocket
+ * @throws IOException
+ */
+ static synchronized ServerSocket createNewServerSocket() throws IOException {
+ ServerSocket serverSocket = new ServerSocket(0);
+ serverSocket.setSoTimeout(DEFAULT_TIMEOUT);
+ return serverSocket;
+ }
+
+ /**
+ * create a new Server Socket
+ * @return a Server Socket
+ * @throws IOException
+ */
+ static synchronized ServerSocket newServerSocket() throws IOException {
+
+ if (_sockets.isEmpty()
+ && _outstandingSockets > PseudoServer.getWaitThreshhold()) {
+ try {
+ synchronized (_releaseSemaphore) {
+ _releaseSemaphore.wait(PseudoServer
+ .getSocketReleaseWaitTime());
+ }
+ } catch (InterruptedException e) {
+ }
+ ;
+ }
+ _outstandingSockets++;
+ if (!_sockets.isEmpty()) {
+ return (ServerSocket) _sockets.remove(0);
+ } else {
+ ServerSocket serverSocket=createNewServerSocket();
+ return serverSocket;
+ }
+ }
- static synchronized void release( ServerSocket serverSocket ) throws IOException {
- if (_sockets.size() >= 2 * PseudoServer.getWaitThreshhold()) {
- serverSocket.close();
- } else {
- _sockets.add( serverSocket );
- _outstandingSockets--;
- synchronized (_releaseSemaphore) { _releaseSemaphore.notify(); }
- }
- }
-}
+ /**
+ * release the given server Socket
+ * @param serverSocket
+ * @throws IOException
+ */
+ static synchronized void release(ServerSocket serverSocket)
+ throws IOException {
+ if (_sockets.size() >= 2 * PseudoServer.getWaitThreshhold()) {
+ serverSocket.close();
+ } else {
+ _sockets.add(serverSocket);
+ _outstandingSockets--;
+ synchronized (_releaseSemaphore) {
+ _releaseSemaphore.notify();
+ }
+ }
+ }
+} // ServerSocketFactory
-
class RecordingOutputStream extends OutputStream {
private OutputStream _nestedStream;
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.
|
|
From: <wol...@us...> - 2012-09-20 05:52:00
|
Revision: 1100
http://httpunit.svn.sourceforge.net/httpunit/?rev=1100&view=rev
Author: wolfgang_fahl
Date: 2012-09-20 05:51:54 +0000 (Thu, 20 Sep 2012)
Log Message:
-----------
make sure auxiliary class TestWindowProxy is not executed as Test Case by Junit
as pointed out by Kai Moritz
Modified Paths:
--------------
trunk/httpunit/src/test/java/com/meterware/httpunit/dom/TestWindowProxy.java
Modified: trunk/httpunit/src/test/java/com/meterware/httpunit/dom/TestWindowProxy.java
===================================================================
--- trunk/httpunit/src/test/java/com/meterware/httpunit/dom/TestWindowProxy.java 2012-09-13 10:30:38 UTC (rev 1099)
+++ trunk/httpunit/src/test/java/com/meterware/httpunit/dom/TestWindowProxy.java 2012-09-20 05:51:54 UTC (rev 1100)
@@ -2,7 +2,7 @@
/********************************************************************************************************************
* $Id$
*
- * Copyright (c) 2007, Russell Gold
+ * Copyright (c) 2007-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
@@ -20,6 +20,7 @@
*
*******************************************************************************************************************/
import org.junit.Assert;
+import org.junit.Ignore;
import java.util.Stack;
import java.net.URL;
@@ -32,6 +33,7 @@
/**
* @author <a href="mailto:rus...@ht...">Russell Gold</a>
*/
+@Ignore
class TestWindowProxy implements DomWindowProxy {
private static Stack _proxyCalls = new Stack();
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-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 07:35:41
|
Revision: 1097
http://httpunit.svn.sourceforge.net/httpunit/?rev=1097&view=rev
Author: wolfgang_fahl
Date: 2012-09-13 07:35:31 +0000 (Thu, 13 Sep 2012)
Log Message:
-----------
mostly fixes BR 3301056 ServletUnit handling Content-Type incorrectly
by Kevin Hunter - the default Content-Type can not be set to null or any other value at this time
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/httpunit/WebResponse.java
trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpResponse.java
Added Paths:
-----------
trunk/httpunit/src/test/java/com/meterware/servletunit/ContentTypeTest.java
Modified: trunk/httpunit/src/main/java/com/meterware/httpunit/WebResponse.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/httpunit/WebResponse.java 2012-09-13 06:47:15 UTC (rev 1096)
+++ trunk/httpunit/src/main/java/com/meterware/httpunit/WebResponse.java 2012-09-13 07:35:31 UTC (rev 1097)
@@ -1325,8 +1325,8 @@
_contentHeader = _contentType + ";charset=" + _characterSet;
} else {
String[] parts = HttpUnitUtils.parseContentTypeHeader( contentHeader );
- if (null != _client && null != _client.getClientProperties().getOverrideContextType()) {
- _contentType = _client.getClientProperties().getOverrideContextType();
+ if (null != _client && null != _client.getClientProperties().getOverrideContentType()) {
+ _contentType = _client.getClientProperties().getOverrideContentType();
} else {
_contentType = parts[0];
}
Modified: trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpResponse.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpResponse.java 2012-09-13 06:47:15 UTC (rev 1096)
+++ trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpResponse.java 2012-09-13 07:35:31 UTC (rev 1097)
@@ -487,19 +487,26 @@
return result;
}
+ /**
+ * Returns the headers defined for this response.
+ * @param name - the name of the field to get
+ **/
+ String getHeaderFieldDirect( String name ) {
+ ArrayList values;
+ synchronized (_headers) {
+ values = (ArrayList) _headers.get( name.toUpperCase() );
+ }
+ return values == null ? null : (String) values.get( 0 );
+ }
+
/**
* Returns the headers defined for this response.
+ * @param name
**/
String getHeaderField( String name ) {
if (!_headersComplete) completeHeaders();
-
- ArrayList values;
- synchronized (_headers) {
- values = (ArrayList) _headers.get( name.toUpperCase() );
- }
-
- return values == null ? null : (String) values.get( 0 );
+ return getHeaderFieldDirect(name);
}
@@ -564,7 +571,10 @@
private void completeHeaders() {
if (_headersComplete) return;
addCookieHeader();
- setHeader( "Content-Type", _contentType + "; charset=" + getCharacterEncoding() );
+ // BR 3301056 ServletUnit handling Content-Type incorrectly
+ if (getHeaderFieldDirect("Content-Type")==null) {
+ setHeader( "Content-Type", _contentType + "; charset=" + getCharacterEncoding() );
+ }
_headersComplete = true;
}
Added: trunk/httpunit/src/test/java/com/meterware/servletunit/ContentTypeTest.java
===================================================================
--- trunk/httpunit/src/test/java/com/meterware/servletunit/ContentTypeTest.java (rev 0)
+++ trunk/httpunit/src/test/java/com/meterware/servletunit/ContentTypeTest.java 2012-09-13 07:35:31 UTC (rev 1097)
@@ -0,0 +1,158 @@
+package com.meterware.servletunit;
+/********************************************************************************************************************
+ * $Id: ErrorTests.java 1081 2012-09-09 17:16:39Z russgold $
+ *
+ * Copyright (c) 2012, Russell Gold
+ * Copyright (c) 2011, NeoMedia Technologies, Inc.. All Rights Reserved except see below.
+ *
+ * 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 static org.junit.Assert.*;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.meterware.httpunit.GetMethodWebRequest;
+import com.meterware.httpunit.WebClient;
+import com.meterware.httpunit.WebRequest;
+import com.meterware.httpunit.WebResponse;
+
+/**
+ * Tests for BR 3301056 ServletUnit handling Content-Type incorrectly
+ * by Kevin Hunter
+ * @author wf
+ *
+ */
+public class ContentTypeTest
+{
+ private ServletRunner runner;
+
+ public ContentTypeTest()
+ {
+ }
+
+ @Before
+ public void setUp()
+ {
+ runner = new ServletRunner();
+ runner.registerServlet("/test1", TestServlet1.class.getName());
+ runner.registerServlet("/test2", TestServlet2.class.getName());
+ }
+
+ @After
+ public void tearDown()
+ {
+ runner.shutDown();
+ }
+
+ /*
+ * This test case demonstrates that ServletUnit incorrectly replaces the
+ * content type specified by the servlet with one of its own.
+ * (Expected behavior would be that ServletUnit would not alter the
+ * response coming back from the servlet under test.)
+ */
+ @Test
+ public void testProvidedContentTypeOverwritten() throws Exception
+ {
+ WebClient client = runner.newClient();
+ WebRequest request = new GetMethodWebRequest("http://localhost/test1");
+ WebResponse response = client.getResponse(request);
+ assertEquals(200, response.getResponseCode());
+ assertEquals(7, response.getContentLength());
+ assertEquals("<test/>", response.getText());
+ assertEquals("text/xml", response.getHeaderField("Content-Type"));
+ assertEquals("text/xml", response.getContentType());
+ }
+
+ /*
+ * This servlet returns a simple XML document, with Content-Type set
+ * to "text/xml"
+ */
+ public static class TestServlet1 extends HttpServlet
+ {
+ private static final long serialVersionUID = 5434730264615105319L;
+
+ public TestServlet1()
+ {
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ resp.setStatus(200);
+ resp.addHeader("Content-Type", "text/xml");
+ resp.setContentLength(7);
+ resp.getWriter().write("<test/>");
+ }
+ }
+
+ /*
+ * This test case demonstrates that ServletUnit incorrectly provides
+ * a content type when the servlet under test doesn't provide one.
+ * (Expected behavior would be that ServletUnit would not alter the
+ * response coming back from the servlet under test.)
+ */
+ @Test
+ public void testContentProvidedWhenNoneSpecified() throws Exception
+ {
+ WebClient client = runner.newClient();
+ WebRequest request = new GetMethodWebRequest("http://localhost/test2");
+ WebResponse response = client.getResponse(request);
+ assertEquals(200, response.getResponseCode());
+ assertEquals(7, response.getContentLength());
+ assertEquals("<test/>", response.getText());
+ assertNull(response.getHeaderField("No-Such-Header"));
+ // the BR proposes to have a default "null" content-type
+ // assertNull(response.getHeaderField("Content-Type"));
+ // unfortunately currently the default content type is "text/plain; charset=iso-8859-1"
+ // whereas the HttpUnitOptions default Content Type is "text/html" ...
+ // we'll check for the current state for the time being 2012-09-13
+ assertEquals("text/plain; charset=iso-8859-1",response.getHeaderField("Content-Type"));
+ }
+
+ /*
+ * This servlet returns a simple XML document, but omits the
+ * Content-Type header.
+ */
+ public static class TestServlet2 extends HttpServlet
+ {
+ private static final long serialVersionUID = 5434730264615105319L;
+
+ public TestServlet2()
+ {
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ resp.setStatus(200);
+ resp.setContentLength(7);
+ resp.getWriter().write("<test/>");
+ }
+ }
+}
+
Property changes on: trunk/httpunit/src/test/java/com/meterware/servletunit/ContentTypeTest.java
___________________________________________________________________
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-13 06:47:25
|
Revision: 1096
http://httpunit.svn.sourceforge.net/httpunit/?rev=1096&view=rev
Author: wolfgang_fahl
Date: 2012-09-13 06:47:15 +0000 (Thu, 13 Sep 2012)
Log Message:
-----------
fixes BR 3076917 Missing port number in URL from ServletUnitHtt
by bbogg
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpRequest.java
trunk/httpunit/src/test/java/com/meterware/servletunit/HttpServletRequestTest.java
Modified: trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpRequest.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpRequest.java 2012-09-12 21:44:32 UTC (rev 1095)
+++ trunk/httpunit/src/main/java/com/meterware/servletunit/ServletUnitHttpRequest.java 2012-09-13 06:47:15 UTC (rev 1096)
@@ -735,6 +735,8 @@
try {
url.append( _request.getURL().getProtocol() ).append( "://" );
url.append( _request.getURL().getHost() );
+ String portPortion = _request.getURL().getPort() == -1 ? "" : (":" + _request.getURL().getPort());
+ url.append(portPortion);
url.append( _request.getURL().getPath() );
} catch (MalformedURLException e) {
throw new RuntimeException( "unable to read URL from request: " + _request );
Modified: trunk/httpunit/src/test/java/com/meterware/servletunit/HttpServletRequestTest.java
===================================================================
--- trunk/httpunit/src/test/java/com/meterware/servletunit/HttpServletRequestTest.java 2012-09-12 21:44:32 UTC (rev 1095)
+++ trunk/httpunit/src/test/java/com/meterware/servletunit/HttpServletRequestTest.java 2012-09-13 06:47:15 UTC (rev 1096)
@@ -579,21 +579,47 @@
}
- @Test
- public void testGetRequestURI() throws Exception {
+
+ /**
+ * test getting the uri
+ * @param uri
+ * @param path
+ */
+ public void testGetRequestURI(String uri,String path) throws Exception {
+ /*
+ http://de.wikipedia.org/wiki/Uniform_Resource_Identifier
+
+ foo://example.com:8042/over/there?name=ferret#nose
+ \_/ \______________/\_________/ \_________/ \__/
+ | | | | |
+ scheme authority path query fragment
+ */
ServletUnitContext context = _context;
- WebRequest wr = new GetMethodWebRequest("http://localhost/simple");
+ WebRequest wr = new GetMethodWebRequest(uri);
ServletUnitHttpRequest request = new ServletUnitHttpRequest(NULL_SERVLET_REQUEST, wr, context, new Hashtable(), NO_MESSAGE_BODY);
- assertEquals("/simple", request.getRequestURI());
- assertEquals("http://localhost/simple", request.getRequestURL().toString());
+ assertEquals(path, request.getRequestURI());
+ assertEquals(uri, request.getRequestURL().toString());
- wr = new GetMethodWebRequest("http://localhost/simple?foo=bar");
+ wr = new GetMethodWebRequest(uri+"?foo=bar");
request = new ServletUnitHttpRequest(NULL_SERVLET_REQUEST, wr, context, new Hashtable(), NO_MESSAGE_BODY);
- assertEquals("/simple", request.getRequestURI());
- assertEquals("http://localhost/simple", request.getRequestURL().toString());
+ assertEquals(path, request.getRequestURI());
+ assertEquals(uri, request.getRequestURL().toString());
}
+
+ @Test
+ public void testGetRequestURI() throws Exception {
+ testGetRequestURI("http://localhost/simple","/simple");
+ }
+ /**
+ * test for BR 3076917 Missing port number in URL from ServletUnitHttpRequest
+ * @throws Exception
+ */
+ @Test
+ public void testGetRequestURIWithPort() throws Exception {
+ testGetRequestURI("http://localhost:8042/simple8042","/simple8042");
+ }
@Test
public void testDefaultLocale() throws Exception {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2012-09-12 21:44:38
|
Revision: 1095
http://httpunit.svn.sourceforge.net/httpunit/?rev=1095&view=rev
Author: wolfgang_fahl
Date: 2012-09-12 21:44:32 +0000 (Wed, 12 Sep 2012)
Log Message:
-----------
fixes BR 2957505 No 'opaque' causes NPE when attempting DigestAuthentication
by Jason McSwain
Modified Paths:
--------------
trunk/httpunit/src/main/java/com/meterware/httpunit/AuthenticationChallenge.java
trunk/httpunit/src/test/java/com/meterware/httpunit/WebClientTest.java
Modified: trunk/httpunit/src/main/java/com/meterware/httpunit/AuthenticationChallenge.java
===================================================================
--- trunk/httpunit/src/main/java/com/meterware/httpunit/AuthenticationChallenge.java 2012-09-12 21:24:01 UTC (rev 1094)
+++ trunk/httpunit/src/main/java/com/meterware/httpunit/AuthenticationChallenge.java 2012-09-12 21:44:32 UTC (rev 1095)
@@ -144,7 +144,8 @@
append( sb, "nonce", nonce );
append( sb, "uri", uri );
append( sb, "response", getResponse( userName, realm, password, nonce, uri, method ) );
- append( sb, "opaque", opaque );
+ if (opaque!=null)
+ append( sb, "opaque", opaque );
}
Modified: trunk/httpunit/src/test/java/com/meterware/httpunit/WebClientTest.java
===================================================================
--- trunk/httpunit/src/test/java/com/meterware/httpunit/WebClientTest.java 2012-09-12 21:24:01 UTC (rev 1094)
+++ trunk/httpunit/src/test/java/com/meterware/httpunit/WebClientTest.java 2012-09-12 21:44:32 UTC (rev 1095)
@@ -520,23 +520,23 @@
WebResponse wr = wc.getResponse("http://someserver.com/sample");
assertEquals("authorization", "Basic dXNlcjpwYXNzd29yZA==", wr.getText());
}
-
-
+
/**
- * Verifies one-time digest authentication with no Quality of Protection (qop).
- *
- * @throws Exception if an unexpected exception is thrown during the test.
+ * test Rfc2069 optionally with or without opaque parameter
+ * @param withOpaque
+ * @throws Exception
*/
- @Test
- public void testRfc2069DigestAuthentication() throws Exception {
+ public void testRfc2069DigestAuthentication(final boolean withOpaque) throws Exception {
defineResource("/dir/index.html", new PseudoServlet() {
public WebResource getGetResponse() {
String header = getHeader("Authorization");
if (header == null) {
WebResource resource = new WebResource("not authorized", HttpURLConnection.HTTP_UNAUTHORIZED);
- resource.addHeader("WWW-Authenticate: Digest realm=\"tes...@ho...\"," +
- " nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\"," +
- " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"");
+ String headerStr="WWW-Authenticate: Digest realm=\"tes...@ho...\"," +
+ " nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\";";
+ if (withOpaque)
+ headerStr+=", opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"";
+ resource.addHeader(headerStr);
return resource;
} else {
return new WebResource(getHeader("Authorization"), "text/plain");
@@ -546,19 +546,39 @@
WebConversation wc = new WebConversation();
wc.setAuthentication("tes...@ho...", "Mufasa", "CircleOfLife");
WebResponse wr = wc.getResponse(getHostPath() + "/dir/index.html");
+ String expectedHeaderStr="Digest username=\"Mufasa\"," +
+ " realm=\"tes...@ho...\"," +
+ " nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\"," +
+ " uri=\"/dir/index.html\"," +
+ " response=\"1949323746fe6a43ef61f9606e7febea\"";
+ if (withOpaque)
+ expectedHeaderStr+=", opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"";
HttpHeader expectedHeader
- = new HttpHeader("Digest username=\"Mufasa\"," +
- " realm=\"tes...@ho...\"," +
- " nonce=\"dcd98b7102dd2f0e8b11d0f600bfb0c093\"," +
- " uri=\"/dir/index.html\"," +
- " response=\"1949323746fe6a43ef61f9606e7febea\"," +
- " opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"");
+ = new HttpHeader(expectedHeaderStr);
HttpHeader actualHeader = new HttpHeader(wr.getText());
assertHeadersEquals(expectedHeader, actualHeader);
}
-
/**
+ * Verifies one-time digest authentication with no Quality of Protection (qop).
+ *
+ * @throws Exception if an unexpected exception is thrown during the test.
+ */
+ @Test
+ public void testRfc2069DigestAuthentication() throws Exception {
+ testRfc2069DigestAuthentication(true);
+ }
+
+ /**
+ * test for BR 2957505
+ * No 'opaque' causes NPE when attempting DigestAuthentication
+ */
+ @Test
+ public void testRfc2069DigestAuthenticationNoOpaque() throws Exception {
+ testRfc2069DigestAuthentication(false);
+ }
+
+ /**
* Verifies one-time digest authentication with Quality of Protection (qop).
*
* @throws Exception
@@ -597,6 +617,15 @@
assertHeadersEquals(expectedHeader, actualHeader);
}
+ /**
+ * get page contents
+ * @param pageAddress
+ * @param protectionDomain
+ * @param userName
+ * @param password
+ * @return the page content
+ * @throws Exception
+ */
private static String getPageContents(String pageAddress, String protectionDomain, String userName, String password) throws Exception {
WebConversation wc = new WebConversation();
wc.setAuthentication(protectionDomain, userName, password);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|