Tony CHEMIT pushed to branch develop-5.x at ultreiaio / ird-observe Commits: 1752e3b8 by Tony CHEMIT at 2017-06-13T21:58:35+02:00 Rollback release 5.4 - - - - - e07a9ea9 by Tony CHEMIT at 2017-06-13T21:59:07+02:00 add missing license header - - - - - 115b23c0 by Tony CHEMIT at 2017-06-13T22:05:24+02:00 Problème de restitution des dates sur une base locale lorsque la time zone change (See #783) - - - - - 28 changed files: - application-swing-configuration/pom.xml - application-swing-decoration/pom.xml - application-swing-validation/pom.xml - application-swing-validators/pom.xml - application-swing/pom.xml - application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveMultipleDataUIActionSupport.java - application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveSingleDataUIActionSupport.java - application-web-configuration/pom.xml - application-web/pom.xml - entities-migration/pom.xml - entities/pom.xml - + entities/src/test/java/fr/ird/observe/H2TimeZoneTest.java - observe/pom.xml - pom.xml - services-configuration-rest/pom.xml - services-configuration-topia/pom.xml - services-configuration/pom.xml - services-dto/pom.xml - services-rest/pom.xml - services-runner/pom.xml - services-topia-validation/pom.xml - services-topia-validators/pom.xml - services-topia/pom.xml - services/pom.xml - test/pom.xml - toolbox-maven-plugin/pom.xml - topia-extension/pom.xml - topia-templates-extension/pom.xml Changes: ===================================== application-swing-configuration/pom.xml ===================================== --- a/application-swing-configuration/pom.xml +++ b/application-swing-configuration/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-swing-configuration</artifactId> ===================================== application-swing-decoration/pom.xml ===================================== --- a/application-swing-decoration/pom.xml +++ b/application-swing-decoration/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-swing-decoration</artifactId> ===================================== application-swing-validation/pom.xml ===================================== --- a/application-swing-validation/pom.xml +++ b/application-swing-validation/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-swing-validation</artifactId> ===================================== application-swing-validators/pom.xml ===================================== --- a/application-swing-validators/pom.xml +++ b/application-swing-validators/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-swing-validators</artifactId> ===================================== application-swing/pom.xml ===================================== --- a/application-swing/pom.xml +++ b/application-swing/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-swing</artifactId> ===================================== application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveMultipleDataUIActionSupport.java ===================================== --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveMultipleDataUIActionSupport.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveMultipleDataUIActionSupport.java @@ -1,5 +1,27 @@ package fr.ird.observe.application.swing.ui.actions.shared; +/*- + * #%L + * ObServe :: Application Swing + * %% + * Copyright (C) 2008 - 2017 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import fr.ird.observe.application.swing.ObserveSwingApplicationContext; import fr.ird.observe.application.swing.ui.ObserveMainUI; import fr.ird.observe.application.swing.ui.content.ContentUI; ===================================== application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveSingleDataUIActionSupport.java ===================================== --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveSingleDataUIActionSupport.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/actions/shared/MoveSingleDataUIActionSupport.java @@ -1,5 +1,27 @@ package fr.ird.observe.application.swing.ui.actions.shared; +/*- + * #%L + * ObServe :: Application Swing + * %% + * Copyright (C) 2008 - 2017 IRD, Code Lutin, Ultreia.io + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + import fr.ird.observe.application.swing.ObserveOpenDataManager; import fr.ird.observe.application.swing.ObserveSwingApplicationContext; import fr.ird.observe.application.swing.ui.ObserveMainUI; ===================================== application-web-configuration/pom.xml ===================================== --- a/application-web-configuration/pom.xml +++ b/application-web-configuration/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-web-configuration</artifactId> ===================================== application-web/pom.xml ===================================== --- a/application-web/pom.xml +++ b/application-web/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>application-web</artifactId> ===================================== entities-migration/pom.xml ===================================== --- a/entities-migration/pom.xml +++ b/entities-migration/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>entities-migration</artifactId> ===================================== entities/pom.xml ===================================== --- a/entities/pom.xml +++ b/entities/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>entities</artifactId> ===================================== entities/src/test/java/fr/ird/observe/H2TimeZoneTest.java ===================================== --- /dev/null +++ b/entities/src/test/java/fr/ird/observe/H2TimeZoneTest.java @@ -0,0 +1,102 @@ +package fr.ird.observe; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.sql.Connection; +import java.sql.Date; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Calendar; +import java.util.TimeZone; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Created by tchemit on 13/06/17. + * + * @author Tony Chemit - dev@tchemit.fr + */ +public class H2TimeZoneTest { + + public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("Europe/Paris"); + static String JDBC_URL; + static Path path; + static java.util.Date expectedDate; + + @BeforeClass + public static void beforeClass() throws IOException, SQLException { + + Path dir = Paths.get(System.getProperty("java.io.tmpdir")); + Files.createDirectories(dir); + + path = dir.resolve("H2TimeZoneTest-" + System.nanoTime()); + Files.createDirectories(path); + JDBC_URL = String.format("jdbc:h2:file:%s/test", path.toFile().getAbsolutePath()); + + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.YEAR, 2016); + calendar.set(Calendar.MONTH, 1); + calendar.set(Calendar.DAY_OF_MONTH, 1); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + + expectedDate = calendar.getTime(); + + + try (Connection connection = DriverManager.getConnection(JDBC_URL)) { + try (PreparedStatement preparedStatement = connection.prepareStatement("CREATE TABLE test (simpleDate DATE)")) { + preparedStatement.execute(); + } + + try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO test VALUES( ? );")) { + + preparedStatement.setDate(1, new java.sql.Date(expectedDate.getTime())); + preparedStatement.execute(); + } + connection.commit(); + } + } + + @Test + public void testWithDefaultTimeZone() { + + TimeZone.setDefault(TIME_ZONE); + try (Connection connection = DriverManager.getConnection(JDBC_URL)) { + try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM test LIMIT 1;")) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + boolean next = resultSet.next(); + Date actualDate = resultSet.getDate(1); + Assert.assertEquals(expectedDate, actualDate); + } + } + connection.commit(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + @Test + public void testWithUtcTimeZone() { + + TimeZone.setDefault(TimeZone.getTimeZone("UTC")); + try (Connection connection = DriverManager.getConnection(JDBC_URL)) { + try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM test LIMIT 1;")) { + try (ResultSet resultSet = preparedStatement.executeQuery()) { + boolean next = resultSet.next(); + Date actualDate = resultSet.getDate(1); + Assert.assertEquals(expectedDate, actualDate); + } + } + connection.commit(); + } catch (SQLException e) { + e.printStackTrace(); + } + } +} ===================================== observe/pom.xml ===================================== --- a/observe/pom.xml +++ b/observe/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>observe</artifactId> ===================================== pom.xml ===================================== --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> <packaging>pom</packaging> <name>ObServe :: Pom</name> @@ -546,9 +546,7 @@ <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> - <!-- tc20150811 On ne pleut pas utiliser une version plus récente, le format n'est pas compatible --> - <!-- FIXME Hum je ne suis pas sur que la 176 soit ok. --> - <version>1.3.175</version> + <version>1.4.195</version> </dependency> <dependency> ===================================== services-configuration-rest/pom.xml ===================================== --- a/services-configuration-rest/pom.xml +++ b/services-configuration-rest/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-configuration-rest</artifactId> ===================================== services-configuration-topia/pom.xml ===================================== --- a/services-configuration-topia/pom.xml +++ b/services-configuration-topia/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-configuration-topia</artifactId> ===================================== services-configuration/pom.xml ===================================== --- a/services-configuration/pom.xml +++ b/services-configuration/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-configuration</artifactId> ===================================== services-dto/pom.xml ===================================== --- a/services-dto/pom.xml +++ b/services-dto/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-dto</artifactId> ===================================== services-rest/pom.xml ===================================== --- a/services-rest/pom.xml +++ b/services-rest/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-rest</artifactId> ===================================== services-runner/pom.xml ===================================== --- a/services-runner/pom.xml +++ b/services-runner/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-runner</artifactId> ===================================== services-topia-validation/pom.xml ===================================== --- a/services-topia-validation/pom.xml +++ b/services-topia-validation/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-topia-validation</artifactId> ===================================== services-topia-validators/pom.xml ===================================== --- a/services-topia-validators/pom.xml +++ b/services-topia-validators/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-topia-validators</artifactId> ===================================== services-topia/pom.xml ===================================== --- a/services-topia/pom.xml +++ b/services-topia/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services-topia</artifactId> ===================================== services/pom.xml ===================================== --- a/services/pom.xml +++ b/services/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>services</artifactId> ===================================== test/pom.xml ===================================== --- a/test/pom.xml +++ b/test/pom.xml @@ -26,7 +26,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>test</artifactId> ===================================== toolbox-maven-plugin/pom.xml ===================================== --- a/toolbox-maven-plugin/pom.xml +++ b/toolbox-maven-plugin/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>toolbox-maven-plugin</artifactId> ===================================== topia-extension/pom.xml ===================================== --- a/topia-extension/pom.xml +++ b/topia-extension/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>topia-extension</artifactId> ===================================== topia-templates-extension/pom.xml ===================================== --- a/topia-templates-extension/pom.xml +++ b/topia-templates-extension/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>fr.ird.observe</groupId> <artifactId>pom</artifactId> - <version>5.5-SNAPSHOT</version> + <version>5.4-SNAPSHOT</version> </parent> <artifactId>topia-templates-extension</artifactId> View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/b92b1481d7185a1e0171e914c12... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/b92b1481d7185a1e0171e914c12... You're receiving this email because of your account on gitlab.com.