Index: topia/src/test/org/codelutin/topia/persistence/AbstractPersistenceStorageTestCase.java diff -u topia/src/test/org/codelutin/topia/persistence/AbstractPersistenceStorageTestCase.java:1.8 topia/src/test/org/codelutin/topia/persistence/AbstractPersistenceStorageTestCase.java:1.9 --- topia/src/test/org/codelutin/topia/persistence/AbstractPersistenceStorageTestCase.java:1.8 Thu Aug 11 16:30:04 2005 +++ topia/src/test/org/codelutin/topia/persistence/AbstractPersistenceStorageTestCase.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 21 juillet 2005 19:57:28 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ * - * Last update: $Date: 2005/08/11 16:30:04 $ - * by : $Author: thimel $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -39,20 +39,20 @@ import junit.framework.TestCase; import org.codelutin.topia.TopiaConst; import org.codelutin.topia.TopiaId; -import org.codelutin.topia.TopiaUser; public abstract class AbstractPersistenceStorageTestCase extends TestCase { // TopiaPersistenceStorageTest /** to use log facility, just put in your code: log.info(\"...\"); */ static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.TopiaPersistenceStorageTest"); - PersistenceStorageJDBC storage = null; + PersistenceStorage storage = null; TopiaTestContext testContext = null; TopiaTransactionHelper tth = null; protected int MAX = 10; abstract public Properties getConfig() throws Exception ; + abstract public PersistenceStorage getPersistenceStorage(Properties config) throws Exception ; public void setUp() throws Exception { Properties config = getConfig(); @@ -60,7 +60,7 @@ //Pour éviter les warnings config.put("context.helper.security", "org.codelutin.topia.security.TopiaSecurityHelper"); testContext = TopiaTestContext.getContext(config); - storage = new PersistenceStorageJDBC(config); + storage = getPersistenceStorage(config); tth = new TopiaTransactionHelper(config); } @@ -68,12 +68,12 @@ TopiaTestContext child1 = testContext.createChild(); child1.setTransaction(tth.newTranstaction()); - String id = TopiaId.create(TopiaUser.class); + String id = TopiaId.create(ObjectTestEntity.class); - TopiaPersistenceObject o = new TopiaPersistenceObject(id); + TopiaPersistenceObject o = new TopiaPersistenceObject(id).initDefaultValue(); TopiaPersistenceObject o2 = new TopiaPersistenceObject(id); - o.getData().setField("name", "poussin"); + o.setField("name", "testCommit"); storage.beginTransaction(child1); storage.store(child1, o); @@ -87,21 +87,20 @@ assertTrue(storage.exists(child1, id)); assertTrue(storage.exists(child2, id)); - o2.getAskedFields().add("name"); + o2.getField("name"); storage.restore(child2, o2); - assertEquals(o.getData(), o2.getData()); - assertEquals("poussin", o.getData().getField("name")); - assertEquals("poussin", o2.getData().getField("name")); + assertEquals("testCommit", o.getData().getField("name")); + assertEquals("testCommit", o2.getData().getField("name")); } public void testRollback() throws Exception { TopiaTestContext child1 = testContext.createChild(); child1.setTransaction(tth.newTranstaction()); - String id = TopiaId.create(TopiaUser.class); - TopiaPersistenceObject o = new TopiaPersistenceObject(id); + String id = TopiaId.create(ObjectTestEntity.class); + TopiaPersistenceObject o = new TopiaPersistenceObject(id).initDefaultValue(); - o.getData().setField("name", "poussin"); + o.setField("name", "testRollback"); storage.beginTransaction(child1); storage.store(child1, o); @@ -118,12 +117,12 @@ TopiaTestContext child2 = testContext.createChild(); child2.setTransaction(tth.newTranstaction()); - String id = TopiaId.create(TopiaUser.class); + String id = TopiaId.create(ObjectTestEntity.class); - TopiaPersistenceObject o = new TopiaPersistenceObject(id); + TopiaPersistenceObject o = new TopiaPersistenceObject(id).initDefaultValue(); TopiaPersistenceObject o2 = new TopiaPersistenceObject(id); - o.getData().setField("name", "poussin"); + o.setField("name", "testIsolation"); storage.beginTransaction(child1); storage.store(child1, o); @@ -138,7 +137,7 @@ assertFalse(storage.exists(child2, id)); assertTrue(storage.exists(child3, id)); - o.getData().setField("name", "repoussin"); + o.setField("name", "testIsolationBis"); storage.store(child1, o); assertTrue(storage.exists(child1, id)); @@ -151,23 +150,23 @@ assertFalse(storage.exists(child2, id)); assertTrue(storage.exists(child3, id)); - o2.getAskedFields().add("name"); + o2.getField("name"); storage.restore(child3, o2); assertFalse(o.getData().equals(o2.getData())); - assertEquals("repoussin", o.getData().getField("name")); - assertEquals("poussin", o2.getData().getField("name")); + assertEquals("testIsolationBis", o.getData().getField("name")); + assertEquals("testIsolation", o2.getData().getField("name")); } public void testDelete() throws Exception { TopiaTestContext child1 = testContext.createChild(); child1.setTransaction(tth.newTranstaction()); - String id = TopiaId.create(TopiaUser.class); + String id = TopiaId.create(ObjectTestEntity.class); - TopiaPersistenceObject o = new TopiaPersistenceObject(id); + TopiaPersistenceObject o = new TopiaPersistenceObject(id).initDefaultValue(); - o.getData().setField("name", "poussin"); + o.setField("name", "testdelete"); storage.beginTransaction(child1); storage.store(child1, o); @@ -205,16 +204,20 @@ Collection ids = storage.getAllId(child1); log.info("ids.size: " + ids.size()); Collection os = new ArrayList(ids.size()); + System.out.println("suppression des id: " + ids); + + storage.beginTransaction(child1); for(String id: ids){ TopiaPersistenceObject o = new TopiaPersistenceObject(id); + storage.restore(child1, o); o.getManagement().setDeleted(true); os.add(o); } - storage.beginTransaction(child1); storage.store(child1, os); Collection idsvide = storage.getAllId(child1); + System.out.println("list d'id vide ? " + idsvide); assertEquals(0, idsvide.size()); TopiaTestContext child2 = testContext.createChild(); @@ -233,30 +236,33 @@ public void testDataType() throws Exception { TopiaTestContext child1 = testContext.createChild(); child1.setTransaction(tth.newTranstaction()); - String id = TopiaId.create(TopiaUser.class); - TopiaPersistenceObject o = new TopiaPersistenceObject(id); + String id = TopiaId.create(ObjectTestEntity.class); + TopiaPersistenceObject o = new TopiaPersistenceObject(id).initDefaultValue(); TopiaPersistenceObject o2 = new TopiaPersistenceObject(id); - o.getData().setField("string", "poussin"); - o2.getAskedFields().add("string"); + o.setField("name", "testDataType"); + o2.getField("name"); + + o.setField("string", "string"); + o2.getField("string"); - o.getData().setField("boolean", Boolean.TRUE); - o2.getAskedFields().add("boolean"); + o.setField("boolean", Boolean.TRUE); + o2.getField("boolean"); - o.getData().setField("byte", Byte.valueOf((byte)1)); - o2.getAskedFields().add("byte"); + o.setField("byte", Byte.valueOf((byte)1)); + o2.getField("byte"); - o.getData().setField("int", Integer.valueOf(2)); - o2.getAskedFields().add("int"); + o.setField("int", Integer.valueOf(2)); + o2.getField("int"); - o.getData().setField("double", Double.valueOf(3.3)); - o2.getAskedFields().add("double"); + o.setField("double", Double.valueOf(3.3)); + o2.getField("double"); - o.getData().setField("char", Character.valueOf('c')); - o2.getAskedFields().add("char"); + o.setField("char", Character.valueOf('c')); + o2.getField("char"); - o.getData().setField("object", new ArrayList()); - o2.getAskedFields().add("object"); + o.setField("object", new ArrayList()); + o2.getField("object"); storage.beginTransaction(child1); storage.store(child1, o); @@ -281,16 +287,16 @@ ArrayList list = new ArrayList(MAX); for(int i=0; i - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ * - * Last update: $Date: 2005/08/19 14:52:47 $ + * Last update: $Date: 2005/08/24 15:03:45 $ * by : $Author: bpoussin $ */ @@ -65,7 +65,8 @@ return config; } - public void testDummy() throws Exception { + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); } public void testPerf() throws Exception { Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCDerbyNetworkTest.java diff -u topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCDerbyNetworkTest.java:1.2 topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCDerbyNetworkTest.java:1.3 --- topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCDerbyNetworkTest.java:1.2 Tue Aug 9 13:36:53 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCDerbyNetworkTest.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 25 juillet 2005 15:39:58 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * Last update: $Date: 2005/08/09 13:36:53 $ - * by : $Author: dessard $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -37,41 +37,41 @@ import org.codelutin.topia.TopiaConst; /** - * + * * test Apache Derby (Cloudscape) avec un accès par le réseau (il faut avoir * démarré la base). Dans /framework/bin/startNetwork.ksh - * + * */ public class PersistenceStorageJDBCDerbyNetworkTest extends - AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCOracleTest + AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCOracleTest - /** to use log facility, just put in your code: log.info(\"...\"); */ - static private Logger log = Logger - .getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCDerbyTest"); - - public Properties getConfig() throws Exception { - System.out - .println("----------------- Apache Derby (Cloudscape) Network ----------------------"); - Properties config = new Properties(); - - config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, - "org.apache.derby.jdbc.ClientDriver"); - config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, - "jdbc:derby://localhost:1527/sample;create=true"); - - config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "APP"); - config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "APP"); - - return config; - } - - public void testDummy() throws Exception { - } - - public void testPerf() throws Exception { - int n = (MAX < 5000 ? MAX : 10); - super.testPerf(n); - } + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger + .getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCDerbyTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Apache Derby (Cloudscape) Network ----------------------"); + Properties config = new Properties(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, + "org.apache.derby.jdbc.ClientDriver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, + "jdbc:derby://localhost:1527/sample;create=true"); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "APP"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "APP"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000 ? MAX : 10); + super.testPerf(n); + } } // PersistenceStorageJDBCOracleTest Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiEmbededTest.java diff -u topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiEmbededTest.java:1.4 topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiEmbededTest.java:1.5 --- topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiEmbededTest.java:1.4 Tue Aug 9 13:37:30 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiEmbededTest.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 25 juillet 2005 15:40:54 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * - * Last update: $Date: 2005/08/09 13:37:30 $ - * by : $Author: dessard $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -69,6 +69,10 @@ config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); } public void testPerf() throws Exception { Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiInMemoryTest.java diff -u topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiInMemoryTest.java:1.2 topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiInMemoryTest.java:1.3 --- topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiInMemoryTest.java:1.2 Tue Aug 9 13:37:30 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMckoiInMemoryTest.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 28 juillet 2005 23:41:11 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * Last update: $Date: 2005/08/09 13:37:30 $ - * by : $Author: dessard $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -65,6 +65,10 @@ config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); } public void testPerf() throws Exception { Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMySQLTest.java diff -u topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMySQLTest.java:1.5 topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMySQLTest.java:1.6 --- topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMySQLTest.java:1.5 Tue Aug 9 12:19:57 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMySQLTest.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 25 juillet 2005 15:39:19 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Last update: $Date: 2005/08/09 12:19:57 $ - * by : $Author: dessard $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -52,6 +52,10 @@ config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, ""); return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); } public void testPerf() throws Exception { Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCOracleTest.java diff -u topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCOracleTest.java:1.5 topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCOracleTest.java:1.6 --- topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCOracleTest.java:1.5 Mon Aug 8 13:20:08 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCOracleTest.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 25 juillet 2005 15:39:58 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Last update: $Date: 2005/08/08 13:20:08 $ - * by : $Author: dessard $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -54,12 +54,13 @@ return config; } - public void testDummy() throws Exception { + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); } public void testPerf() throws Exception { int n = (MAX < 5000?MAX:10); - //int n = 5000; + //int n = 5000; super.testPerf(n); } Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCPostgresqlTest.java diff -u topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCPostgresqlTest.java:1.5 topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCPostgresqlTest.java:1.6 --- topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCPostgresqlTest.java:1.5 Tue Aug 9 12:20:19 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCPostgresqlTest.java Wed Aug 24 15:03:45 2005 @@ -23,10 +23,10 @@ * Created: 25 juillet 2005 15:37:06 CEST * * @author Benjamin POUSSIN - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Last update: $Date: 2005/08/09 12:20:19 $ - * by : $Author: dessard $ + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ */ package org.codelutin.topia.persistence; @@ -40,7 +40,7 @@ /** to use log facility, just put in your code: log.info(\"...\"); */ static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCPostgresqlTest"); - + public Properties getConfig() throws Exception { System.out.println("----------------- Postgresql ----------------------"); Properties config = new Properties(); @@ -52,6 +52,10 @@ config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBC(config); } public void testPerf() throws Exception { Index: topia/src/test/org/codelutin/topia/persistence/ObjectTestEntity.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/ObjectTestEntity.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/ObjectTestEntity.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,53 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * ObjectTestEntity.java + * + * Created: 24 août 2005 01:16:48 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.codelutin.topia.annotation.ClassInfo; +import org.codelutin.topia.annotation.ClassType; +import org.codelutin.topia.TopiaEntity; + +@ClassInfo( + type = ClassType.ENTITY, + isAssociationClass = false, + isGeneratedClass = false, + + schemaVersion = 6134251295L, + fields = {"name", "string", "boolean", "byte", "int", "double", "char", "object"}, + fieldTypes = {String.class, String.class, Boolean.class, Byte.class, Integer.class, Double.class, Character.class, Object.class} +) +public interface ObjectTestEntity extends TopiaEntity { // ObjectTestEntity + + +} // ObjectTestEntity + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableDerbyEmbeddedTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableDerbyEmbeddedTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableDerbyEmbeddedTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,78 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTableOracleTest.java + * + * Created: 25 juillet 2005 15:39:58 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.util.Properties; +import java.util.logging.Logger; + +import org.codelutin.topia.TopiaConst; + +/** + * + * test Apache Derby (Cloudscape) avec la base embarquée. + * + */ +public class PersistenceStorageJDBCMultiTableDerbyEmbeddedTest extends + AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTableOracleTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger + .getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTableDerbyTest"); + + public Properties getConfig() throws Exception { + System.out + .println("----------------- Apache Derby (Cloudscape) Embedded ----------------------"); + Properties config = new Properties(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, + "org.apache.derby.jdbc.EmbeddedDriver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, + "jdbc:derby:/tmp/topia-derby;create=true"); + + // config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "APP"); + // config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, + // "APP"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000 ? MAX : 10); + super.testPerf(n); + } + +} // PersistenceStorageJDBCMultiTableOracleTest + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableDerbyNetworkTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableDerbyNetworkTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableDerbyNetworkTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,77 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTableOracleTest.java + * + * Created: 25 juillet 2005 15:39:58 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.util.Properties; +import java.util.logging.Logger; + +import org.codelutin.topia.TopiaConst; + +/** + * + * test Apache Derby (Cloudscape) avec un accès par le réseau (il faut avoir + * démarré la base). Dans /framework/bin/startNetwork.ksh + * + */ +public class PersistenceStorageJDBCMultiTableDerbyNetworkTest extends + AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTableOracleTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger + .getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTableDerbyTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Apache Derby (Cloudscape) Network ----------------------"); + Properties config = new Properties(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, + "org.apache.derby.jdbc.ClientDriver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, + "jdbc:derby://localhost:1527/sample;create=true"); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "APP"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "APP"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000 ? MAX : 10); + super.testPerf(n); + } + +} // PersistenceStorageJDBCMultiTableOracleTest + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMckoiEmbededTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMckoiEmbededTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMckoiEmbededTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,84 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTableMckoiEmbededTest.java + * + * Created: 25 juillet 2005 15:40:54 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.io.File; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Properties; +import junit.framework.TestCase; +import org.codelutin.topia.TopiaConst; + +public class PersistenceStorageJDBCMultiTableMckoiEmbededTest extends AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTableMckoiEmbededTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTableMckoiEmbededTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Mckoi Embedded ----------------------"); + Properties config = new Properties(); + + File dir = new File("/tmp/topia-mckoi"); + dir.mkdirs(); + + File file = new File(dir, "db.conf"); + file.createNewFile(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, "com.mckoi.JDBCDriver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, + "jdbc:mckoi:local:///tmp/topia-mckoi/db.conf" + + "?create_or_boot=true" + + "&database_path=/tmp/topia-mckoi/data" + + "&log_path=/tmp/topia-mckoi" + + "&query_logging=enabled" + + "&use_nio_if_available=enabled" + + "&dont_synch_filesystem=enabled" + + "&io_safety_level=3" + // 0-10 + ""); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "dbuser"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000?MAX:10); + super.testPerf(n); + } + +} // PersistenceStorageJDBCMultiTableMckoiEmbededTest + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMckoiInMemoryTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMckoiInMemoryTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMckoiInMemoryTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,81 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTableMckoiInMemoryTest.java + * + * Created: 28 juillet 2005 23:41:11 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.io.File; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Properties; +import junit.framework.TestCase; +import org.codelutin.topia.TopiaConst; + +public class PersistenceStorageJDBCMultiTableMckoiInMemoryTest extends AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTableMckoiInMemoryTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTableMckoiInMemoryTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Mckoi in Memory ----------------------"); + Properties config = new Properties(); + + File dir = new File("/tmp/topia-mckoi-inmem"); + dir.mkdirs(); + + File file = new File(dir, "db.conf"); + file.createNewFile(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, "com.mckoi.JDBCDriver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, + "jdbc:mckoi:local:///tmp/topia-mckoi/db.conf" + + "?create_or_boot=true" + + "&storage_system=v1javaheap" + + "&use_nio_if_available=enabled" + + ""); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "dbuser"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000?MAX:MAX); + super.testPerf(n); + } + + +} // PersistenceStorageJDBCMultiTableMckoiInMemoryTest + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMySQLTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMySQLTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableMySQLTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,67 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTableMySQLTest.java + * + * Created: 25 juillet 2005 15:39:19 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.util.Properties; +import java.util.logging.Logger; + +import org.codelutin.topia.TopiaConst; + +public class PersistenceStorageJDBCMultiTableMySQLTest extends AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTableMySQLTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTableMySQLTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Mysql ----------------------"); + Properties config = new Properties(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, "com.mysql.jdbc.Driver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, "jdbc:mysql://localhost/test"); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "dbuser"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000?MAX:10); + super.testPerf(n); + } + +} // PersistenceStorageJDBCMultiTableMySQLTest + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableOracleTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableOracleTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTableOracleTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,71 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTableOracleTest.java + * + * Created: 25 juillet 2005 15:39:58 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.util.Properties; +import java.util.logging.Logger; + +import org.codelutin.topia.TopiaConst; + +public class PersistenceStorageJDBCMultiTableOracleTest extends AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTableOracleTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTableOracleTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Oracle ----------------------"); + Properties config = new Properties(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, "oracle.jdbc.driver.OracleDriver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, "jdbc:oracle:thin:@oracle.codelutin.home:1521:setib"); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "dbuser"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testDummy() throws Exception { + } + + public void testPerf() throws Exception { + int n = (MAX < 5000?MAX:10); + //int n = 5000; + super.testPerf(n); + } + +} // PersistenceStorageJDBCMultiTableOracleTest + Index: topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTablePostgresqlTest.java diff -u /dev/null topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTablePostgresqlTest.java:1.1 --- /dev/null Wed Aug 24 15:03:51 2005 +++ topia/src/test/org/codelutin/topia/persistence/PersistenceStorageJDBCMultiTablePostgresqlTest.java Wed Aug 24 15:03:45 2005 @@ -0,0 +1,67 @@ +/* *##% + * Copyright (C) 2005 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * PersistenceStorageJDBCMultiTablePostgresqlTest.java + * + * Created: 25 juillet 2005 15:37:06 CEST + * + * @author Benjamin POUSSIN + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2005/08/24 15:03:45 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.topia.persistence; + +import java.util.Properties; +import java.util.logging.Logger; + +import org.codelutin.topia.TopiaConst; + +public class PersistenceStorageJDBCMultiTablePostgresqlTest extends AbstractPersistenceStorageTestCase { // PersistenceStorageJDBCMultiTablePostgresqlTest + + /** to use log facility, just put in your code: log.info(\"...\"); */ + static private Logger log = Logger.getLogger("org.codelutin.topia.persistence.PersistenceStorageJDBCMultiTablePostgresqlTest"); + + public Properties getConfig() throws Exception { + System.out.println("----------------- Postgresql ----------------------"); + Properties config = new Properties(); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_DRIVER, "org.postgresql.Driver"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_URL, "jdbc:postgresql://localhost/test"); + + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_LOGIN, "dbuser"); + config.setProperty(TopiaConst.PERSISTENCE_STORAGE_JDBC_PASSWORD, "xxxxxxxx"); + + return config; + } + + public PersistenceStorage getPersistenceStorage(Properties config) throws Exception { + return new PersistenceStorageJDBCMultiTable(config); + } + + public void testPerf() throws Exception { + int n = (MAX < 5000?MAX:10); + super.testPerf(n); + } + +} // PersistenceStorageJDBCMultiTablePostgresqlTest +