This was intended to be a bug fix that locked down the behavior to
that of the en_US locale so that servers weren't forced to run in
that locale when testing. Apparently the fix is incomplete. At
this point it's probably best to back out that fix and live with the
restriction.
Whether such a fix should've even been considered for Jakarta EE 8
is a good question...
Kevin Sutter wrote on 7/9/19 1:39 PM:
Hmmm... Am
I reading this wrong? It sounds like some testcases changed
after
Java EE 8 TCK was contributed to Jakarta EE 8?
https://github.com/eclipse-ee4j/jakartaee-tck/commit/5d63739aa87016a4bb35516039ac7e83b30298a9#diff-fe27b4530bdef6baa5447c990d9f786f
I can fully
understand
some changes required for the test harness or infrastructure to
get everything
running in the Eclipse environment. But, we shouldn't have
changed
any testcases. Not yet anyway... All app servers that were
Java EE 8 certified should be able to run the Jakarta EE 8 TCK
without
any coding changes. If we're allowing code changes to the
actual
testcases, that promise goes out the window. Can someone
clarify?
Thanks!
---------------------------------------------------
Kevin Sutter
STSM, MicroProfile and Jakarta EE architect
e-mail: sutter@xxxxxxxxxx Twitter: @kwsutter
phone: tl-553-3620 (office), 507-253-3620 (office)
LinkedIn: https://www.linkedin.com/in/kevinwsutter
From:
Hank
Ibell <hwibell@xxxxxxxxx>
To:
jakartaee-tck-dev@xxxxxxxxxxx
Date:
07/08/2019
09:55 AM
Subject:
[EXTERNAL]
[jakartaee-tck-dev] Incorrect parsing of expiry date in
servlet/api/javax_servlet_http/cookie#setMaxAgePositiveTest
Sent
by: jakartaee-tck-dev-bounces@xxxxxxxxxxx
Hello all,
When trying to run the servlet test
`com.sun.ts.tests.servlet.api.javax_servlet_http.cookie.setMaxAgePositiveTest()`,
I am seeing what looks to be a weird parsing error: The expiry
date was
incorrect, expected =Mon Jul 08 09:21:00 EDT 2019, result = Sat
Jul 08
08:21:00 EST 19. The dates appear to be the same but the days
are different.
Trace showing request and
response:
```
[javatest.batch] 07-08-2019
09:21:40:
[HttpRequest] Dispatching request: 'GET
/servlet_jsh_cookie_web/TestServlet?testname=setMaxAgeVer0PositiveTest
HTTP/1.1' to target server at 'localhost:9080'
[javatest.batch] 07-08-2019 09:21:40: TRACE: ########## The
real
value set: false
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - >>
"GET
/servlet_jsh_cookie_web/TestServlet?testname=setMaxAgeVer0PositiveTest
HTTP/1.1[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - >>
"User-Agent:
Jakarta Commons-HttpClient/3.1[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - >>
"Host:
localhost:9080[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - >>
"[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"HTTP/1.1
200 OK[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"HTTP/1.1
200 OK[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"X-Powered-By:
Servlet/4.0[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Content-Type:
text/plain;charset=ISO-8859-1[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"testDate:
2019-07-08 13:21[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Content-Language:
en-US[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Set-Cookie:
name1=value1; Expires=Mon, 08-Jul-19 13:21:42 GMT[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Transfer-Encoding:
chunked[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Date:
Mon, 08 Jul 2019 13:21:40 GMT[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Expires:
Thu, 01 Dec 1994 16:00:00 GMT[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Cache-Control:
no-cache="set-cookie, set-cookie2"[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: Found 1 set-cookie
entry
[javatest.batch] 07-08-2019 09:21:40: TRACE: Checking
set-cookiei
0:Set-Cookie: name1=value1; Expires=Mon, 08-Jul-19 13:21:42 GMT
[javatest.batch]
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"c"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\r]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"Test
PASSED[\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\r]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"0"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\r]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\r]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] - <<
"[\r][\n]"
[javatest.batch] 07-08-2019 09:21:40: TRACE: [WIRE] -
HttpConnectionManager
is null. Connection cannot be released.
[javatest.batch] 07-08-2019 09:21:40: ERROR: The expiry date
was
incorrect, expected =Mon Jul 08 09:21:00 EDT 2019, result = Sat
Jul 08
08:21:00 EST 19
[javatest.batch] 07-08-2019 09:21:40: ERROR: Exception
occurred:
com.sun.ts.lib.harness.EETest$Fault: The expiry date was
incorrect, expected
=Mon Jul 08 09:21:00 EDT 2019, result = Sat Jul 08 08:21:00 EST
19
[javatest.batch] 07-08-2019 09:21:40: ERROR: Test case throws
exception:
Exception occurred: com.sun.ts.lib.harness.EETest$Fault: The
expiry date
was incorrect, expected =Mon Jul 08 09:21:00 EDT 2019, result =
Sat Jul
08 08:21:00 EST 19
[javatest.batch] 07-08-2019 09:21:40: ERROR: Exception at:
[javatest.batch] 07-08-2019 09:21:40: ERROR:
com.sun.ts.lib.harness.EETest$Fault:
Exception occurred: com.sun.ts.lib.harness.EETest$Fault: The
expiry date
was incorrect, expected =Mon Jul 08 09:21:00 EDT 2019, result =
Sat Jul
08 08:21:00 EST 19
[javatest.batch] at
com.sun.ts.tests.servlet.api.javax_servlet_http.cookie.URLClient.setMaxAgePositiveTest(URLClient.java:368)
```
The test used to pass under EE8 and
is
failing with the Jakarta TCK; it looks like this may be due to
changes
introduced with 5d63739:
https://github.com/eclipse-ee4j/jakartaee-tck/commit/5d63739aa87016a4bb35516039ac7e83b30298a9#diff-fe27b4530bdef6baa5447c990d9f786f
I rebuilt the test after removing
the
date format `CUSTOM_HEADER_DATE_FORMAT` and the test passes
again. I then
tried changing the date format for testDate to match the
Netscape format
for expiry date of Set-Cookie and it also passes.
```
diff --git
a/src/com/sun/ts/tests/servlet/api/javax_servlet_http/cookie/TestServlet.javab/src/com/sun/ts/tests/servlet/api/javax_servlet_http/cookie/TestServlet.java
index db94afa1..4fa54f5f 100644
---
a/src/com/sun/ts/tests/servlet/api/javax_servlet_http/cookie/TestServlet.java
+++
b/src/com/sun/ts/tests/servlet/api/javax_servlet_http/cookie/TestServlet.java
@@ -72,7 +72,7 @@ import java.util.TimeZone;
public class TestServlet extends HttpTCKServlet {
- public static String CUSTOM_HEADER_DATE_FORMAT = "yyyy-MM-dd
HH:mm";
+ public static String CUSTOM_HEADER_DATE_FORMAT = "E, dd-MM-yy
HH:mm:ss";
public void cloneTest(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
```
Note: Our server, by default, uses
the
latest RFC-compliant date format, but HttpClient did not like it
so we
had to configure it to use the Netscape cookie expiry format.
```
[javatest.batch] 07-08-2019
10:14:43:
TRACE: [WIRE] - << "testDate: Mon, 07-08-19
14:14:43[\r][\n]"
[javatest.batch] 07-08-2019 10:14:43: TRACE: [WIRE] - <<
"Set-Cookie:
name1=value1; Expires=Mon, 08 Jul 2019 14:14:45 GMT[\r][\n]"
...
[javatest.batch] 07-08-2019 10:14:43: ERROR:
com.sun.ts.lib.harness.EETest$Fault:
Exception
occurred:org.apache.commons.httpclient.cookie.MalformedCookieException:
Invalid expires attribute: Unparseable date: "Mon, 08 Jul 2019
14:14:45
GMT"
[javatest.batch] at
com.sun.ts.tests.servlet.api.javax_servlet_http.cookie.URLClient.setMaxAgePositiveTest(URLClient.java:352)
```
Does this look to be a test issue?
Any
thoughts on the matter would be appreciated. Thanks!
Regards,
Hank Ibell_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or
unsubscribe
from this list, visit
https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev
_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev
_______________________________________________