Skip to content

Commit

Permalink
goal of the issue 4070 test is if input value is at all conversible to a
Browse files Browse the repository at this point in the history
specific java.time type, not if the default format is conversible, so
improved the locale sensitive tests to use a fixed pattern instead
  • Loading branch information
BalusC committed Feb 18, 2024
1 parent 497234a commit 51c81a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tck/faces23/converter/src/main/webapp/Issue4070Using.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<h:outputText value="localDateLabel" />

<h:inputText id="localDate" value="#{backingBean.localDate}">
<f:convertDateTime type="localDate" />
<f:convertDateTime type="localDate" pattern="MMM d, yyyy" />
</h:inputText>

<h:outputText id="localDateValue" value="#{backingBean.localDate}" />
Expand All @@ -51,15 +51,15 @@
<h:outputText value="localDateTimeLabel" />

<h:inputText id="localDateTime" value="#{backingBean.localDateTime}">
<f:convertDateTime type="localDateTime" />
<f:convertDateTime type="localDateTime" pattern="MMM d, yyyy, h:mm:ss a" />
</h:inputText>

<h:outputText id="localDateTimeValue" value="#{backingBean.localDateTime}" />

<h:outputText value="localTimeLabel" />

<h:inputText id="localTime" value="#{backingBean.localTime}">
<f:convertDateTime type="localTime" />
<f:convertDateTime type="localTime" pattern="h:mm:ss a" />
</h:inputText>

<h:outputText id="localTimeValue" value="#{backingBean.localTime}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -75,7 +74,7 @@ public void tearDown() {
* @see Temporal
* @see https://github.com/eclipse-ee4j/mojarra/issues/4074
*/
@Test @Ignore // Fails in JDK21 DateTimeFormatter FormatStyle.MEDIUM because the whitespace between time and 'PM' must be a NNBSP (u202f) instead of plain space.
@Test
public void testLocalDateTime() throws Exception {
doTestJavaTimeTypes("Sep 30, 2015, 4:14:43 PM", "localDateTime", "2015-09-30T16:14:43");
}
Expand All @@ -85,7 +84,7 @@ public void testLocalDate() throws Exception {
doTestJavaTimeTypes("Sep 30, 2015", "localDate", "2015-09-30");
}

@Test @Ignore // Fails in JDK21 DateTimeFormatter FormatStyle.MEDIUM because the whitespace between time and 'PM' must be a NNBSP (u202f) instead of plain space.
@Test
public void testLocalTime() throws Exception {
doTestJavaTimeTypes("4:52:56 PM", "localTime", "16:52:56");
}
Expand Down

0 comments on commit 51c81a1

Please sign in to comment.