Skip to content

Commit

Permalink
Choose month for tests not impacted by JDK 17/21 formatting change
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@omnifish.ee>
  • Loading branch information
arjantijms committed May 17, 2024
1 parent d70980b commit c971c20
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2024 Contributors to Eclipse Foundation.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -76,12 +77,12 @@ public void tearDown() {
*/
@Test
public void testLocalDateTime() throws Exception {
doTestJavaTimeTypes("Sep 30, 2015, 4:14:43 PM", "localDateTime", "2015-09-30T16:14:43");
doTestJavaTimeTypes("May 30, 2015, 4:14:43 PM", "localDateTime", "2015-05-30T16:14:43");
}

@Test
public void testLocalDate() throws Exception {
doTestJavaTimeTypes("Sep 30, 2015", "localDate", "2015-09-30");
doTestJavaTimeTypes("May 30, 2015", "localDate", "2015-05-30");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2024 Contributors to Eclipse Foundation.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -81,10 +82,10 @@ public void testJavaTimeTypes() throws Exception {
try {

HtmlTextInput input1 = (HtmlTextInput)page.getHtmlElementById("localDateTime1");
input1.setValueAttribute("30 sep 2015 16:14:43");
input1.setValueAttribute("30 mei 2015 16:14:43");

HtmlTextInput input2 = (HtmlTextInput)page.getHtmlElementById("localDateTime2");
input2.setValueAttribute("30 sep 2015 16:14:43");
input2.setValueAttribute("30 mei 2015 16:14:43");

HtmlTextInput input3 = (HtmlTextInput)page.getHtmlElementById("localTime1");
input3.setValueAttribute("16:14:43");
Expand All @@ -96,10 +97,10 @@ public void testJavaTimeTypes() throws Exception {
page1 = submit.click();

HtmlSpan time1Output = (HtmlSpan)page1.getHtmlElementById("localDateTimeValue1");
assertTrue(time1Output.getTextContent().contains("30 sep 2015 16:14"));
assertTrue(time1Output.getTextContent().contains("30 mei 2015 16:14"));

HtmlSpan time2Output = (HtmlSpan)page1.getHtmlElementById("localDateTimeValue2");
assertTrue(time2Output.getTextContent().contains("30 sep 2015 16:14"));
assertTrue(time2Output.getTextContent().contains("30 mei 2015 16:14"));

HtmlSpan time3Output = (HtmlSpan)page1.getHtmlElementById("localTimeValue1");
assertTrue(time3Output.getTextContent().contains("16:14:43"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2024 Contributors to Eclipse Foundation.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -76,7 +77,7 @@ public void tearDown() {
*/
@Test
public void testLocalDate() throws Exception {
doTestJavaTimeTypes("30 sep 2015", "localDate", "2015-09-30");
doTestJavaTimeTypes("30 mei 2015", "localDate", "2015-05-30");
}

@Test
Expand All @@ -86,7 +87,7 @@ public void testLocalTime() throws Exception {

@Test
public void testLocalDateTime() throws Exception {
doTestJavaTimeTypes("30 sep 2015 16:14:43", "localDateTime", "2015-09-30T16:14:43");
doTestJavaTimeTypes("30 mei 2015 16:14:43", "localDateTime", "2015-05-30T16:14:43");
}

private void doTestJavaTimeTypes(String value, String type, String expected) throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion tck/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020, 2024 Contributors to Eclipse Foundation. All rights reserved.
Copyright (c) 2020, 2024 Contributors to Eclipse Foundation.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down

0 comments on commit c971c20

Please sign in to comment.