Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,28 @@
<artifactId>library-jmx-api</artifactId>
<version>1.0.0</version>
</dependency>

<!-- JAXB dependencies (required for Java 9+) -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>

<scm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ public void testGetLocalizedDate( )
Locale locale = Locale.FRENCH;
int nDateFormat = DateFormat.SHORT;

String expResult = "01/01/70";
String result = fr.paris.lutece.portal.service.i18n.I18nService.getLocalizedDate( date, locale, nDateFormat );
assertEquals( expResult, result );
String expResultJava8 = "01/01/70";
String expResultJava10 = "01/01/1970";
String result = fr.paris.lutece.portal.service.i18n.I18nService.getLocalizedDate( date, locale, nDateFormat );
assertTrue(expResultJava8.equals(result) || expResultJava10.equals(result));
}

/**
Expand All @@ -118,9 +119,10 @@ public void testGetLocalizedDateTime( )
int nDateFormat = DateFormat.SHORT;
int nTimeFormat = DateFormat.SHORT;

String expResult = "01/01/70 01:00";
String expResultJava8 = "01/01/70 01:00";
String expResultJava10 = "01/01/1970 01:00";
String result = fr.paris.lutece.portal.service.i18n.I18nService.getLocalizedDateTime( date, locale, nDateFormat, nTimeFormat );
assertEquals( expResult, result );
assertTrue(expResultJava8.equals(result) || expResultJava10.equals(result));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ public void testExec( )
model.put( "arg", new Date( 123456789 ) );
res = FreeMarkerTemplateService.getInstance( ).loadTemplate( template, Locale.FRANCE, model );
assertNotNull( res );
assertEquals( "test with quote and arg 02/01/70 11:17", res.getHtml( ) );
String expResultJava8 = "test with quote and arg 02/01/70 11:17";
String expResultJava10 = "test with quote and arg 02/01/1970 11:17";
assertTrue(expResultJava8.equals(res.getHtml()) || expResultJava10.equals(res.getHtml()));

model.put( "arg", new Date( 123456789 ) );
res = FreeMarkerTemplateService.getInstance( ).loadTemplate( template, Locale.US, model );
assertNotNull( res );
assertEquals( "test with quote and arg 1/2/70 11:17 AM", res.getHtml( ) );
expResultJava8 = "test with quote and arg 1/2/70 11:17 AM";
expResultJava10 = "test with quote and arg 1/2/70, 11:17 AM";
assertTrue(expResultJava8.equals(res.getHtml()) || expResultJava10.equals(res.getHtml()));
}

}