Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in org.glassfish.tyrus.core.UtilsTest : "Cannot parse valid date" . #622

Closed
glassfishrobot opened this issue Nov 13, 2017 · 3 comments · Fixed by #679
Closed

Failure in org.glassfish.tyrus.core.UtilsTest : "Cannot parse valid date" . #622

glassfishrobot opened this issue Nov 13, 2017 · 3 comments · Fixed by #679

Comments

@glassfishrobot
Copy link

Dear Tyrus Team,

I have tried today 'Clean&Build' with Maven in NetBeans 8.1 on Java 8_151 and getting following issue.

Is there a wrong configuration on my side and

can you help me please thereby ?

Many thanks and
Best Regards,
Friedhold

@test
public void testParseHttpDateAnsiCAsc() {
try {
Date date = Utils.parseHttpDate("Sun Nov 6 08:49:37 1994");
assertNotNull("Date cannot be null", date);
} catch (ParseException e) {
fail("Cannot parse valid date");
}
}

Test set: org.glassfish.tyrus.core.UtilsTest

Tests run: 4, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec <<< FAILURE! - in org.glassfish.tyrus.core.UtilsTest
testParseHttpDateRfc1123(org.glassfish.tyrus.core.UtilsTest) Time elapsed: 0.013 sec <<< FAILURE!
java.lang.AssertionError: Cannot parse valid date
at org.junit.Assert.fail(Assert.java:93)
at org.glassfish.tyrus.core.UtilsTest.testParseHttpDateRfc1123(UtilsTest.java:63)

testParseHttpDateAnsiCAsc(org.glassfish.tyrus.core.UtilsTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError: Cannot parse valid date
at org.junit.Assert.fail(Assert.java:93)
at org.glassfish.tyrus.core.UtilsTest.testParseHttpDateAnsiCAsc(UtilsTest.java:83)

testParseHttpDateRfc1036(org.glassfish.tyrus.core.UtilsTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError: Cannot parse valid date
at org.junit.Assert.fail(Assert.java:93)
at org.glassfish.tyrus.core.UtilsTest.testParseHttpDateRfc1036(UtilsTest.java:73)

@glassfishrobot
Copy link
Author

@pavelbucek Commented
Can you please modify the test, do e.printStackTrace on caught ParseException and share it here?

also, by any chance - are you on a system with some non-standard locale?

@glassfishrobot
Copy link
Author

@nuessgens
Copy link
Contributor

nuessgens commented Jul 3, 2019

Just in case anyone is wondering: As I experienced it, without modification the build only succeeds on a unix system with EN locale

nuessgens added a commit to nuessgens/tyrus that referenced this issue Jul 10, 2019
E.g. https://tools.ietf.org/html/rfc822#section-5 defines the valid
tokens for such dates and those have to be in EN-locale

eclipse-ee4j#622

Signed-off-by: Christian Nüssgens <[email protected]>
nuessgens added a commit to nuessgens/tyrus that referenced this issue Jul 10, 2019
nuessgens added a commit to nuessgens/tyrus that referenced this issue Jul 10, 2019
E.g. https://tools.ietf.org/html/rfc822#section-5 defines the valid
tokens for such dates and those have to be in EN-locale

eclipse-ee4j#622

Signed-off-by: Christian Nüssgens <[email protected]>
jansupol pushed a commit that referenced this issue Dec 18, 2019
* parse HTTP date correctly on JVM with non-EN default locale

E.g. https://tools.ietf.org/html/rfc822#section-5 defines the valid
tokens for such dates and those have to be in EN-locale

#622

Signed-off-by: Christian Nüssgens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants