branch develop updated (8500e90 -> 67eac51)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git from 8500e90 Remove james.bond@mi6.org from placeholders new 8818e58 Quelques upgrade de libs new 67eac51 R7299 Liste fixe des départments, filtrés par le territoire de l'utilisateur, dans l'ajout de communes adhérentes à une collectivité The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 67eac51d2371f2f93022a99aa6b00269e5dd5a66 Merge: 8818e58 8500e90 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Dec 2 17:05:39 2015 +0100 R7299 Liste fixe des départments, filtrés par le territoire de l'utilisateur, dans l'ajout de communes adhérentes à une collectivité commit 8818e5839f2c65d9d775bc790bf55e5932c6e268 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Dec 2 16:59:53 2015 +0100 Quelques upgrade de libs Summary of changes: .../coselmar/persistence/FixedH2Dialect.java | 18 ++++++ .../fr/ifremer/FakeCoselmarApplicationContext.java | 64 ++++---------------- .../CoselmarServicesApplicationContext.java | 2 + .../services/FakeCoselmarApplicationContext.java | 69 ++++++++++++++++------ pom.xml | 46 ++++++++++----- 5 files changed, 112 insertions(+), 87 deletions(-) create mode 100644 coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/FixedH2Dialect.java -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 8818e5839f2c65d9d775bc790bf55e5932c6e268 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Dec 2 16:59:53 2015 +0100 Quelques upgrade de libs --- .../fr/ifremer/FakeCoselmarApplicationContext.java | 64 ++++---------------- .../CoselmarServicesApplicationContext.java | 2 + .../services/FakeCoselmarApplicationContext.java | 69 ++++++++++++++++------ pom.xml | 46 ++++++++++----- 4 files changed, 94 insertions(+), 87 deletions(-) diff --git a/coselmar-persistence/src/test/java/fr/ifremer/FakeCoselmarApplicationContext.java b/coselmar-persistence/src/test/java/fr/ifremer/FakeCoselmarApplicationContext.java index 3086fc0..b878d0c 100644 --- a/coselmar-persistence/src/test/java/fr/ifremer/FakeCoselmarApplicationContext.java +++ b/coselmar-persistence/src/test/java/fr/ifremer/FakeCoselmarApplicationContext.java @@ -24,20 +24,17 @@ package fr.ifremer; * #L% */ -import java.io.File; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - import fr.ifremer.coselmar.config.CoselmarServicesConfig; -import fr.ifremer.coselmar.config.CoselmarServicesConfigOption; import fr.ifremer.coselmar.persistence.CoselmarTopiaApplicationContext; import fr.ifremer.coselmar.persistence.CoselmarTopiaPersistenceContext; import org.apache.commons.logging.Log; import org.junit.rules.TestWatcher; import org.junit.runner.Description; -import org.nuiton.topia.junit.ConfigurationHelper; +import org.nuiton.topia.persistence.TopiaConfiguration; +import org.nuiton.topia.persistence.TopiaConfigurationBuilder; + +import java.util.LinkedList; +import java.util.List; import static org.apache.commons.logging.LogFactory.getLog; @@ -49,15 +46,11 @@ public class FakeCoselmarApplicationContext extends TestWatcher { private static Log log = getLog(FakeCoselmarApplicationContext.class); - protected File testBasedir; - protected List<CoselmarTopiaPersistenceContext> openedTransactions = new LinkedList<>(); protected CoselmarTopiaApplicationContext applicationContext; - protected CoselmarServicesConfig configuration; - - protected String methodName; + protected TopiaConfiguration topiaConfiguration; protected final String configurationPath; @@ -68,19 +61,10 @@ public class FakeCoselmarApplicationContext extends TestWatcher { @Override protected void starting(Description description) { + TopiaConfigurationBuilder topiaConfigurationBuilder = new TopiaConfigurationBuilder(); + topiaConfiguration = topiaConfigurationBuilder.forTestDatabase(description.getTestClass(), description.getMethodName()).onlyCreateSchemaIfDatabaseIsEmpty().doNotValidateSchemaOnStartup().build(); - methodName = description.getMethodName(); - - // get test directory - testBasedir = ConfigurationHelper.getTestSpecificDirectory( - description.getTestClass(), - description.getMethodName()); - - if (log.isDebugEnabled()) { - log.debug("testBasedir: " + testBasedir); - } - - init(); + applicationContext = new CoselmarTopiaApplicationContext(topiaConfiguration); } @@ -90,22 +74,6 @@ public class FakeCoselmarApplicationContext extends TestWatcher { close(); } - public void init() { - - // --- create configuration --- // - - Properties defaultvalues = new Properties(); - defaultvalues.put(CoselmarServicesConfigOption.DATA_DIRECTORY.getKey(), testBasedir.getAbsolutePath()); - - configuration = new CoselmarServicesConfig(configurationPath, defaultvalues); - - // --- create topia application context --- // - - Map<String, String> topiaProperties = configuration.getTopiaProperties(); - applicationContext = new CoselmarTopiaApplicationContext(topiaProperties); - - } - public void close() { if (applicationContext != null && !applicationContext.isClosed()) { @@ -136,11 +104,7 @@ public class FakeCoselmarApplicationContext extends TestWatcher { public CoselmarTopiaApplicationContext getTopiaApplicationContext() { return applicationContext; } -// -// public CoselmarServicesConfig getApplicationConfig() { -// return configuration; -// } -// + public CoselmarTopiaPersistenceContext newPersistenceContext() { CoselmarTopiaPersistenceContext persistenceContext; @@ -156,13 +120,5 @@ public class FakeCoselmarApplicationContext extends TestWatcher { return persistenceContext; } -// -// public File getTestBasedir() { -// return testBasedir; -// } -// -// public String getMethodName() { -// return methodName; -// } } diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/CoselmarServicesApplicationContext.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/CoselmarServicesApplicationContext.java index 5fba3db..1068556 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/CoselmarServicesApplicationContext.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/CoselmarServicesApplicationContext.java @@ -27,6 +27,7 @@ package fr.ifremer.coselmar.services; import java.io.File; import java.util.Locale; import java.util.Map; +import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; import javax.servlet.ServletContext; @@ -45,6 +46,7 @@ import org.apache.log4j.PropertyConfigurator; import org.nuiton.i18n.I18n; import org.nuiton.i18n.init.DefaultI18nInitializer; import org.nuiton.i18n.init.I18nInitializer; +import org.nuiton.topia.persistence.TopiaConfigurationBuilder; import static org.apache.commons.logging.LogFactory.getLog; diff --git a/coselmar-rest/src/test/java/fr/ifremer/coselmar/services/FakeCoselmarApplicationContext.java b/coselmar-rest/src/test/java/fr/ifremer/coselmar/services/FakeCoselmarApplicationContext.java index 672c87c..61124a4 100644 --- a/coselmar-rest/src/test/java/fr/ifremer/coselmar/services/FakeCoselmarApplicationContext.java +++ b/coselmar-rest/src/test/java/fr/ifremer/coselmar/services/FakeCoselmarApplicationContext.java @@ -24,29 +24,28 @@ package fr.ifremer.coselmar.services; * #L% */ -import java.io.File; -import java.io.IOException; -import java.net.ServerSocket; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.atomic.AtomicInteger; - +import fr.ifremer.coselmar.config.CoselmarServicesConfig; +import fr.ifremer.coselmar.config.CoselmarServicesConfigOption; import fr.ifremer.coselmar.persistence.CoselmarPersistenceContext; import fr.ifremer.coselmar.persistence.CoselmarTopiaApplicationContext; import fr.ifremer.coselmar.persistence.CoselmarTopiaPersistenceContext; -import fr.ifremer.coselmar.config.CoselmarServicesConfig; -import fr.ifremer.coselmar.config.CoselmarServicesConfigOption; import fr.ifremer.coselmar.services.indexation.LuceneUtils; import fr.ifremer.coselmar.services.v1.InitialisationService; import org.apache.commons.logging.Log; import org.junit.rules.TestWatcher; import org.junit.runner.Description; -import org.nuiton.topia.junit.ConfigurationHelper; +import org.nuiton.topia.persistence.TopiaConfigurationBuilder; import org.nuiton.util.DateUtil; +import java.io.File; +import java.io.IOException; +import java.net.ServerSocket; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Properties; +import java.util.concurrent.atomic.AtomicInteger; + import static org.apache.commons.logging.LogFactory.getLog; @@ -57,6 +56,8 @@ public class FakeCoselmarApplicationContext extends TestWatcher implements Cosel private static Log log = getLog(FakeCoselmarApplicationContext.class); + public static final String TIMESTAMP = String.valueOf(System.nanoTime()); + protected static AtomicInteger portNumberCounter = new AtomicInteger(9999); protected File testBasedir; @@ -71,6 +72,8 @@ public class FakeCoselmarApplicationContext extends TestWatcher implements Cosel protected String methodName; + private Class<?> testClass; + protected int currentPortNumber; protected final String configurationPath; @@ -89,9 +92,10 @@ public class FakeCoselmarApplicationContext extends TestWatcher implements Cosel } methodName = description.getMethodName(); + testClass = description.getTestClass(); // get test directory - testBasedir = ConfigurationHelper.getTestSpecificDirectory( + testBasedir = getTestSpecificDirectory( description.getTestClass(), description.getMethodName()); @@ -114,15 +118,15 @@ public class FakeCoselmarApplicationContext extends TestWatcher implements Cosel // --- create configuration --- // - Properties defaultvalues = new Properties(); + TopiaConfigurationBuilder topiaConfigurationBuilder = new TopiaConfigurationBuilder(); + Properties defaultvalues = topiaConfigurationBuilder.forTestDatabase(testClass, methodName).onlyCreateSchemaIfDatabaseIsEmpty().doNotValidateSchemaOnStartup().buildProperties(); defaultvalues.put(CoselmarServicesConfigOption.DATA_DIRECTORY.getKey(), testBasedir.getAbsolutePath()); configuration = new CoselmarServicesConfig(configurationPath, defaultvalues); // --- create topia application context --- // - Map<String, String> topiaProperties = configuration.getTopiaProperties(); - applicationContext = new CoselmarTopiaApplicationContext(topiaProperties); + applicationContext = new CoselmarTopiaApplicationContext(topiaConfigurationBuilder.readProperties(defaultvalues)); luceneUtils = new LuceneUtils(configuration); @@ -272,4 +276,35 @@ public class FakeCoselmarApplicationContext extends TestWatcher implements Cosel } + public static File getTestWorkdir() { + File result; + String base = System.getProperty("java.io.tmpdir"); + if (base == null || base.isEmpty()) { + base = new File("").getAbsolutePath(); + if (log.isWarnEnabled()) { + log.warn("'\"java.io.tmpdir\" not defined"); + } + } + result = new File(base); + if (log.isDebugEnabled()) { + log.debug("basedir for test " + result); + } + return result; + } + + public static File getTestSpecificDirectory(Class<?> testClassName, + String methodName) { + + File tempDirFile = getTestWorkdir(); + + // create the directory to store database data + String dataBasePath = testClassName.getName() + + File.separator // a directory with the test class name + + methodName// a sub-directory with the method name + + '_' + + TIMESTAMP; // and a timestamp + File databaseFile = new File(tempDirFile, dataBasePath); + return databaseFile; + } + } diff --git a/pom.xml b/pom.xml index 93ea329..7fde07a 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ <nuitonI18nVersion>3.3</nuitonI18nVersion> <nuitonValidatorVersion>3.0-rc-2</nuitonValidatorVersion> - <slf4jVersion>1.7.10</slf4jVersion> + <slf4jVersion>1.7.13</slf4jVersion> <xworkVersion>2.3.15.1</xworkVersion> @@ -124,7 +124,7 @@ <nuitonI18nVersion>3.3</nuitonI18nVersion> <eugenePluginVersion>2.13</eugenePluginVersion> - <topiaVersion>3.0-beta-15</topiaVersion> + <topiaVersion>3.0</topiaVersion> <nuitonWebVersion>1.17</nuitonWebVersion> <nuitonUtilsVersion>3.0-rc-8</nuitonUtilsVersion> @@ -136,7 +136,7 @@ <hibernateVersion>4.3.8.Final</hibernateVersion> <postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion> - <h2Version>1.4.185</h2Version> + <h2Version>1.4.190</h2Version> <luceneVersion>4.10.3</luceneVersion> @@ -152,6 +152,20 @@ <jqueryVersion>2.1.3</jqueryVersion> <fontAwesomeVersion>4.3.0-1</fontAwesomeVersion> + <java-jwt.version>2.1.0</java-jwt.version> + <gson.version>2.5</gson.version> + <guava.version>19.0-rc3</guava.version> + <junit.version>4.12</junit.version> + <jna.version>4.2.1</jna.version> + <commons-collections4.version>4.1</commons-collections4.version> + <commons-email.version>1.4</commons-email.version> + <commons-logging.version>1.2</commons-logging.version> + <commons-lang3.version>3.4</commons-lang3.version> + <commons-io.version>2.4</commons-io.version> + <commons-beanutils.version>1.9.2</commons-beanutils.version> + <!-- XXX ymartel 20151202 : cannot upgrade httpcomponents deps for the moment, still needed for webmotion test --> + <fluent-hc.version>4.2.3</fluent-hc.version> + <httpcore.version>4.2.3</httpcore.version> </properties> <repositories> @@ -291,47 +305,47 @@ <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> - <version>4.0</version> + <version>${commons-collections4.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.3.2</version> + <version>${commons-lang3.version}</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.4</version> + <version>${commons-io.version}</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> - <version>1.9.2</version> + <version>${commons-beanutils.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-email</artifactId> - <version>1.3.3</version> + <version>${commons-email.version}</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <version>1.2</version> + <version>${commons-logging.version}</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> - <version>18.0</version> + <version>${guava.version}</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> - <version>2.3.1</version> + <version>${gson.version}</version> </dependency> <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>4.1.0</version> + <version>${jna.version}</version> </dependency> <!-- web exposition --> @@ -356,7 +370,7 @@ <dependency> <groupId>com.auth0</groupId> <artifactId>java-jwt</artifactId> - <version>2.0.1</version> + <version>${java-jwt.version}</version> </dependency> <!-- Logging --> @@ -467,7 +481,7 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.11</version> + <version>${junit.version}</version> <scope>test</scope> </dependency> <dependency> @@ -515,12 +529,12 @@ <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> - <version>4.2.3</version> + <version>${httpcore.version}</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>fluent-hc</artifactId> - <version>4.2.3</version> + <version>${fluent-hc.version}</version> </dependency> </dependencies> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 67eac51d2371f2f93022a99aa6b00269e5dd5a66 Merge: 8818e58 8500e90 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Dec 2 17:05:39 2015 +0100 R7299 Liste fixe des départments, filtrés par le territoire de l'utilisateur, dans l'ajout de communes adhérentes à une collectivité .../ifremer/coselmar/persistence/FixedH2Dialect.java | 18 ++++++++++++++++++ .../src/main/webapp/views/users/newPassword.html | 2 +- .../src/main/webapp/views/users/searchPart.html | 6 +++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --cc coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/FixedH2Dialect.java index 0000000,0000000..4c7645b new file mode 100644 --- /dev/null +++ b/coselmar-persistence/src/main/java/fr/ifremer/coselmar/persistence/FixedH2Dialect.java @@@ -1,0 -1,0 +1,18 @@@ ++package fr.ifremer.coselmar.persistence; ++ ++import java.sql.Types; ++ ++/** ++ * Override the H2Dialect to fix detected wrong value ++ * ++ * @author Arnaud Thimel (Code Lutin) ++ */ ++public class FixedH2Dialect extends org.hibernate.dialect.H2Dialect { ++ ++ public FixedH2Dialect() { ++ super(); ++ ++ registerColumnType( Types.LONGVARCHAR, String.format("varchar(%d)", Integer.MAX_VALUE) ); ++ } ++ ++} -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm