use of org.jumpmind.symmetric.db.ISymmetricDialect in project symmetric-ds by JumpMind.
the class AbstractTriggerRouterServiceTest method test13BinaryColumnTypesForDerby.
@Test
public void test13BinaryColumnTypesForDerby() {
ISymmetricDialect dialect = getDbDialect();
if (DatabaseNamesConstants.DERBY.equals(dialect.getName())) {
try {
getSqlTemplate().update("drop table test_derby_binary_types");
} catch (Exception e) {
}
getSqlTemplate().update("create table test_derby_binary_types (id integer, data VARCHAR (100) FOR BIT DATA, data2 CHAR(12) FOR BIT DATA)");
TriggerRouter trouter = new TriggerRouter();
Trigger trigger = trouter.getTrigger();
trigger.setSourceTableName("test_derby_binary_types");
trigger.setChannelId(TestConstants.TEST_CHANNEL_ID);
Router router = trouter.getRouter();
router.getNodeGroupLink().setSourceNodeGroupId(TestConstants.TEST_ROOT_NODE_GROUP);
router.getNodeGroupLink().setTargetNodeGroupId(TestConstants.TEST_ROOT_NODE_GROUP);
getTriggerRouterService().saveTriggerRouter(trouter);
ITriggerRouterService triggerService = getTriggerRouterService();
triggerService.syncTriggers();
Assert.assertEquals("Some triggers must have failed to build.", 0, triggerService.getFailedTriggers().size());
getSqlTemplate().update("insert into test_derby_binary_types values (?, ?, ?)", new Object[] { 23, "test 1 2 3".getBytes(), "test 1 2 3".getBytes() });
String csvString = getNextDataRow();
Assert.assertEquals("\"23\",\"dGVzdCAxIDIgMw==\",\"dGVzdCAxIDIgMyAg\"", csvString);
}
}
use of org.jumpmind.symmetric.db.ISymmetricDialect in project symmetric-ds by JumpMind.
the class JavaColumnTransformTest method setUp.
@Before
public void setUp() throws Exception {
ISqlTransaction sqlTransaction = mock(ISqlTransaction.class);
platform = mock(IDatabasePlatform.class);
ISymmetricEngine engine = mock(ISymmetricEngine.class);
IParameterService parameterService = mock(IParameterService.class);
IDatabasePlatform platform = mock(IDatabasePlatform.class);
ISymmetricDialect dialect = mock(ISymmetricDialect.class);
when(dialect.getPlatform()).thenReturn(platform);
when(platform.getDatabaseInfo()).thenReturn(new DatabaseInfo());
when(engine.getParameterService()).thenReturn(parameterService);
when(engine.getSymmetricDialect()).thenReturn(dialect);
extensionService = new ExtensionService(engine);
when(engine.getExtensionService()).thenReturn(extensionService);
context = mock(DataContext.class);
when(context.findTransaction()).thenReturn(sqlTransaction);
}
use of org.jumpmind.symmetric.db.ISymmetricDialect in project symmetric-ds by JumpMind.
the class SimpleIntegrationTest method testAutoConfigureTablesAfterAlreadyCreated.
protected void testAutoConfigureTablesAfterAlreadyCreated(ISymmetricEngine engine) {
ISymmetricDialect dialect = engine.getSymmetricDialect();
assertEquals("Tables were altered when they should not have been", false, dialect.createOrAlterTablesIfNecessary());
}
Aggregations