use of org.jumpmind.db.platform.DatabaseInfo in project symmetric-ds by JumpMind.
the class TestTablesService method insertIntoTestTriggerTable.
public void insertIntoTestTriggerTable(Object[] values) {
Table testTriggerTable = platform.getTableFromCache(null, null, "test_triggers_table", true);
DatabaseInfo dbInfo = getSymmetricDialect().getPlatform().getDatabaseInfo();
String quote = dbInfo.getDelimiterToken();
String catalogSeparator = dbInfo.getCatalogSeparator();
String schemaSeparator = dbInfo.getSchemaSeparator();
ISqlTransaction transaction = sqlTemplate.startSqlTransaction();
try {
transaction.allowInsertIntoAutoIncrementColumns(true, testTriggerTable, quote, catalogSeparator, schemaSeparator);
transaction.prepareAndExecute(getSql("insertIntoTestTriggersTableSql"), values);
transaction.commit();
} finally {
transaction.allowInsertIntoAutoIncrementColumns(false, testTriggerTable, quote, catalogSeparator, schemaSeparator);
transaction.close();
}
}
use of org.jumpmind.db.platform.DatabaseInfo in project symmetric-ds by JumpMind.
the class DataServiceTest method setUp.
@Before
public void setUp() throws Exception {
sqlTemplate = mock(ISqlTemplate.class);
sqlTransaction = mock(ISqlTransaction.class);
when(sqlTemplate.startSqlTransaction()).thenReturn(sqlTransaction);
IDatabasePlatform platform = mock(IDatabasePlatform.class);
when(platform.getDatabaseInfo()).thenReturn(new DatabaseInfo());
when(platform.getSqlTemplate()).thenReturn(sqlTemplate);
symmetricDialect = mock(AbstractSymmetricDialect.class);
when(symmetricDialect.getPlatform()).thenReturn(platform);
parameterService = mock(ParameterService.class);
when(parameterService.getLong(ParameterConstants.ROUTING_LARGEST_GAP_SIZE)).thenReturn(50000000L);
IExtensionService extensionService = mock(ExtensionService.class);
ISymmetricEngine engine = mock(AbstractSymmetricEngine.class);
when(engine.getParameterService()).thenReturn(parameterService);
when(engine.getSymmetricDialect()).thenReturn(symmetricDialect);
dataService = new DataService(engine, extensionService);
}
use of org.jumpmind.db.platform.DatabaseInfo 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);
}
Aggregations