org.nuiton.topia.replication
Class AbstractTopiaReplicationServiceTest

java.lang.Object
  extended by org.junit.Assert
      extended by org.nuiton.topia.replication.AbstractTopiaReplicationServiceTest
Direct Known Subclasses:
TopiaReplicationOperationTest, TopiaReplicationServiceImplAllTest, TopiaReplicationServiceImplTest

public abstract class AbstractTopiaReplicationServiceTest
extends org.junit.Assert

TopiaReplicationServiceImplTest.

Created: 07 jun. 09 17:14:22

Since:
2.2.0
Version:
$Id: AbstractTopiaReplicationServiceTest.java 2156 2010-11-28 20:17:13Z tchemit $
Author:
tchemit

Field Summary
protected static TopiaContext context
           
protected static TopiaContext ctxt
           
protected  TopiaContextImplementor dstCtxt
           
protected static boolean init
           
protected  org.nuiton.topia.replication.model.ReplicationModel model
           
protected  org.nuiton.topia.replication.TopiaReplicationService service
           
 
Constructor Summary
AbstractTopiaReplicationServiceTest()
           
 
Method Summary
static void after()
           
protected  void assertDbEquals(TopiaEntityEnum[] contracts, TopiaContextImplementor ctxt, TopiaContextImplementor ctxt2)
           
protected  void assertEntityEquals(TopiaEntity expected, TopiaEntity actual, Set<String> treated)
           
protected abstract  TopiaContext createDb(String name)
           
protected abstract  TopiaContext createDb2(String name)
           
protected  void createModel(TopiaEntity entity)
           
protected  TopiaContext createReplicateDb(Object contract)
           
protected  void createUnsupportedAfterOperation(TopiaEntityEnum contract, TopiaEntity entity, Class<? extends org.nuiton.topia.replication.TopiaReplicationOperation> operationClass, Object... parameters)
           
protected  void createUnsupportedBeforeOperation(TopiaEntityEnum contract, TopiaEntity entity, Class<? extends org.nuiton.topia.replication.TopiaReplicationOperation> operationClass, Object... parameters)
           
protected  void detectAssociations(TopiaEntity entity, Object... expectedCouple)
           
protected  void detectDependencies(TopiaEntity entity, TopiaEntityEnum[]... expected)
           
protected  void detectDirectDependencies(TopiaEntity entity, Object... expectedCouple)
           
protected  void detectObjectsToDettach(TopiaEntity entity, Object... expected)
           
protected  void detectOperations(TopiaEntity entity, Object... expected)
           
protected  void detectShell(TopiaEntity entity, TopiaEntityEnum... expected)
           
protected  void detectTypes(TopiaEntity entity, Object... expectedCouple)
           
protected  void doReplicate(TopiaEntityEnum contract, TopiaEntity... entity)
           
protected  void doReplicateAll()
           
protected  void doReplicateWithComputedOrder(TopiaEntity... entity)
           
protected abstract  TopiaEntityEnum[] getContracts()
           
protected abstract  org.apache.commons.logging.Log getLog()
           
protected  org.nuiton.topia.replication.TopiaReplicationModelBuilder getModelBuilder()
           
protected  void getOperation(Class<? extends org.nuiton.topia.replication.TopiaReplicationOperation> operationClass, boolean shouldExist)
           
protected  File getTestDir(Class<?> testClass)
           
protected  Long getTestsTimeStamp()
           
protected  void prepareModel(String... ids)
           
protected  void prepareModelAll()
           
protected  void prepareModelWithComputedOrder(String... ids)
           
 void setUp()
           
 void tearDown()
           
 void testDetectAssociations()
          Test of detectAssociations method, of class ReplicationModel.
 void testDetectDependencies()
          Test of detectDependencies method, of class ReplicationModel.
 void testDetectDirectDependencies()
          Test of detectDirectDependencies method, of class ReplicationModel.
 void testDetectObjectsToDettach()
          Test of detectObjectsToDettach method, of class ReplicationModel.
 void testDetectOperations()
          Test of detectOperations method, of class ReplicationModel.
 void testDetectShell()
          Test of detectShell method, of class ReplicationModel.
 void testDetectTypes()
          Test of detectTypes method, of class ReplicationServiceImplementor.
 void testDoReplicate()
          Test of doReplicate method, of class ReplicationService.
 void testGetOperation()
          Test of getOperation method, of class ReplicationServiceImplementor.
protected
<E extends TopiaEntity>
E
update(E e)
           
 
Methods inherited from class org.junit.Assert
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, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected static TopiaContext context

ctxt

protected static TopiaContext ctxt

dstCtxt

protected TopiaContextImplementor dstCtxt

service

protected org.nuiton.topia.replication.TopiaReplicationService service

model

protected org.nuiton.topia.replication.model.ReplicationModel model

init

protected static boolean init
Constructor Detail

AbstractTopiaReplicationServiceTest

public AbstractTopiaReplicationServiceTest()
Method Detail

after

public static void after()
                  throws Exception
Throws:
Exception

setUp

public void setUp()
           throws Exception
Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Throws:
Exception

getModelBuilder

protected org.nuiton.topia.replication.TopiaReplicationModelBuilder getModelBuilder()

createDb2

protected abstract TopiaContext createDb2(String name)
                                   throws Exception
Throws:
Exception

createDb

protected abstract TopiaContext createDb(String name)
                                  throws Exception
Throws:
Exception

createReplicateDb

protected TopiaContext createReplicateDb(Object contract)
                                  throws Exception
Throws:
Exception

getContracts

protected abstract TopiaEntityEnum[] getContracts()

getLog

protected abstract org.apache.commons.logging.Log getLog()

update

protected <E extends TopiaEntity> E update(E e)
                                throws TopiaException
Throws:
TopiaException

testDetectTypes

public void testDetectTypes()
                     throws Exception
Test of detectTypes method, of class ReplicationServiceImplementor.

Throws:
Exception - if any error

testGetOperation

public void testGetOperation()
                      throws Exception
Test of getOperation method, of class ReplicationServiceImplementor.

Throws:
Exception - if any error

testDetectAssociations

public void testDetectAssociations()
                            throws Exception
Test of detectAssociations method, of class ReplicationModel.

Throws:
Exception - if any error

testDetectDirectDependencies

public void testDetectDirectDependencies()
                                  throws Exception
Test of detectDirectDependencies method, of class ReplicationModel.

Throws:
Exception - if any error

testDetectShell

public void testDetectShell()
                     throws Exception
Test of detectShell method, of class ReplicationModel.

Throws:
Exception - if any error

testDetectDependencies

public void testDetectDependencies()
                            throws Exception
Test of detectDependencies method, of class ReplicationModel.

Throws:
Exception - if any error

testDetectObjectsToDettach

public void testDetectObjectsToDettach()
                                throws Exception
Test of detectObjectsToDettach method, of class ReplicationModel.

Throws:
Exception - if any error

testDetectOperations

public void testDetectOperations()
                          throws Exception
Test of detectOperations method, of class ReplicationModel.

Throws:
Exception - if any error

testDoReplicate

public void testDoReplicate()
                     throws Exception
Test of doReplicate method, of class ReplicationService.

Throws:
Exception - if any error

detectTypes

protected void detectTypes(TopiaEntity entity,
                           Object... expectedCouple)
                    throws TopiaException
Throws:
TopiaException

getOperation

protected void getOperation(Class<? extends org.nuiton.topia.replication.TopiaReplicationOperation> operationClass,
                            boolean shouldExist)
                     throws TopiaException
Throws:
TopiaException

detectAssociations

protected void detectAssociations(TopiaEntity entity,
                                  Object... expectedCouple)
                           throws TopiaException
Throws:
TopiaException

detectDirectDependencies

protected void detectDirectDependencies(TopiaEntity entity,
                                        Object... expectedCouple)
                                 throws TopiaException
Throws:
TopiaException

detectShell

protected void detectShell(TopiaEntity entity,
                           TopiaEntityEnum... expected)
                    throws TopiaException
Throws:
TopiaException

detectDependencies

protected void detectDependencies(TopiaEntity entity,
                                  TopiaEntityEnum[]... expected)
                           throws TopiaException
Throws:
TopiaException

detectObjectsToDettach

protected void detectObjectsToDettach(TopiaEntity entity,
                                      Object... expected)
                               throws TopiaException
Throws:
TopiaException

detectOperations

protected void detectOperations(TopiaEntity entity,
                                Object... expected)
                         throws TopiaException
Throws:
TopiaException

doReplicate

protected void doReplicate(TopiaEntityEnum contract,
                           TopiaEntity... entity)
                    throws Exception
Throws:
Exception

doReplicateAll

protected void doReplicateAll()
                       throws Exception
Throws:
Exception

doReplicateWithComputedOrder

protected void doReplicateWithComputedOrder(TopiaEntity... entity)
                                     throws Exception
Throws:
Exception

assertDbEquals

protected void assertDbEquals(TopiaEntityEnum[] contracts,
                              TopiaContextImplementor ctxt,
                              TopiaContextImplementor ctxt2)
                       throws TopiaException
Throws:
TopiaException

assertEntityEquals

protected void assertEntityEquals(TopiaEntity expected,
                                  TopiaEntity actual,
                                  Set<String> treated)

createUnsupportedBeforeOperation

protected void createUnsupportedBeforeOperation(TopiaEntityEnum contract,
                                                TopiaEntity entity,
                                                Class<? extends org.nuiton.topia.replication.TopiaReplicationOperation> operationClass,
                                                Object... parameters)
                                         throws Exception
Throws:
Exception

createUnsupportedAfterOperation

protected void createUnsupportedAfterOperation(TopiaEntityEnum contract,
                                               TopiaEntity entity,
                                               Class<? extends org.nuiton.topia.replication.TopiaReplicationOperation> operationClass,
                                               Object... parameters)
                                        throws Exception
Throws:
Exception

getTestsTimeStamp

protected Long getTestsTimeStamp()

getTestDir

protected File getTestDir(Class<?> testClass)

createModel

protected void createModel(TopiaEntity entity)
                    throws TopiaException
Throws:
TopiaException

prepareModel

protected void prepareModel(String... ids)
                     throws TopiaException
Throws:
TopiaException

prepareModelAll

protected void prepareModelAll()
                        throws TopiaException
Throws:
TopiaException

prepareModelWithComputedOrder

protected void prepareModelWithComputedOrder(String... ids)
                                      throws TopiaException
Throws:
TopiaException


Copyright © 2004-2010 CodeLutin. All Rights Reserved.