r2523 - in trunk/topia-service-replication: . src/test/java/org/nuiton/topia/replication src/test/resources
Author: tchemit Date: 2012-05-23 20:34:02 +0200 (Wed, 23 May 2012) New Revision: 2523 Url: http://nuiton.org/repositories/revision/topia/2523 Log: service replication build and tests are ok for it :) Added: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/ModelFixture.java trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaDatabaseLegacy.java trunk/topia-service-replication/src/test/resources/TopiaContext-legacy.properties Modified: trunk/topia-service-replication/pom.xml trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationOperationTest.java trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java Modified: trunk/topia-service-replication/pom.xml =================================================================== --- trunk/topia-service-replication/pom.xml 2012-05-23 18:32:37 UTC (rev 2522) +++ trunk/topia-service-replication/pom.xml 2012-05-23 18:34:02 UTC (rev 2523) @@ -59,6 +59,19 @@ </dependency> <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>topia-persistence-tck</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>topia-persistence-hibernate</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + + <dependency> <groupId>org.nuiton.i18n</groupId> <artifactId>nuiton-i18n</artifactId> </dependency> Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java =================================================================== --- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java 2012-05-23 18:32:37 UTC (rev 2522) +++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/AbstractTopiaReplicationServiceTest.java 2012-05-23 18:34:02 UTC (rev 2523) @@ -27,6 +27,8 @@ import org.apache.commons.logging.Log; import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Rule; import org.nuiton.i18n.I18n; import org.nuiton.topia.TopiaContext; import org.nuiton.topia.TopiaException; @@ -42,11 +44,9 @@ import org.nuiton.topia.replication.model.ReplicationNode; import org.nuiton.topia.replication.model.ReplicationOperationDef; -import java.io.File; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -64,9 +64,9 @@ */ public abstract class AbstractTopiaReplicationServiceTest extends Assert { - static protected TopiaContext context; + protected TopiaContext context; - static protected TopiaContext ctxt; + protected TopiaContext ctxt; protected TopiaContextImplementor dstCtxt; @@ -74,64 +74,61 @@ protected ReplicationModel model; - static protected boolean init; +// static protected boolean init; - static private Long testsTimeStamp; +// static private Long testsTimeStamp; - static private File testsBasedir; +// static private File testsBasedir; - static private final String TEST_BASEDIR = "target%1$ssurefire-tests%1$s%2$td_%2$tm_%2$tY%1$s%2$tH_%2$tM_%2$tS"; +// static private final String TEST_BASEDIR = "target%1$ssurefire-tests%1$s%2$td_%2$tm_%2$tY%1$s%2$tH_%2$tM_%2$tS"; - public static void after() throws Exception { - if (context != null && !context.isClosed()) { - try { - context.closeContext(); - } catch (TopiaException e) { - // cela peut arriver si on demande la fermeture dans un thread - // ailleurs... - } - } - init = false; + @Rule + public final TopiaDatabaseLegacy db = new TopiaDatabaseLegacy("-source"); + + protected TopiaDatabaseLegacy db2; + + @BeforeClass + public static void before() { + I18n.setDefaultLocale(Locale.FRANCE); } public void setUp() throws Exception { - if (!init) { + context = db.getRootCtxt(); - I18n.setDefaultLocale(Locale.FRANCE); + db.createDb(); - try { - context = createDb("source"); - } catch (Exception e) { - getLog().error("could not create db source.", e); - throw e; - } - init = true; - } + ctxt = db.beginTransaction(); - ctxt = context.beginTransaction(); - - service = context.getService(TopiaReplicationService.class); + service = db.getReplicationService(); } public void tearDown() throws Exception { - if (ctxt != null) { - ctxt.rollbackTransaction(); - ctxt.closeContext(); - ctxt = null; - } service = null; + context = null; + ctxt = null; + dstCtxt = null; + model = null; + if (db2 != null) { + db2.finished(db2.getDescription()); + } + } - protected TopiaReplicationModelBuilder getModelBuilder() { return service.getModelBuilder(); } - protected abstract TopiaContext createDb2(String name) throws Exception; + protected TopiaContext createDb2(String name) throws Exception { - protected abstract TopiaContext createDb(String name) throws Exception; + db2 = new TopiaDatabaseLegacy(name + "-target"); + // creates new db + db2.starting(db.getDescription()); + + return db2.getRootCtxt(); + } + protected TopiaContext createReplicateDb(Object contract) throws Exception { TopiaContext rootCtxt = createDb2(contract.toString() + dbCounter++); return rootCtxt; @@ -141,10 +138,6 @@ protected abstract Log getLog(); - protected <E extends TopiaEntity> E update(E e) throws TopiaException { - return (E) ctxt.findByTopiaId(e.getTopiaId()); - } - /** * Test of detectTypes method, of class ReplicationServiceImplementor. * @@ -291,8 +284,7 @@ "expected shell : " + Arrays.toString(expected) + ", but was " + shell, expected.length, shell.size()); - for (int i = 0, j = expected.length; i < j; i++) { - TopiaEntityEnum type = expected[i]; + for (TopiaEntityEnum type : expected) { ReplicationNode node = model.getNode(type); assertTrue(shell.contains(node)); assertEquals(type, node.getContract()); @@ -596,9 +588,9 @@ } protected void createSupportedBeforeOperation(TopiaEntityEnum contract, - TopiaEntity entity, - Class<? extends TopiaReplicationOperation> operationClass, - Object... parameters) throws Exception { + TopiaEntity entity, + Class<? extends TopiaReplicationOperation> operationClass, + Object... parameters) throws Exception { getLog().info("entity " + entity.getTopiaId()); prepareModel(entity.getTopiaId()); @@ -623,26 +615,26 @@ Assert.assertTrue(true); } - protected Long getTestsTimeStamp() { - if (testsTimeStamp == null) { - testsTimeStamp = System.currentTimeMillis(); - getLog().info("tests timestamp : " + testsTimeStamp); - } - return testsTimeStamp; - } +// protected Long getTestsTimeStamp() { +// if (testsTimeStamp == null) { +// testsTimeStamp = System.currentTimeMillis(); +// getLog().info("tests timestamp : " + testsTimeStamp); +// } +// return testsTimeStamp; +// } - protected File getTestDir(Class<?> testClass) { - if (testsBasedir == null) { - String tmp = System.getProperty("basedir"); - if (tmp == null) { - tmp = new File("").getAbsolutePath(); - } - String name = String.format(TEST_BASEDIR, File.separator, new Date(getTestsTimeStamp())); - testsBasedir = new File(new File(tmp), name); - getLog().info("tests basedir : " + testsBasedir); - } - return new File(testsBasedir, testClass.getSimpleName()); - } +// protected File getTestDir(Class<?> testClass) { +// if (testsBasedir == null) { +// String tmp = System.getProperty("basedir"); +// if (tmp == null) { +// tmp = new File("").getAbsolutePath(); +// } +// String name = String.format(TEST_BASEDIR, File.separator, new Date(getTestsTimeStamp())); +// testsBasedir = new File(new File(tmp), name); +// getLog().info("tests basedir : " + testsBasedir); +// } +// return new File(testsBasedir, testClass.getSimpleName()); +// } protected void createModel(TopiaEntity entity) throws TopiaException { model = getModelBuilder().createModel(context, Added: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/ModelFixture.java =================================================================== --- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/ModelFixture.java (rev 0) +++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/ModelFixture.java 2012-05-23 18:34:02 UTC (rev 2523) @@ -0,0 +1,113 @@ +package org.nuiton.topia.replication; + +import org.nuiton.topia.TopiaContext; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.framework.TopiaContextImplementor; +import org.nuiton.topia.tck.legacy.TopiaTckLegacyDAOHelper; +import org.nuiton.topia.tck.legacy.entities.Person; +import org.nuiton.topia.tck.legacy.entities.PersonDAO; +import org.nuiton.topia.tck.legacy.entities.Pet; +import org.nuiton.topia.tck.legacy.entities.PetDAO; +import org.nuiton.topia.tck.legacy.entities.Race; +import org.nuiton.topia.tck.legacy.entities.RaceDAO; + +/** + * Fixtures to test replication serivce. + * + * @author tchemit <chemit@codelutin.com> + * @since 3.0 + */ +public class ModelFixture { + + public static final String PERSON_NAME = "pudding master"; + + public static final String PERSON2_NAME = "pudding II master"; + + public static final String RACE_NAME = "race I"; + + public static final String RACE2_NAME = "race II"; + + public static final String PET_NAME = "pudding"; + + public static final String PET2_NAME = "pudding II"; + + public static final String RACE3_NAME = "race III"; + + public static final String PET3_NAME = "pudding III"; + + public void createDb(TopiaContext context) throws TopiaException { + + TopiaContextImplementor tx = + (TopiaContextImplementor) context.beginTransaction(); + + try { + PersonDAO personDAO = TopiaTckLegacyDAOHelper.getPersonDAO(tx); + RaceDAO raceDAO = TopiaTckLegacyDAOHelper.getRaceDAO(tx); + PetDAO petDAO = TopiaTckLegacyDAOHelper.getPetDAO(tx); + + Person person = personDAO.create(Person.PROPERTY_NAME, PERSON_NAME); + Race race = raceDAO.create(Race.PROPERTY_NAME, RACE_NAME); + petDAO.create(Pet.PROPERTY_NAME, PET_NAME, Pet.PROPERTY_PERSON, person, Pet.PROPERTY_RACE, race); + + personDAO.create(Person.PROPERTY_NAME, PERSON2_NAME); + petDAO.create(Pet.PROPERTY_NAME, PET2_NAME); + raceDAO.create(Race.PROPERTY_NAME, RACE2_NAME); + + Race race3 = raceDAO.create(Race.PROPERTY_NAME, RACE3_NAME); + petDAO.create(Pet.PROPERTY_NAME, PET3_NAME, Pet.PROPERTY_RACE, race3); + + tx.commitTransaction(); + } finally { + tx.closeContext(); + } + } + + public Person getPerson(TopiaContext tx) throws TopiaException { + PersonDAO personDAO = TopiaTckLegacyDAOHelper.getPersonDAO(tx); + Person result = personDAO.findByName(PERSON_NAME); + return result; + } + + public Person getPerson2(TopiaContext tx) throws TopiaException { + PersonDAO personDAO = TopiaTckLegacyDAOHelper.getPersonDAO(tx); + Person result = personDAO.findByName(PERSON2_NAME); + return result; + } + + public Race getRace(TopiaContext tx) throws TopiaException { + RaceDAO raceDAO = TopiaTckLegacyDAOHelper.getRaceDAO(tx); + Race race = raceDAO.findByName(RACE_NAME); + return race; + } + + public Race getRace2(TopiaContext tx) throws TopiaException { + RaceDAO raceDAO = TopiaTckLegacyDAOHelper.getRaceDAO(tx); + Race race = raceDAO.findByName(RACE2_NAME); + return race; + } + + public Race getRace3(TopiaContext tx) throws TopiaException { + RaceDAO raceDAO = TopiaTckLegacyDAOHelper.getRaceDAO(tx); + Race race = raceDAO.findByName(RACE3_NAME); + return race; + } + + public Pet getPet(TopiaContext tx) throws TopiaException { + PetDAO petDAO = TopiaTckLegacyDAOHelper.getPetDAO(tx); + Pet pet = petDAO.findByName(PET_NAME); + return pet; + } + + public Pet getPet2(TopiaContext tx) throws TopiaException { + PetDAO petDAO = TopiaTckLegacyDAOHelper.getPetDAO(tx); + Pet pet = petDAO.findByName(PET2_NAME); + return pet; + } + + public Pet getPet3(TopiaContext tx) throws TopiaException { + PetDAO petDAO = TopiaTckLegacyDAOHelper.getPetDAO(tx); + Pet pet = petDAO.findByName(PET3_NAME); + return pet; + } + +} Copied: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaDatabaseLegacy.java (from rev 2518, trunk/topia-persistence-tck/src/test/java/org/nuiton/topia/tck/legacy/TopiaDatabaseLegacy.java) =================================================================== --- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaDatabaseLegacy.java (rev 0) +++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaDatabaseLegacy.java 2012-05-23 18:34:02 UTC (rev 2523) @@ -0,0 +1,60 @@ +package org.nuiton.topia.replication; + +import org.junit.runner.Description; +import org.nuiton.topia.TopiaException; +import org.nuiton.topia.persistence.TopiaEntity; +import org.nuiton.topia.tck.TopiaDatabase; +import org.nuiton.topia.tck.legacy.TopiaTckLegacyDAOHelper; + +/** + * Concrete topia database for {@code it} model. + * + * @author tchemit <chemit@codelutin.com> + * @since 3.0 + */ +public class TopiaDatabaseLegacy extends TopiaDatabase { + + private ModelFixture fixtures; + + private TopiaReplicationService replicationService; + + public TopiaDatabaseLegacy(String classifier) { + super("/TopiaContext-legacy.properties", classifier); + } + + @Override + protected Class<? extends TopiaEntity>[] getImplementationClasses() { + return TopiaTckLegacyDAOHelper.getImplementationClasses(); + } + + public ModelFixture getFixtures() { + if (fixtures == null) { + fixtures = new ModelFixture(); + } + return fixtures; + } + + public TopiaReplicationService getReplicationService() throws TopiaException { + if (replicationService == null) { + replicationService = + getRootCtxt().getService(TopiaReplicationService.class); + } + return replicationService; + } + + public void createDb() throws TopiaException { + + getFixtures().createDb(getRootCtxt()); + + } + + @Override + public void starting(Description description) { + super.starting(description); + } + + @Override + public void finished(Description description) { + super.finished(description); + } +} Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationOperationTest.java =================================================================== --- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationOperationTest.java 2012-05-23 18:32:37 UTC (rev 2522) +++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationOperationTest.java 2012-05-23 18:34:02 UTC (rev 2523) @@ -27,16 +27,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.After; -import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import org.nuiton.topia.TestHelper; import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaContextFactory; -import org.nuiton.topia.TopiaTestDAOHelper.TopiaTckItEntityEnum; -import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.persistence.TopiaEntityEnum; import org.nuiton.topia.replication.model.ReplicationOperationPhase; import org.nuiton.topia.replication.operation.DettachAssociation; @@ -44,17 +37,14 @@ import org.nuiton.topia.replication.operation.FakeOperation; import org.nuiton.topia.replication.operation.UncreatableOperation; import org.nuiton.topia.replication.operation.UnregistredOperation; -import org.nuiton.topia.test.entities.Person; -import org.nuiton.topia.test.entities.PersonImpl; -import org.nuiton.topia.test.entities.Pet; -import org.nuiton.topia.test.entities.PetImpl; -import org.nuiton.topia.test.entities.Race; -import org.nuiton.topia.test.entities.RaceImpl; +import org.nuiton.topia.tck.legacy.entities.Person; +import org.nuiton.topia.tck.legacy.entities.Pet; +import org.nuiton.topia.tck.legacy.entities.Race; import java.io.File; -import java.io.IOException; -import java.util.Properties; +import static org.nuiton.topia.tck.legacy.TopiaTckLegacyDAOHelper.TopiaTckLegacyEntityEnum; + /** * TopiaReplicationServiceImplTest on model TopiaTest * <p/> @@ -70,15 +60,15 @@ LogFactory.getLog(TopiaReplicationOperationTest.class); protected static final TopiaEntityEnum[] contracts = { - TopiaTckItEntityEnum.Person, - TopiaTckItEntityEnum.Pet, - TopiaTckItEntityEnum.Race + TopiaTckLegacyEntityEnum.Person, + TopiaTckLegacyEntityEnum.Pet, + TopiaTckLegacyEntityEnum.Race }; - protected static final String entitiesList = - PersonImpl.class.getName() + "," + - PetImpl.class.getName() + "," + - RaceImpl.class.getName(); +// protected static final String entitiesList = +// PersonImpl.class.getName() + "," + +// PetImpl.class.getName() + "," + +// RaceImpl.class.getName(); static protected Person person, person2; @@ -88,38 +78,21 @@ protected static File tesDir; - @BeforeClass - public static void beforeClass() throws IOException { - tesDir = TestHelper.getTestBasedir(TopiaReplicationOperationTest.class); - - } - - @AfterClass - public static void after() throws Exception { - AbstractTopiaReplicationServiceTest.after(); - } - @Before @Override public void setUp() throws Exception { super.setUp(); - person = update(person); - person2 = update(person2); - pet = update(pet); - pet2 = update(pet2); - race = update(race); - race2 = update(race2); - } + ModelFixture fixtures = db.getFixtures(); - @After - @Override - public void tearDown() throws Exception { - super.tearDown(); - if (dstCtxt != null && !dstCtxt.isClosed()) { - dstCtxt.closeContext(); - } + person = fixtures.getPerson(ctxt); + person2 = fixtures.getPerson2(ctxt); + pet = fixtures.getPet(ctxt); + pet2 = fixtures.getPet2(ctxt); + race = fixtures.getRace(ctxt); + race2 = fixtures.getRace2(ctxt); + } @Test(expected = NullPointerException.class) @@ -158,14 +131,14 @@ public void testCreateOperation_nullPhase() throws Exception { model = getModelBuilder().createModel(context, contracts, true); - getModelBuilder().createOperation(model, TopiaTckItEntityEnum.Pet, null, null); + getModelBuilder().createOperation(model, TopiaTckLegacyEntityEnum.Pet, null, null); } @Test(expected = NullPointerException.class) public void testCreateOperation_nullOperationClass() throws Exception { model = getModelBuilder().createModel(context, contracts, true); - getModelBuilder().createOperation(model, TopiaTckItEntityEnum.Pet, ReplicationOperationPhase.before, null); + getModelBuilder().createOperation(model, TopiaTckLegacyEntityEnum.Pet, ReplicationOperationPhase.before, null); } @Test(expected = IllegalArgumentException.class) @@ -173,7 +146,7 @@ model = getModelBuilder().createModel(context, contracts, true); // le noeud Pet n'existe pas - getModelBuilder().addAfterOperation(model, TopiaTckItEntityEnum.Pet, Duplicate.class); + getModelBuilder().addAfterOperation(model, TopiaTckLegacyEntityEnum.Pet, Duplicate.class); } @Test(expected = IllegalArgumentException.class) @@ -181,13 +154,13 @@ model = getModelBuilder().createModel(context, contracts, true); // le noeud Pet n'existe pas - getModelBuilder().addAfterOperation(model, TopiaTckItEntityEnum.Pet, UnregistredOperation.class); + getModelBuilder().addAfterOperation(model, TopiaTckLegacyEntityEnum.Pet, UnregistredOperation.class); } @Test // @Test(expected = UnsupportedOperationException.class) public void testCreateSupportedBeforeOperation_Duplicate() throws Exception { - createSupportedBeforeOperation(TopiaTckItEntityEnum.Person, person, Duplicate.class); + createSupportedBeforeOperation(TopiaTckLegacyEntityEnum.Person, person, Duplicate.class); } // @Test(expected = UnsupportedOperationException.class) @@ -198,13 +171,13 @@ @Test // @Test(expected = UnsupportedOperationException.class) public void testCreateSupportedBeforeOperation_DetachAssociation() throws Exception { - createSupportedBeforeOperation(TopiaTckItEntityEnum.Person, person, DettachAssociation.class); + createSupportedBeforeOperation(TopiaTckLegacyEntityEnum.Person, person, DettachAssociation.class); } @Test // @Test(expected = UnsupportedOperationException.class) public void testCreateSupportedAfterOperation_Duplicate() throws Exception { - createSupportedAfterOperation(TopiaTckItEntityEnum.Person, person, Duplicate.class); + createSupportedAfterOperation(TopiaTckLegacyEntityEnum.Person, person, Duplicate.class); } // @Test(expected = UnsupportedOperationException.class) @@ -215,7 +188,7 @@ @Test // @Test(expected = UnsupportedOperationException.class) public void testCreateSupportedAfterOperation_DetachAssociation() throws Exception { - createSupportedAfterOperation(TopiaTckItEntityEnum.Person, person, DettachAssociation.class); + createSupportedAfterOperation(TopiaTckLegacyEntityEnum.Person, person, DettachAssociation.class); } // @Test(expected = UnsupportedOperationException.class) @@ -232,8 +205,8 @@ public void testCreateOperation() throws Exception { model = getModelBuilder().createModel(context, contracts, true, pet.getTopiaId()); - getModelBuilder().addBeforeOperation(model, TopiaTckItEntityEnum.Pet, FakeOperation.class, "before"); - getModelBuilder().addAfterOperation(model, TopiaTckItEntityEnum.Race, FakeOperation.class, "after"); + getModelBuilder().addBeforeOperation(model, TopiaTckLegacyEntityEnum.Pet, FakeOperation.class, "before"); + getModelBuilder().addAfterOperation(model, TopiaTckLegacyEntityEnum.Race, FakeOperation.class, "after"); } @Test(expected = NullPointerException.class) @@ -250,31 +223,6 @@ } @Override - protected TopiaContext createDb(String name) throws Exception { - -// File localDB = new File(getTestDir(getClass()), "db_" + name); - - Properties config = getH2Properties(name); - - context = TopiaContextFactory.getContext(config); - - TopiaContextImplementor tx = - (TopiaContextImplementor) context.beginTransaction(); - - person = tx.getDAO(Person.class).create(Person.PROPERTY_NAME, "pudding master"); - race = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race I"); - pet = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding", Pet.PROPERTY_PERSON, person, Pet.PROPERTY_RACE, race); - - person2 = tx.getDAO(Person.class).create(Person.PROPERTY_NAME, "pudding II master"); - pet2 = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding II"); - race2 = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race II"); - - tx.commitTransaction(); - tx.closeContext(); - return context; - } - - @Override protected TopiaEntityEnum[] getContracts() { return contracts; } @@ -284,25 +232,6 @@ return log; } - protected Properties getH2Properties(String dbName) throws IOException { - - Properties config = TestHelper.initTopiaContextConfiguration(tesDir, dbName); - -// config.setProperty("hibernate.show_sql", "false"); -// config.setProperty("hibernate.hbm2ddl.auto", "create"); - - config.setProperty("topia.persistence.classes", entitiesList); -// config.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); -// config.setProperty("hibernate.connection.driver_class", "org.h2.Driver"); -// config.setProperty("hibernate.connection.url", "jdbc:h2:file:" + f.getAbsolutePath() + ";create=true"); -// config.setProperty("hibernate.connection.username", "sa"); -// config.setProperty("hibernate.connection.password", ""); - - config.setProperty("topia.service.replication", TopiaReplicationServiceImpl.class.getName()); - - return config; - } - @Override protected TopiaContext createDb2(String name) throws Exception { throw new UnsupportedOperationException("Not supported yet."); Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java =================================================================== --- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java 2012-05-23 18:32:37 UTC (rev 2522) +++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplAllTest.java 2012-05-23 18:34:02 UTC (rev 2523) @@ -27,29 +27,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.After; -import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import org.nuiton.topia.TestHelper; -import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaContextFactory; import org.nuiton.topia.TopiaException; -import org.nuiton.topia.TopiaTestDAOHelper.TopiaTckItEntityEnum; -import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.persistence.TopiaEntity; import org.nuiton.topia.persistence.TopiaEntityEnum; -import org.nuiton.topia.test.entities.Person; -import org.nuiton.topia.test.entities.PersonImpl; -import org.nuiton.topia.test.entities.Pet; -import org.nuiton.topia.test.entities.PetImpl; -import org.nuiton.topia.test.entities.Race; -import org.nuiton.topia.test.entities.RaceImpl; +import org.nuiton.topia.tck.legacy.entities.Person; +import org.nuiton.topia.tck.legacy.entities.Pet; +import org.nuiton.topia.tck.legacy.entities.Race; -import java.io.File; -import java.io.IOException; -import java.util.Properties; +import static org.nuiton.topia.tck.legacy.TopiaTckLegacyDAOHelper.TopiaTckLegacyEntityEnum; /** * TopiaReplicationServiceImplTest on model TopiaTest @@ -62,63 +49,41 @@ public class TopiaReplicationServiceImplAllTest extends AbstractTopiaReplicationServiceTest { /** Logger */ - private static final Log log = LogFactory.getLog(TopiaReplicationServiceImplTest.class); + private static final Log log = + LogFactory.getLog(TopiaReplicationServiceImplTest.class); protected static final TopiaEntityEnum[] contracts = { - TopiaTckItEntityEnum.Person, - TopiaTckItEntityEnum.Pet, - TopiaTckItEntityEnum.Race + TopiaTckLegacyEntityEnum.Person, + TopiaTckLegacyEntityEnum.Pet, + TopiaTckLegacyEntityEnum.Race }; - protected static final String entitiesList = - PersonImpl.class.getName() + "," + - PetImpl.class.getName() + "," + - RaceImpl.class.getName(); + protected Person person, person2; - static protected Person person, person2; + protected Pet pet, pet2, pet3; - static protected Pet pet, pet2, pet3; + protected Race race, race2, race3; - static protected Race race, race2, race3; - - protected static File tesDir; - - @BeforeClass - public static void beforeClass() throws IOException { - tesDir = TestHelper.getTestBasedir(TopiaReplicationServiceImplAllTest.class); - } - - @AfterClass - public static void after() throws Exception { - AbstractTopiaReplicationServiceTest.after(); - } - @Before @Override public void setUp() throws Exception { super.setUp(); - person = update(person); - person2 = update(person2); - pet = update(pet); - pet2 = update(pet2); - race = update(race); - race2 = update(race2); - race3 = update(race3); - } + // get data - @After - @Override - public void tearDown() throws Exception { - super.tearDown(); - if (dstCtxt != null && !dstCtxt.isClosed()) { - dstCtxt.closeContext(); - } + ModelFixture fixtures = db.getFixtures(); + + person = fixtures.getPerson(ctxt); + person2 = fixtures.getPerson2(ctxt); + pet = fixtures.getPet(ctxt); + pet2 = fixtures.getPet2(ctxt); + pet3 = fixtures.getPet3(ctxt); + race = fixtures.getRace(ctxt); + race2 = fixtures.getRace2(ctxt); + race3 = fixtures.getRace3(ctxt); } -// @Ignore - @Test @Override public void testDetectTypes() throws Exception { @@ -135,20 +100,16 @@ detectTypes(pet3, Pet.class, Race.class); } -// @Ignore - @Test @Override public void testGetOperation() throws Exception { } -// @Ignore - @Test @Override public void testDetectAssociations() throws Exception { - detectAssociations(person, TopiaTckItEntityEnum.Person, Person.PROPERTY_PET); + detectAssociations(person, TopiaTckLegacyEntityEnum.Person, Person.PROPERTY_PET); detectAssociations(race); detectAssociations(pet); @@ -158,56 +119,46 @@ } -// @Ignore - @Test @Override public void testDetectDirectDependencies() throws Exception { detectDirectDependencies(person); detectDirectDependencies(race); - detectDirectDependencies(pet, TopiaTckItEntityEnum.Pet, Pet.PROPERTY_PERSON, TopiaTckItEntityEnum.Pet, Pet.PROPERTY_RACE); + detectDirectDependencies(pet, TopiaTckLegacyEntityEnum.Pet, Pet.PROPERTY_PERSON, TopiaTckLegacyEntityEnum.Pet, Pet.PROPERTY_RACE); detectDirectDependencies(person2); detectDirectDependencies(race2); detectDirectDependencies(pet2); } -// @Ignore - @Test @Override public void testDetectShell() throws Exception { - detectShell(person, TopiaTckItEntityEnum.Pet, TopiaTckItEntityEnum.Race); + detectShell(person, TopiaTckLegacyEntityEnum.Pet, TopiaTckLegacyEntityEnum.Race); detectShell(race); - detectShell(pet, TopiaTckItEntityEnum.Person, TopiaTckItEntityEnum.Race); - detectShell(person2, TopiaTckItEntityEnum.Pet, TopiaTckItEntityEnum.Race); + detectShell(pet, TopiaTckLegacyEntityEnum.Person, TopiaTckLegacyEntityEnum.Race); + detectShell(person2, TopiaTckLegacyEntityEnum.Pet, TopiaTckLegacyEntityEnum.Race); detectShell(race2); - detectShell(pet2, TopiaTckItEntityEnum.Person, TopiaTckItEntityEnum.Race); + detectShell(pet2, TopiaTckLegacyEntityEnum.Person, TopiaTckLegacyEntityEnum.Race); } -// @Ignore - @Test @Override public void testDetectDependencies() throws Exception { detectDependencies(null, - new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Race}, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Person}, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Pet}); + new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Race}, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Person}, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Pet}); } -// @Ignore - @Test @Override public void testDetectObjectsToDettach() throws Exception { - detectObjectsToDettach(null, TopiaTckItEntityEnum.Person, new String[]{Person.PROPERTY_PET}); + detectObjectsToDettach(null, TopiaTckLegacyEntityEnum.Person, new String[]{Person.PROPERTY_PET}); } -// @Ignore - @Test @Override public void testDetectOperations() throws Exception { @@ -215,8 +166,6 @@ detectOperations(null); } -// @Ignore - @Test @Override public void testDoReplicate() throws Exception { @@ -226,43 +175,6 @@ } @Override - protected TopiaContext createDb(String name) throws Exception { - -// File localDB = new File(getTestDir(getClass()), "db_" + name); - - Properties config = getH2Properties(name); - - context = TopiaContextFactory.getContext(config); - - TopiaContextImplementor tx = (TopiaContextImplementor) context.beginTransaction(); - - person = tx.getDAO(Person.class).create(Person.PROPERTY_NAME, "pudding master"); - race = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race I"); - pet = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding", Pet.PROPERTY_PERSON, person, Pet.PROPERTY_RACE, race); - - person2 = tx.getDAO(Person.class).create(Person.PROPERTY_NAME, "pudding II master"); - pet2 = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding II"); - race2 = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race II"); - - race3 = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race III"); - pet3 = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding III", Pet.PROPERTY_RACE, race3); - - tx.commitTransaction(); - tx.closeContext(); - return context; - } - - @Override - protected TopiaContext createDb2(String name) throws Exception { - -// File localDB = new File(getTestDir(getClass()), "db_" + name); - - Properties config = getH2Properties(name); - - return TopiaContextFactory.getContext(config); - } - - @Override protected TopiaEntityEnum[] getContracts() { return contracts; } @@ -272,26 +184,6 @@ return log; } - protected Properties getH2Properties(String dbName) throws IOException { - - Properties config = TestHelper.initTopiaContextConfiguration(tesDir, dbName); - -// config.setProperty("hibernate.show_sql", "false"); -// config.setProperty("hibernate.hbm2ddl.auto", "create"); - - config.setProperty("topia.persistence.classes", entitiesList); -// config.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); -// config.setProperty("hibernate.connection.driver_class", "org.h2.Driver"); -// config.setProperty("hibernate.connection.url", "jdbc:h2:file:" + f.getAbsolutePath() + ";create=true"); -// config.setProperty("hibernate.connection.username", "sa"); -// config.setProperty("hibernate.connection.password", ""); - - config.setProperty(TopiaReplicationServiceImpl.TOPIA_SERVICE_NAME, TopiaReplicationServiceImpl.class.getName()); - - return config; - } - - @Override protected void createModel(TopiaEntity entity) throws TopiaException { model = getModelBuilder().createModelForAll(getContracts()); Modified: trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java =================================================================== --- trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java 2012-05-23 18:32:37 UTC (rev 2522) +++ trunk/topia-service-replication/src/test/java/org/nuiton/topia/replication/TopiaReplicationServiceImplTest.java 2012-05-23 18:34:02 UTC (rev 2523) @@ -27,16 +27,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.After; -import org.junit.AfterClass; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import org.nuiton.topia.TestHelper; import org.nuiton.topia.TopiaContext; -import org.nuiton.topia.TopiaContextFactory; import org.nuiton.topia.TopiaException; -import org.nuiton.topia.TopiaTestDAOHelper.TopiaTckItEntityEnum; import org.nuiton.topia.framework.TopiaContextImplementor; import org.nuiton.topia.persistence.TopiaEntityEnum; import org.nuiton.topia.persistence.util.TopiaEntityIdsMap; @@ -46,16 +40,11 @@ import org.nuiton.topia.replication.operation.FakeOperation; import org.nuiton.topia.replication.operation.UncreatableOperation; import org.nuiton.topia.replication.operation.UnregistredOperation; -import org.nuiton.topia.test.entities.Person; -import org.nuiton.topia.test.entities.PersonImpl; -import org.nuiton.topia.test.entities.Pet; -import org.nuiton.topia.test.entities.PetImpl; -import org.nuiton.topia.test.entities.Race; -import org.nuiton.topia.test.entities.RaceImpl; +import org.nuiton.topia.tck.legacy.entities.Person; +import org.nuiton.topia.tck.legacy.entities.Pet; +import org.nuiton.topia.tck.legacy.entities.Race; -import java.io.File; -import java.io.IOException; -import java.util.Properties; +import static org.nuiton.topia.tck.legacy.TopiaTckLegacyDAOHelper.TopiaTckLegacyEntityEnum; /** * TopiaReplicationServiceImplTest on model TopiaTest @@ -71,51 +60,30 @@ private static final Log log = LogFactory.getLog(TopiaReplicationServiceImplTest.class); - protected static final TopiaEntityEnum[] contracts = {TopiaTckItEntityEnum.Person, TopiaTckItEntityEnum.Pet, TopiaTckItEntityEnum.Race}; + protected static final TopiaEntityEnum[] contracts = {TopiaTckLegacyEntityEnum.Person, TopiaTckLegacyEntityEnum.Pet, TopiaTckLegacyEntityEnum.Race}; - protected static final String entitiesList = PersonImpl.class.getName() + "," + PetImpl.class.getName() + "," + RaceImpl.class.getName(); + protected Person person, person2; - static protected Person person, person2; + protected Pet pet, pet2, pet3; - static protected Pet pet, pet2, pet3; + protected Race race, race2, race3; - static protected Race race, race2, race3; - - protected static File tesDir; - - @BeforeClass - public static void beforeClass() throws IOException { - tesDir = TestHelper.getTestBasedir( - TopiaReplicationServiceImplTest.class); - } - - @AfterClass - public static void after() throws Exception { - AbstractTopiaReplicationServiceTest.after(); - } - @Before @Override public void setUp() throws Exception { super.setUp(); - person = update(person); - person2 = update(person2); - pet = update(pet); - pet2 = update(pet2); - race = update(race); - race2 = update(race2); - race3 = update(race3); - } + ModelFixture fixtures = db.getFixtures(); - @After - @Override - public void tearDown() throws Exception { - super.tearDown(); - if (dstCtxt != null && !dstCtxt.isClosed()) { - dstCtxt.closeContext(); - } + person = fixtures.getPerson(ctxt); + person2 = fixtures.getPerson2(ctxt); + pet = fixtures.getPet(ctxt); + pet2 = fixtures.getPet2(ctxt); + pet3 = fixtures.getPet3(ctxt); + race = fixtures.getRace(ctxt); + race2 = fixtures.getRace2(ctxt); + race3 = fixtures.getRace3(ctxt); } @Test @@ -149,7 +117,7 @@ @Override public void testDetectAssociations() throws Exception { - detectAssociations(person, TopiaTckItEntityEnum.Person, Person.PROPERTY_PET); + detectAssociations(person, TopiaTckLegacyEntityEnum.Person, Person.PROPERTY_PET); detectAssociations(race); detectAssociations(pet); @@ -164,7 +132,7 @@ detectDirectDependencies(person); detectDirectDependencies(race); - detectDirectDependencies(pet, TopiaTckItEntityEnum.Pet, Pet.PROPERTY_PERSON, TopiaTckItEntityEnum.Pet, Pet.PROPERTY_RACE); + detectDirectDependencies(pet, TopiaTckLegacyEntityEnum.Pet, Pet.PROPERTY_PERSON, TopiaTckLegacyEntityEnum.Pet, Pet.PROPERTY_RACE); detectDirectDependencies(person2); detectDirectDependencies(race2); @@ -175,9 +143,9 @@ @Override public void testDetectShell() throws Exception { - detectShell(person, TopiaTckItEntityEnum.Pet, TopiaTckItEntityEnum.Race); + detectShell(person, TopiaTckLegacyEntityEnum.Pet, TopiaTckLegacyEntityEnum.Race); detectShell(race); - detectShell(pet, TopiaTckItEntityEnum.Person, TopiaTckItEntityEnum.Race); + detectShell(pet, TopiaTckLegacyEntityEnum.Person, TopiaTckLegacyEntityEnum.Race); detectShell(person2); detectShell(race2); detectShell(pet2); @@ -187,22 +155,22 @@ @Override public void testDetectDependencies() throws Exception { - detectDependencies(person, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Race}, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Person}, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Pet}); - detectDependencies(race, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Race}); - detectDependencies(pet, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Race}, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Person}, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Pet}); + detectDependencies(person, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Race}, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Person}, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Pet}); + detectDependencies(race, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Race}); + detectDependencies(pet, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Race}, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Person}, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Pet}); - detectDependencies(person2, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Person}); - detectDependencies(race2, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Race}); - detectDependencies(pet2, new TopiaTckItEntityEnum[]{TopiaTckItEntityEnum.Pet}); + detectDependencies(person2, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Person}); + detectDependencies(race2, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Race}); + detectDependencies(pet2, new TopiaTckLegacyEntityEnum[]{TopiaTckLegacyEntityEnum.Pet}); } @Test @Override public void testDetectObjectsToDettach() throws Exception { - detectObjectsToDettach(person, TopiaTckItEntityEnum.Person, new String[]{Person.PROPERTY_PET}); + detectObjectsToDettach(person, TopiaTckLegacyEntityEnum.Person, new String[]{Person.PROPERTY_PET}); detectObjectsToDettach(race); - detectObjectsToDettach(pet, TopiaTckItEntityEnum.Person, new String[]{Person.PROPERTY_PET}); + detectObjectsToDettach(pet, TopiaTckLegacyEntityEnum.Person, new String[]{Person.PROPERTY_PET}); detectObjectsToDettach(person2); detectObjectsToDettach(race2); @@ -234,18 +202,18 @@ @Override public void testDoReplicate() throws Exception { - doReplicate(TopiaTckItEntityEnum.Person, person); - doReplicate(TopiaTckItEntityEnum.Person, person2); - doReplicate(TopiaTckItEntityEnum.Person, person, person2); + doReplicate(TopiaTckLegacyEntityEnum.Person, person); + doReplicate(TopiaTckLegacyEntityEnum.Person, person2); + doReplicate(TopiaTckLegacyEntityEnum.Person, person, person2); - doReplicate(TopiaTckItEntityEnum.Pet, pet); - doReplicate(TopiaTckItEntityEnum.Pet, pet2); - doReplicate(TopiaTckItEntityEnum.Pet, pet, pet2, pet3); - doReplicate(TopiaTckItEntityEnum.Pet, person2, pet3); + doReplicate(TopiaTckLegacyEntityEnum.Pet, pet); + doReplicate(TopiaTckLegacyEntityEnum.Pet, pet2); + doReplicate(TopiaTckLegacyEntityEnum.Pet, pet, pet2, pet3); + doReplicate(TopiaTckLegacyEntityEnum.Pet, person2, pet3); - doReplicate(TopiaTckItEntityEnum.Race, race); - doReplicate(TopiaTckItEntityEnum.Race, race2); - doReplicate(TopiaTckItEntityEnum.Race, race, race2); + doReplicate(TopiaTckLegacyEntityEnum.Race, race); + doReplicate(TopiaTckLegacyEntityEnum.Race, race2); + doReplicate(TopiaTckLegacyEntityEnum.Race, race, race2); } @@ -318,7 +286,7 @@ dstCtxt.commitTransaction(); srcCtxt.rollbackTransaction(); - person = update(person); + person = db.getFixtures().getPerson(srcCtxt); assertEntityEquals(person, dstCtxt.findByTopiaId(person.getTopiaId()), null); } finally { @@ -372,10 +340,10 @@ srcCtxt.closeContext(); dstCtxt.closeContext(); - ctxt = context.beginTransaction(); + ctxt = db.beginTransaction(); dstCtxt = (TopiaContextImplementor) dstRootCtxt.beginTransaction(); - person = update(person); + person = db.getFixtures().getPerson(ctxt); assertEntityEquals(person, dstCtxt.findByTopiaId(person.getTopiaId()), null); @@ -385,45 +353,6 @@ } @Override - protected TopiaContext createDb(String name) throws Exception { - -// File localDB = new File(getTestDir(getClass()), "db_" + name); - - Properties config = getH2Properties(name); - - context = TopiaContextFactory.getContext(config); - - TopiaContextImplementor tx = (TopiaContextImplementor) context.beginTransaction(); - - person = tx.getDAO(Person.class).create(Person.PROPERTY_NAME, "pudding master"); - race = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race I"); - pet = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding", Pet.PROPERTY_PERSON, person, Pet.PROPERTY_RACE, race); - - person2 = tx.getDAO(Person.class).create(Person.PROPERTY_NAME, "pudding II master"); - pet2 = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding II"); - race2 = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race II"); - - race3 = tx.getDAO(Race.class).create(Race.PROPERTY_NAME, "race III"); - pet3 = tx.getDAO(Pet.class).create(Pet.PROPERTY_NAME, "pudding III", Pet.PROPERTY_RACE, race3); - - tx.commitTransaction(); - tx.closeContext(); - return context; - } - - @Override - protected TopiaContext createDb2(String name) throws Exception { - -// File localDB = new File(getTestDir(getClass()), "db_" + name); -// -// log.info("db dir :\n" + localDB.getAbsolutePath()); - - Properties config = getH2Properties(name); - - return TopiaContextFactory.getContext(config); - } - - @Override protected TopiaEntityEnum[] getContracts() { return contracts; } @@ -433,25 +362,6 @@ return log; } - protected Properties getH2Properties(String dbName) throws IOException { - - - Properties config = TestHelper.initTopiaContextConfiguration(tesDir, dbName); - -// config.setProperty("hibernate.show_sql", "false"); -// config.setProperty("hibernate.hbm2ddl.auto", "create"); - - config.setProperty("topia.persistence.classes", entitiesList); -// config.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect"); -// config.setProperty("hibernate.connection.driver_class", "org.h2.Driver"); -// config.setProperty("hibernate.connection.url", "jdbc:h2:file:" + f.getAbsolutePath() + "/db;create=true"); -// config.setProperty("hibernate.connection.username", "sa"); -// config.setProperty("hibernate.connection.password", ""); - - config.setProperty(TopiaReplicationServiceImpl.TOPIA_SERVICE_NAME, TopiaReplicationServiceImpl.class.getName()); - - return config; - } } Copied: trunk/topia-service-replication/src/test/resources/TopiaContext-legacy.properties (from rev 2518, trunk/topia-persistence-hibernate/src/test/resources/TopiaContext-legacy.properties) =================================================================== --- trunk/topia-service-replication/src/test/resources/TopiaContext-legacy.properties (rev 0) +++ trunk/topia-service-replication/src/test/resources/TopiaContext-legacy.properties 2012-05-23 18:34:02 UTC (rev 2523) @@ -0,0 +1,15 @@ +# Proprietes par defaut pour une base de donnees de type H2 et le model legacy +hibernate.hbm2ddl.auto=update +hibernate.show_sql=false + +hibernate.dialect=org.hibernate.dialect.H2Dialect + +topia.use.hibernate.mapping.files=false +topia.connection.username=sa +topia.connection.password=sa +topia.connection.driver_class=org.h2.Driver + +#Not necessary, but useful +hibernate.connection.provider_class=org.nuiton.topia.framework.TopiaHibernateConnectionProvider + +topia.service.replication=org.nuiton.topia.replication.TopiaReplicationServiceImpl \ No newline at end of file
participants (1)
-
tchemit@users.nuiton.org