Author: bleny Date: 2012-05-15 18:03:51 +0200 (Tue, 15 May 2012) New Revision: 3366 Url: http://chorem.org/repositories/revision/pollen/3366 Log: code review : misc minor fixes Added: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java Removed: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PolleIOUtil.java Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java trunk/pollen-persistence/src/test/java/org/chorem/pollen/business/persistence/AbstractDAOTest.java trunk/pollen-services/src/test/java/org/chorem/pollen/services/FakeServiceContext.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java Deleted: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PolleIOUtil.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PolleIOUtil.java 2012-05-03 14:40:57 UTC (rev 3365) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PolleIOUtil.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -1,66 +0,0 @@ -/* - * #%L - * Pollen :: Persistence - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2012 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero 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 Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package org.chorem.pollen; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.io.File; - -/** - * Some utils IO methods. - * - * @author tchemit <chemit@codelutin.com> - * @since 1.3 - */ -public class PolleIOUtil { - - /** Logger. */ - private static final Log log = LogFactory.getLog(PolleIOUtil.class); - - protected PolleIOUtil() { - } - - public static File getTestSpecificDirectory(Class<?> klass, String methodName, long timestamp) { - // Trying to look for the temporary folder to store data for the test - String tempDirPath = System.getProperty("java.io.tmpdir"); - if (tempDirPath == null) { - // can this really occur ? - tempDirPath = ""; - if (log.isWarnEnabled()) { - log.warn("'\"java.io.tmpdir\" not defined"); - } - } - File tempDirFile = new File(tempDirPath); - - // create the directory to store database data - String dataBasePath = klass.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; - } -} Copied: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java (from rev 3365, trunk/pollen-persistence/src/main/java/org/chorem/pollen/PolleIOUtil.java) =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java (rev 0) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -0,0 +1,66 @@ +/* + * #%L + * Pollen :: Persistence + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2012 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package org.chorem.pollen; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.io.File; + +/** + * Some utils IO methods. + * + * @author tchemit <chemit@codelutin.com> + * @since 1.3 + */ +public class PollenIOUtil { + + /** Logger. */ + private static final Log log = LogFactory.getLog(PollenIOUtil.class); + + protected PollenIOUtil() { + } + + public static File getTestSpecificDirectory(Class<?> klass, String methodName, long timestamp) { + // Trying to look for the temporary folder to store data for the test + String tempDirPath = System.getProperty("java.io.tmpdir"); + if (tempDirPath == null) { + // can this really occur ? + tempDirPath = ""; + if (log.isWarnEnabled()) { + log.warn("'\"java.io.tmpdir\" not defined"); + } + } + File tempDirFile = new File(tempDirPath); + + // create the directory to store database data + String dataBasePath = klass.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; + } +} Property changes on: trunk/pollen-persistence/src/main/java/org/chorem/pollen/PollenIOUtil.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java =================================================================== --- trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java 2012-05-03 14:40:57 UTC (rev 3365) +++ trunk/pollen-persistence/src/main/java/org/chorem/pollen/entities/migration/PollenMigrationCallbackV1_2.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -42,7 +42,7 @@ public class PollenMigrationCallbackV1_2 extends TopiaMigrationCallbackByClass.MigrationCallBackForVersion { public PollenMigrationCallbackV1_2(TopiaMigrationCallbackByClass callBack) { - super(PollenMigrationCallback.V_1_1, callBack); + super(PollenMigrationCallback.V_1_2, callBack); } @Override Modified: trunk/pollen-persistence/src/test/java/org/chorem/pollen/business/persistence/AbstractDAOTest.java =================================================================== --- trunk/pollen-persistence/src/test/java/org/chorem/pollen/business/persistence/AbstractDAOTest.java 2012-05-03 14:40:57 UTC (rev 3365) +++ trunk/pollen-persistence/src/test/java/org/chorem/pollen/business/persistence/AbstractDAOTest.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -25,7 +25,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.PolleIOUtil; +import org.chorem.pollen.PollenIOUtil; import org.chorem.pollen.PollenConfiguration; import org.chorem.pollen.PollenTopiaRootContextFactory; import org.junit.Rule; @@ -55,9 +55,9 @@ public static final long TIMESTAMP = System.nanoTime(); @Rule - public T3Database db = new T3Database(); + public PollenDatabase db = new PollenDatabase(); - public T3Database getDb() { + public PollenDatabase getDb() { return db; } @@ -73,9 +73,9 @@ * A new database created for each test. * * @author tchemit <chemit@codelutin.com> - * @since 1.0 + * @since 1.3 */ - public static class T3Database extends TestWatcher { + public static class PollenDatabase extends TestWatcher { private File testBasedir; @@ -90,7 +90,7 @@ @Override protected void starting(Description description) { - testBasedir = PolleIOUtil.getTestSpecificDirectory( + testBasedir = PollenIOUtil.getTestSpecificDirectory( description.getTestClass(), description.getMethodName(), TIMESTAMP); Modified: trunk/pollen-services/src/test/java/org/chorem/pollen/services/FakeServiceContext.java =================================================================== --- trunk/pollen-services/src/test/java/org/chorem/pollen/services/FakeServiceContext.java 2012-05-03 14:40:57 UTC (rev 3365) +++ trunk/pollen-services/src/test/java/org/chorem/pollen/services/FakeServiceContext.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -26,7 +26,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.PolleIOUtil; +import org.chorem.pollen.PollenIOUtil; import org.chorem.pollen.PollenConfiguration; import org.chorem.pollen.PollenTopiaRootContextFactory; import org.junit.rules.TestWatcher; @@ -77,7 +77,7 @@ super.starting(description); PollenTopiaRootContextFactory factory = new PollenTopiaRootContextFactory(); - testDir = PolleIOUtil.getTestSpecificDirectory( + testDir = PollenIOUtil.getTestSpecificDirectory( description.getTestClass(), description.getMethodName(), TIMESTAMP); Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java 2012-05-03 14:40:57 UTC (rev 3365) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenTopiaTransactionFilter.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -36,7 +36,7 @@ import javax.servlet.ServletRequest; /** - * EchoBase implementation of the {@link TopiaTransactionFilter}. + * Pollen implementation of the {@link TopiaTransactionFilter}. * * @author tchemit <chemit@codelutin.com> * @since 1.3 @@ -66,7 +66,7 @@ try { TopiaContext transaction = rootContext.beginTransaction(); if (log.isDebugEnabled()) { - log.debug("Starts a new echo transaction " + transaction); + log.debug("Starts a new transaction " + transaction); } return transaction; } catch (TopiaException eee) { Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java 2012-05-03 14:40:57 UTC (rev 3365) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/PollenUIUtils.java 2012-05-15 16:03:51 UTC (rev 3366) @@ -33,7 +33,7 @@ import java.net.URL; /** - * Usefull ui methods. + * Useful ui methods. * * @author tchemit <chemit@codelutin.com> * @since 1.3