Package org.nuiton.topia.replication
Class TopiaReplicationServiceImplTest
java.lang.Object
org.junit.Assert
org.nuiton.topia.replication.AbstractTopiaReplicationServiceTest
org.nuiton.topia.replication.TopiaReplicationServiceImplTest
public class TopiaReplicationServiceImplTest extends AbstractTopiaReplicationServiceTest
TopiaReplicationServiceImplTest on model TopiaTest
Created: 07 jun. 09 17:14:22
- Since:
- 2.2.0
- Author:
- tchemit <chemit@codelutin.com>
-
Field Summary
Fields Modifier and Type Field Description protected static TopiaEntityEnum[]contractsprotected static java.lang.StringentitiesListprotected static Personpersonprotected static Personperson2protected static Petpetprotected static Petpet2protected static Petpet3protected static Raceraceprotected static Racerace2protected static Racerace3protected static java.io.FiletesDir -
Constructor Summary
Constructors Constructor Description TopiaReplicationServiceImplTest() -
Method Summary
Modifier and Type Method Description static voidafter()static voidbeforeClass()protected TopiaContextcreateDb(java.lang.String name)protected TopiaContextcreateDb2(java.lang.String name)protected TopiaEntityEnum[]getContracts()protected java.util.PropertiesgetH2Properties(java.lang.String dbName)protected org.apache.commons.logging.LoggetLog()voidsetUp()voidtearDown()voidtestDetectAssociations()Test of detectAssociations method, of class ReplicationModel.voidtestDetectDependencies()Test of detectDependencies method, of class ReplicationModel.voidtestDetectDirectDependencies()Test of detectDirectDependencies method, of class ReplicationModel.voidtestDetectObjectsToDettach()Test of detectObjectsToDettach method, of class ReplicationModel.voidtestDetectOperations()Test of detectOperations method, of class ReplicationModel.voidtestDetectShell()Test of detectShell method, of class ReplicationModel.voidtestDetectTypes()Test of detectTypes method, of class ReplicationServiceImplementor.voidtestDoReplicate()Test of doReplicate method, of class ReplicationService.voidtestGetOperation()Test of getOperation method, of class ReplicationServiceImplementor.voidtestSimpleReplicateFailed()Cette methode montre pourquoi la simple replication ne peut pas fonctionne :) Le replicateur ne deplique pas dans le bon ordre et on a donc des violations de clef etrangeres...voidtestSimpleReplicateNotSure()Cette methode montre comment manuellement on peut effectuer la replication (en dettachant les dependances qui forment des cycles) La methode utilisee ici peut ne pas fonctionner : si une clef metier est posee sur une dependance alors cela ne fonctionne pas.voidtestSimpleReplicateSure()Cette methode montre comment manuellement on peut effectuer la replication (en dettachant les associations qui forment des cycles) La methode utilisee ici fonctionne mieux que la precedante : il parrait dificille de pose une une clef metier sur une association :).Methods inherited from class org.nuiton.topia.replication.AbstractTopiaReplicationServiceTest
assertDbEquals, assertEntityEquals, createModel, createReplicateDb, createSupportedAfterOperation, createSupportedBeforeOperation, createUnsupportedAfterOperation, createUnsupportedBeforeOperation, detectAssociations, detectDependencies, detectDirectDependencies, detectObjectsToDettach, detectOperations, detectShell, detectTypes, doReplicate, doReplicateAll, doReplicateWithComputedOrder, getModelBuilder, getOperation, getTestDir, getTestsTimeStamp, prepareModel, prepareModelAll, prepareModelWithComputedOrder, updateMethods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
Constructor Details
-
TopiaReplicationServiceImplTest
public TopiaReplicationServiceImplTest()
-
-
Method Details
-
beforeClass
public static void beforeClass() throws java.io.IOException- Throws:
java.io.IOException
-
after
public static void after() throws java.lang.Exception- Throws:
java.lang.Exception
-
setUp
public void setUp() throws java.lang.Exception- Overrides:
setUpin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception
-
tearDown
public void tearDown() throws java.lang.Exception- Overrides:
tearDownin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception
-
testDetectTypes
public void testDetectTypes() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectTypes method, of class ReplicationServiceImplementor.- Overrides:
testDetectTypesin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testGetOperation
public void testGetOperation() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of getOperation method, of class ReplicationServiceImplementor.- Overrides:
testGetOperationin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDetectAssociations
public void testDetectAssociations() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectAssociations method, of class ReplicationModel.- Overrides:
testDetectAssociationsin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDetectDirectDependencies
public void testDetectDirectDependencies() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectDirectDependencies method, of class ReplicationModel.- Overrides:
testDetectDirectDependenciesin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDetectShell
public void testDetectShell() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectShell method, of class ReplicationModel.- Overrides:
testDetectShellin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDetectDependencies
public void testDetectDependencies() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectDependencies method, of class ReplicationModel.- Overrides:
testDetectDependenciesin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDetectObjectsToDettach
public void testDetectObjectsToDettach() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectObjectsToDettach method, of class ReplicationModel.- Overrides:
testDetectObjectsToDettachin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDetectOperations
public void testDetectOperations() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of detectOperations method, of class ReplicationModel.- Overrides:
testDetectOperationsin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testDoReplicate
public void testDoReplicate() throws java.lang.ExceptionDescription copied from class:AbstractTopiaReplicationServiceTestTest of doReplicate method, of class ReplicationService.- Overrides:
testDoReplicatein classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception- if any error
-
testSimpleReplicateFailed
public void testSimpleReplicateFailed() throws java.lang.ExceptionCette methode montre pourquoi la simple replication ne peut pas fonctionne :) Le replicateur ne deplique pas dans le bon ordre et on a donc des violations de clef etrangeres...- Throws:
java.lang.Exception- pour toute erreur
-
testSimpleReplicateNotSure
public void testSimpleReplicateNotSure() throws java.lang.ExceptionCette methode montre comment manuellement on peut effectuer la replication (en dettachant les dependances qui forment des cycles) La methode utilisee ici peut ne pas fonctionner : si une clef metier est posee sur une dependance alors cela ne fonctionne pas.- Throws:
java.lang.Exception- pour toute erreur
-
testSimpleReplicateSure
public void testSimpleReplicateSure() throws java.lang.ExceptionCette methode montre comment manuellement on peut effectuer la replication (en dettachant les associations qui forment des cycles) La methode utilisee ici fonctionne mieux que la precedante : il parrait dificille de pose une une clef metier sur une association :). On remarque que l'on dettache l'assocation qui forme un cycle et que l'on est pas obligee de la reattachee car elle est bi-directionnelle. On doit optimiser l'algorithme dans la methodeReplicationModel.adjustOperations(TopiaEntityIdsMap).- Throws:
java.lang.Exception- pour toute erreur
-
createDb
- Specified by:
createDbin classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception
-
createDb2
- Specified by:
createDb2in classAbstractTopiaReplicationServiceTest- Throws:
java.lang.Exception
-
getContracts
- Specified by:
getContractsin classAbstractTopiaReplicationServiceTest
-
getLog
protected org.apache.commons.logging.Log getLog()- Specified by:
getLogin classAbstractTopiaReplicationServiceTest
-
getH2Properties
protected java.util.Properties getH2Properties(java.lang.String dbName) throws java.io.IOException- Throws:
java.io.IOException
-