[Git][ultreiaio/ird-observe][master-5.x] 14 commits: [jgitflow-maven-plugin]updating poms for 5.5-SNAPSHOT development
Tony CHEMIT pushed to branch master-5.x at ultreiaio / ird-observe Commits: 055d730b by Tony CHEMIT at 2017-06-13T19:49:38+02:00 [jgitflow-maven-plugin]updating poms for 5.5-SNAPSHOT development - - - - - ed4c99ab by Tony CHEMIT at 2017-06-13T20:26:28+02:00 [jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts - - - - - f06dc420 by Tony CHEMIT at 2017-06-13T20:26:29+02:00 [jgitflow-maven-plugin]merging 'master-5.x' into 'develop-5.x' - - - - - b92b1481 by Tony CHEMIT at 2017-06-13T20:26:30+02:00 [jgitflow-maven-plugin]Updating develop poms back to pre merge state - - - - - 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) - - - - - 0a49fab0 by Tony CHEMIT at 2017-06-13T22:07:12+02:00 improve builds - - - - - c6a793a8 by Tony CHEMIT at 2017-06-13T22:32:25+02:00 improve builds - - - - - db71e851 by Tony CHEMIT at 2017-06-13T22:39:54+02:00 [jgitflow-maven-plugin]updating poms for branch'release/5.4' with non-snapshot versions - - - - - 61b5b4a0 by Tony CHEMIT at 2017-06-13T23:26:58+02:00 fix test - - - - - 790cc1db by Tony CHEMIT at 2017-06-13T23:27:18+02:00 fix new h2 db file name - - - - - e3c73e79 by Tony CHEMIT at 2017-06-13T23:27:33+02:00 add missing license header - - - - - 54357830 by Tony CHEMIT at 2017-06-13T23:44:45+02:00 [jgitflow-maven-plugin]merging 'release/5.4' into 'master-5.x' - - - - - 7 changed files: - .gitlab-ci.yml - 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 - + entities/src/test/java/fr/ird/observe/H2TimeZoneTest.java - pom.xml - services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaH2.java - services-topia/src/test/java/fr/ird/observe/services/topia/service/MigrateTestsDatabases.java Changes: ===================================== .gitlab-ci.yml ===================================== --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -82,6 +82,7 @@ stage: <<: *test_manual <<: *before_script_clone script: + - git checkout develop-5.x - apt-get update -y && apt-get install libc6-i386 libx32stdc++6 -y - wget -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/close-milestone.sh | bash - wget -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/create-stage.sh | bash @@ -89,7 +90,7 @@ stage: - wget -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/create-milestone.sh | bash - wget -O - https://gitlab.com/ultreiaio/pom/raw/master/bin/close-stage.sh | sed 's/$1/frirdobserve/' | bash -deploy-snapshot: +latest-snapshot: <<: *env_staging <<: *test_manual script: ===================================== 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; ===================================== entities/src/test/java/fr/ird/observe/H2TimeZoneTest.java ===================================== --- /dev/null +++ b/entities/src/test/java/fr/ird/observe/H2TimeZoneTest.java @@ -0,0 +1,124 @@ +package fr.ird.observe; + +/*- + * #%L + * ObServe :: Entities + * %% + * 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 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(); + } + } +} ===================================== pom.xml ===================================== --- a/pom.xml +++ b/pom.xml @@ -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-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaH2.java ===================================== --- a/services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaH2.java +++ b/services-configuration-topia/src/main/java/fr/ird/observe/services/configuration/topia/ObserveDataSourceConfigurationTopiaH2.java @@ -58,7 +58,7 @@ public class ObserveDataSourceConfigurationTopiaH2 extends ObserveDataSourceConf } public File getDatabaseFile() { - return new File(directory, dbName + ".h2.db"); + return new File(directory, dbName + ".mv.db"); } public File getLockFile() { ===================================== services-topia/src/test/java/fr/ird/observe/services/topia/service/MigrateTestsDatabases.java ===================================== --- a/services-topia/src/test/java/fr/ird/observe/services/topia/service/MigrateTestsDatabases.java +++ b/services-topia/src/test/java/fr/ird/observe/services/topia/service/MigrateTestsDatabases.java @@ -117,7 +117,7 @@ public class MigrateTestsDatabases extends AbstractServiceTopiaTest { File databasesRootDirectory = topiaTestMethodResource.getDataSourceConfiguration().getDatabaseFile(); - while (!"observe".equals(databasesRootDirectory.getName())) { + while (!"ird-observe".equals(databasesRootDirectory.getName())) { databasesRootDirectory = databasesRootDirectory.getParentFile(); } View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/f1601873d8d40ac7ec90a332265... --- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/compare/f1601873d8d40ac7ec90a332265... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT