From e445d0e78164c1197c51bfadcfa40e5b9468e9de Mon Sep 17 00:00:00 2001 From: wang--ge Date: Tue, 6 Aug 2024 15:44:15 +0800 Subject: [PATCH] fix test stuck (cherry picked from commit e54915edb9f3058efcb91ab2d4eea299657bf51b) --- httpunit.spec | 6 ++++- ...ce-getHostPath-with-its-real-address.patch | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 replace-getHostPath-with-its-real-address.patch diff --git a/httpunit.spec b/httpunit.spec index 9eac12e..4a1bf8c 100644 --- a/httpunit.spec +++ b/httpunit.spec @@ -1,6 +1,6 @@ Name: httpunit Version: 1.7 -Release: 2 +Release: 3 Epoch: 0 URL: http://httpunit.sourceforge.net/ Summary: Automated web site testing toolkit @@ -15,6 +15,7 @@ Patch1: httpunit-rhino-1.7.7.patch Patch2: httpunit-servlettest.patch Patch3: httpunit-servlet31.patch Patch4: junit4.patch +Patch5: replace-getHostPath-with-its-real-address.patch BuildRequires: jpackage-utils >= 0:1.6 ant >= 0:1.6 nekohtml jtidy junit >= 0:3.8 BuildRequires: glassfish-servlet-api <= 3.1.0 javamail >= 0:1.3 rhino java-devel >= 1:1.6.0 BuildRequires: javapackages-local @@ -88,6 +89,9 @@ popd %doc doc/* %changelog +* Tue Aug 06 2024 Ge Wang - 0:1.7-3 +- Fix test stuck + * Fri Sep 16 2022 caodongxia - 0:1.7-2 - Add glassfish-servlet-api version limit diff --git a/replace-getHostPath-with-its-real-address.patch b/replace-getHostPath-with-its-real-address.patch new file mode 100644 index 0000000..6cfedfe --- /dev/null +++ b/replace-getHostPath-with-its-real-address.patch @@ -0,0 +1,25 @@ +From e41b364407a1b11d80a60606cf61eb5954fc7111 Mon Sep 17 00:00:00 2001 +From: wang--ge +Date: Tue, 6 Aug 2024 17:49:46 +0800 +Subject: [PATCH] replace getHostPath with its real address + +--- + test/com/meterware/httpunit/WebClientTest.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/com/meterware/httpunit/WebClientTest.java b/test/com/meterware/httpunit/WebClientTest.java +index 08ffa0e..9a4b8a6 100644 +--- a/test/com/meterware/httpunit/WebClientTest.java ++++ b/test/com/meterware/httpunit/WebClientTest.java +@@ -864,7 +864,7 @@ public class WebClientTest extends HttpUnitTest { + defineResource( "Compressed.html", new CompressedPseudoServlet( expectedResponse, /* suppress length */ true ) ); + + WebConversation wc = new WebConversation(); +- WebResponse wr = wc.getResponse( getHostPath() + "/Compressed.html" ); ++ WebResponse wr = wc.getResponse("http://127.0.0.1:41649/Compressed.html"); + assertEquals( "Content-Encoding header", "gzip", wr.getHeaderField( "Content-encoding" ) ); + assertEquals( "Content-Type", "text/plain", wr.getContentType() ); + assertEquals( "Content", expectedResponse, wr.getText().trim() ); +-- +2.44.0 +