target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testModifyNullable() { assertFalse(schemaHomology.tablesMatch(pearTable, pearTableModifiedNullable)); }
public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
@Test public void testReorderedIndexes() { appleTable.indexes().clear(); appleTable.indexes().add(index("indexA").unique().columns("A", "B")); appleTable.indexes().add(index("indexB").unique().columns("B", "C")); appleTableDuplicate.indexes().clear(); appleTableDuplicate.indexes().add(index("indexB").unique().columns("...
public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
@Test public void testIdenticalSchemas() { Schema schema1 = schema(appleTable, pearTable, simpleTable); Schema schema2 = schema(appleTable, pearTable, simpleTable); boolean match = schemaHomology.schemasMatch(schema1, schema2, Sets.<String>newHashSet()); assertTrue(match); }
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testSchemasWithDifferentTables() { Schema schema1 = schema(appleTable, pearTable, simpleTable); Schema schema2 = schema(appleTable, pearTable); assertFalse(schemaHomology.schemasMatch(schema1, schema2, Sets.<String>newHashSet())); assertEquals(ImmutableSet.of("Table [MYTABLE] is present in SCHEMA1 but...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testSchemasWithDifferentTablesReversed() { Schema schema1 = schema(appleTable, pearTable); Schema schema2 = schema(appleTable, pearTable, simpleTable); assertFalse(schemaHomology.schemasMatch(schema1, schema2, Sets.<String>newHashSet())); assertEquals(ImmutableSet.of("Table [MYTABLE] is present in SCH...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@SuppressWarnings("unchecked") @Test public void testWriteStatusFromStatusWithCurrentStatusEqualsToStatus() { when(sqlScriptExecutor.executeQuery(any(), any())).thenReturn(UpgradeStatus.DATA_TRANSFER_REQUIRED); when(sqlScriptExecutor.execute(anyList())).thenThrow(new RuntimeSqlException(new SQLException())); int result...
@Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e) { UpgradeStatus currentStatus = getStatus(Optional.empty()); log.deb...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
@Test public void testSchemasWithDifferentTableDefinitions() { Schema schema1 = schema(appleTable, pearTable, simpleTable); Schema schema2 = schema(appleTableMissingIndex, pearTable, simpleTable); assertFalse(schemaHomology.schemasMatch(schema1, schema2, Sets.<String>newHashSet())); }
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testColumnsMatch() { assertTrue("columns should match", schemaHomology.columnsMatch(column("colour", DataType.STRING).nullable(), column("colour", DataType.STRING).nullable())); assertTrue("columns should match", schemaHomology.columnsMatch(column("colour", DataType.STRING).nullable(), column("COLOUR"...
public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; }
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } }
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Nam...
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Nam...
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Nam...
@Test public void testIndexesMatch() { assertTrue("indexes should match", schemaHomology.indexesMatch(index("ABC").unique().columns("a", "b", "c"), index("ABC").unique().columns("a", "b", "c"))); assertFalse("indexes should match", schemaHomology.indexesMatch(index("ABC").unique().columns("a", "b", "c"), index("ABC").u...
public boolean indexesMatch(Index index1, Index index2) { noDifferences = true; checkIndex("unspecified", index1, index2); return noDifferences; }
SchemaHomology { public boolean indexesMatch(Index index1, Index index2) { noDifferences = true; checkIndex("unspecified", index1, index2); return noDifferences; } }
SchemaHomology { public boolean indexesMatch(Index index1, Index index2) { noDifferences = true; checkIndex("unspecified", index1, index2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2N...
SchemaHomology { public boolean indexesMatch(Index index1, Index index2) { noDifferences = true; checkIndex("unspecified", index1, index2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2N...
SchemaHomology { public boolean indexesMatch(Index index1, Index index2) { noDifferences = true; checkIndex("unspecified", index1, index2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2N...
@Test public void testColumnDefaultValueIsChecked() { assertTrue("columns should match", schemaHomology.columnsMatch(column("colour", DataType.STRING, 10), column("colour", DataType.STRING, 10))); assertTrue("columns should match", schemaHomology.columnsMatch(column("colour", DataType.STRING, 10).defaultValue("XYZ"), c...
public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; }
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } }
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Nam...
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Nam...
SchemaHomology { public boolean columnsMatch(Column column1, Column column2) { noDifferences = true; checkColumn(null, column1, column2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Nam...
@Test public void testPrimaryKeyColumnOrderIsChecked() { Table appleTableReOrdered= table("AppleTableWithComplexKey").columns( column("sweet", DataType.BOOLEAN).primaryKey(), column("flavour", DataType.DECIMAL).primaryKey(), column("colour", DataType.STRING).primaryKey() ).indexes( index("sweetness").unique().columns("...
public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
@Test public void testColumnOrderIsCheckedForDifferentNumberOfColumns() { Table appleTableReOrdered= table("appleTableWithComplexKey").columns( column("sweet", DataType.BOOLEAN).primaryKey(), column("flavour", DataType.DECIMAL).primaryKey() ).indexes( index("sweetness").unique().columns("colour") ); assertFalse("Tables...
public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); }
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
SchemaHomology { public boolean tablesMatch(Table table1, Table table2) { noDifferences = true; checkTable(table1, table2); return noDifferences; } SchemaHomology(); SchemaHomology(DifferenceWriter differenceWriter); SchemaHomology(DifferenceWriter differenceWriter, String schema1Name, String schema2Name); boolean sc...
@Test public void testDifferingSchemasWithExcludedTablesMatch() { Schema schema1 = schema(appleTable, pearTable, simpleTable); Schema schema2 = schema(appleTable, pearTable); Set<String> exclusionRegex = Sets.newHashSet("MYTABLE"); assertTrue("Schemas", schemaHomology.schemasMatch(schema1, schema2, exclusionRegex)); }
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testDifferingSchemasWithoutExcludedTablesDoNotMatch() { Schema schema1 = schema(appleTable, pearTable, simpleTable); Schema schema2 = schema(appleTable, pearTable); assertFalse("Schemas", schemaHomology.schemasMatch(schema1, schema2, Sets.<String>newHashSet())); }
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testSchemasDoNotMatchWhenNoMatchingRegexIsFound() { Schema schema1 = schema(appleTable, pearTable, simpleTable); Schema schema2 = schema(appleTable, pearTable); Set<String> exclusionRegex = Sets.newHashSet(".*YOURTABLE"); assertFalse("Schemas", schemaHomology.schemasMatch(schema1, schema2, exclusionRe...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testSchemasMatchWhenRegexMatchesMultipleTables() { Table table1 = table("AbcTable"); Table table2 = table("AbcChair"); Table table3 = table("AbcSofa"); Set<String> exclusionRegex = Sets.newHashSet("^ABC.*"); Schema schema1 = schema(appleTable, pearTable, table1, table2, table3); Schema schema2 = schem...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testWriteStatusFromStatusWithCurrentStatusEqualsFromStatus() { when(sqlScriptExecutor.executeQuery(any(), any())).thenReturn(UpgradeStatus.IN_PROGRESS); when(sqlScriptExecutor.execute(anyListOf(String.class))) .thenThrow(new RuntimeSqlException(new SQLException())) .thenReturn(0); upgradeStatusTableSe...
@Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e) { UpgradeStatus currentStatus = getStatus(Optional.empty()); log.deb...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
@Test public void testRegexesAreCaseInsensitive() { Table table1 = table("AbcTable"); Table table2 = table("AbcChair"); Table table3 = table("AbcSofa"); Set<String> exclusionRegex = Sets.newHashSet("^aBc.*"); Schema schema1 = schema(appleTable, pearTable, table1, table2, table3); Schema schema2 = schema(appleTable, pea...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test public void testSchemasDoNotMatchWhenOneTableIsMisMatchedButIsAlsoCoveredBhTheExclusionRegex() { Set<String> exclusionRegex = Sets.newHashSet("APPLE"); Schema schema1 = schema(appleTable, pearTable); Schema schema2 = schema(appleTableWithExtraColumn, pearTable); assertFalse("Schemas", schemaHomology.schemasMatch(...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test(expected=RuntimeException.class) public void testRuntimeExceptionThrownWhenGivenInvalidRegex() { Set<String> exclusionRegex = Sets.newHashSet("(A-B)+++++++++"); Schema schema1 = schema(appleTable, pearTable); Schema schema2 = schema(appleTable, pearTable, simpleTable); schemaHomology.schemasMatch(schema1, schema2...
public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> additionalTablesInSche...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
SchemaHomology { public boolean schemasMatch(Schema schema1, Schema schema2, Collection<String> exclusionRegex) { noDifferences = true; HashMap<String, Table> schema2Tables = new HashMap<String, Table>(); for (Table table : schema2.tables()) { schema2Tables.put(table.getName().toUpperCase(), table); } Set<String> addit...
@Test @Parameters(method="getNamePatternTestSubjects") public void testValidNamePattern(String name, boolean expectedResult) { boolean result = sqlEntityNameValidationService.isNameConventional(name); assertEquals(format("%s should have been valid=%s but was valid=%s", name, expectedResult, result), expectedResult, res...
public boolean isNameConventional(String name) { return schemaValidator.isNameConventional(name); }
SQLEntityNameValidationService { public boolean isNameConventional(String name) { return schemaValidator.isNameConventional(name); } }
SQLEntityNameValidationService { public boolean isNameConventional(String name) { return schemaValidator.isNameConventional(name); } @Inject SQLEntityNameValidationService(); }
SQLEntityNameValidationService { public boolean isNameConventional(String name) { return schemaValidator.isNameConventional(name); } @Inject SQLEntityNameValidationService(); boolean isReservedWord(String word); boolean isNameConventional(String name); boolean isEntityNameLengthValid(String name); }
SQLEntityNameValidationService { public boolean isNameConventional(String name) { return schemaValidator.isNameConventional(name); } @Inject SQLEntityNameValidationService(); boolean isReservedWord(String word); boolean isNameConventional(String name); boolean isEntityNameLengthValid(String name); }
@Test @Parameters(method="getReservedWordTestSubjects") public void testReservedWord(String name, boolean expectedResult) { boolean result = sqlEntityNameValidationService.isReservedWord(name); assertEquals(format("%s should have been reserved=%s but was reserved=%s", name, expectedResult, result), expectedResult, resu...
public boolean isReservedWord(String word) { return schemaValidator.isSQLReservedWord(word); }
SQLEntityNameValidationService { public boolean isReservedWord(String word) { return schemaValidator.isSQLReservedWord(word); } }
SQLEntityNameValidationService { public boolean isReservedWord(String word) { return schemaValidator.isSQLReservedWord(word); } @Inject SQLEntityNameValidationService(); }
SQLEntityNameValidationService { public boolean isReservedWord(String word) { return schemaValidator.isSQLReservedWord(word); } @Inject SQLEntityNameValidationService(); boolean isReservedWord(String word); boolean isNameConventional(String name); boolean isEntityNameLengthValid(String name); }
SQLEntityNameValidationService { public boolean isReservedWord(String word) { return schemaValidator.isSQLReservedWord(word); } @Inject SQLEntityNameValidationService(); boolean isReservedWord(String word); boolean isNameConventional(String name); boolean isEntityNameLengthValid(String name); }
@Test @Parameters(method="getNameLengthTestSubjects") public void testValidNameLength(String name, boolean expectedResult) { boolean result = sqlEntityNameValidationService.isEntityNameLengthValid(name); assertEquals(format("%s should have been valid=%s but was valid=%s", name, expectedResult, result), expectedResult, ...
public boolean isEntityNameLengthValid(String name) { return schemaValidator.isEntityNameLengthValid(name); }
SQLEntityNameValidationService { public boolean isEntityNameLengthValid(String name) { return schemaValidator.isEntityNameLengthValid(name); } }
SQLEntityNameValidationService { public boolean isEntityNameLengthValid(String name) { return schemaValidator.isEntityNameLengthValid(name); } @Inject SQLEntityNameValidationService(); }
SQLEntityNameValidationService { public boolean isEntityNameLengthValid(String name) { return schemaValidator.isEntityNameLengthValid(name); } @Inject SQLEntityNameValidationService(); boolean isReservedWord(String word); boolean isNameConventional(String name); boolean isEntityNameLengthValid(String name); }
SQLEntityNameValidationService { public boolean isEntityNameLengthValid(String name) { return schemaValidator.isEntityNameLengthValid(name); } @Inject SQLEntityNameValidationService(); boolean isReservedWord(String word); boolean isNameConventional(String name); boolean isEntityNameLengthValid(String name); }
@Test public void testIntegerGetters() { assertEquals(-1, record().setInteger(INTEGER_COLUMN, -1).getInteger(INTEGER_COLUMN).intValue()); assertEquals(0, record().setInteger(INTEGER_COLUMN, 0).getInteger(INTEGER_COLUMN).intValue()); assertEquals(1, record().setInteger(INTEGER_COLUMN, 1).getInteger(INTEGER_COLUMN).intVa...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testBigDecimalGetters() { assertEquals(BigDecimal.ZERO, record().setBigDecimal(BIG_DECIMAL_COLUMN, BigDecimal.ZERO).getBigDecimal(BIG_DECIMAL_COLUMN)); assertEquals(BigDecimal.ONE, record().setBigDecimal(BIG_DECIMAL_COLUMN, BigDecimal.ONE).getBigDecimal(BIG_DECIMAL_COLUMN)); assertEquals(BIG_DECIMAL.l...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testLongGetters() { assertEquals(-1L, record().setLong(LONG_COLUMN, -1L).getLong(LONG_COLUMN).longValue()); assertEquals(0L, record().setLong(LONG_COLUMN, 0L).getLong(LONG_COLUMN).longValue()); assertEquals(1L, record().setLong(LONG_COLUMN, 1L).getLong(LONG_COLUMN).longValue()); assertEquals(LONG, BAS...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testDoubleGetters() { String col = "CoL"; assertEquals(0.1123D, record().setDouble(col, 0.1123D).getDouble(col).doubleValue(), 0.00001); assertEquals(new BigDecimal("0.1123"), record().setDouble(col, 0.1123D).getBigDecimal(col).setScale(4, RoundingMode.HALF_UP)); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testWriteStatusFromStatusWithCurrentStatusNotEqualsFromStatusOrToStatus() { RuntimeSqlException triggeringException = new RuntimeSqlException(new SQLException()); when(sqlScriptExecutor.executeQuery(any(), any())).thenReturn(UpgradeStatus.DATA_TRANSFER_IN_PROGRESS); when(sqlScriptExecutor.execute(anyL...
@Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e) { UpgradeStatus currentStatus = getStatus(Optional.empty()); log.deb...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public int writeStatusFromStatus(UpgradeStatus fromStatus, UpgradeStatus toStatus) { List<String> script = updateTableScript(fromStatus, toStatus); try { return sqlScriptExecutorProvider.get().execute(script); } catch (RuntimeSqlException e)...
@Test public void testStringGetters() { String col = "CoL"; assertEquals("010.00", record().setString(col, "010.00").getString(col)); assertEquals(10L, record().setString(col, "10") .getLong(col).longValue()); assertEquals(10, record().setString(col, "10") .getInteger(col).intValue()); assertEquals(10D, record().setStr...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testBooleanGetters() { String col = "CoL"; assertEquals(true, record().setBoolean(col, true).getBoolean(col)); assertEquals(false, record().setBoolean(col, false).getBoolean(col)); assertEquals("true", record().setBoolean(col, true).getString(col)); assertEquals("false", record().setBoolean(col, false...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testDateGetters() { String col = "CoL"; Date dateValue = java.sql.Date.valueOf("1977-10-10"); LocalDate localDateValue = new LocalDate(1977, 10, 10); assertEquals(dateValue, record().setDate(col, dateValue).getDate(col)); assertEquals(dateValue.toString(), record().setDate(col, dateValue).getString(co...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testLocalDateGetters() { String col = "CoL"; Date dateValue = java.sql.Date.valueOf("1977-10-10"); LocalDate localDateValue = new LocalDate(1977, 10, 10); assertEquals(localDateValue, record().setLocalDate(col, localDateValue).getLocalDate(col)); assertEquals(localDateValue.toString(), record().setLoc...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testNoValueFromDecorator() { assertNull(RecordDecorator.of(record()).getInteger(INTEGER_COLUMN)); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testNullValueFromDecorator() { assertNull(RecordDecorator.of(record().setInteger(INTEGER_COLUMN, null)).getInteger(INTEGER_COLUMN)); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testNullOverrideFromDecorator() { assertNull(RecordDecorator.of(record().setInteger(INTEGER_COLUMN, 3)).setInteger(INTEGER_COLUMN, null).getInteger(INTEGER_COLUMN)); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testOverwriteValue() { assertEquals("B", record().setString("a", "A").setString("a", "B").getString("a")); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@SuppressWarnings("deprecation") @Test public void testOverwriteValueWithNull() { assertNull(record().setString("a", "A").value("a", null).getString("a")); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@SuppressWarnings("deprecation") @Test public void testOverwriteNullWithValue() { assertEquals("B", record().setString("a", null).value("a", "B").getString("a")); }
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testTidyUp() throws SQLException { upgradeStatusTableService.tidyUp(dataSource); ArgumentCaptor<Table> tableCaptor = ArgumentCaptor.forClass(Table.class); verify(sqlDialect).dropStatements(tableCaptor.capture()); assertEquals("Table", tableCaptor.getValue().getName(), UPGRADE_STATUS); }
@Override public void tidyUp(DataSource dataSource) { try { new SqlScriptExecutorProvider(dataSource, sqlDialect).get().execute(sqlDialect.dropStatements(table(UpgradeStatusTableService.UPGRADE_STATUS))); } catch (RuntimeSqlException e) { if (getStatus(Optional.of(dataSource)) != NONE) { throw e; } } }
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public void tidyUp(DataSource dataSource) { try { new SqlScriptExecutorProvider(dataSource, sqlDialect).get().execute(sqlDialect.dropStatements(table(UpgradeStatusTableService.UPGRADE_STATUS))); } catch (RuntimeSqlException e) { if (getStatu...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public void tidyUp(DataSource dataSource) { try { new SqlScriptExecutorProvider(dataSource, sqlDialect).get().execute(sqlDialect.dropStatements(table(UpgradeStatusTableService.UPGRADE_STATUS))); } catch (RuntimeSqlException e) { if (getStatu...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public void tidyUp(DataSource dataSource) { try { new SqlScriptExecutorProvider(dataSource, sqlDialect).get().execute(sqlDialect.dropStatements(table(UpgradeStatusTableService.UPGRADE_STATUS))); } catch (RuntimeSqlException e) { if (getStatu...
UpgradeStatusTableServiceImpl implements UpgradeStatusTableService { @Override public void tidyUp(DataSource dataSource) { try { new SqlScriptExecutorProvider(dataSource, sqlDialect).get().execute(sqlDialect.dropStatements(table(UpgradeStatusTableService.UPGRADE_STATUS))); } catch (RuntimeSqlException e) { if (getStatu...
@Test public void testInternedMetadataAfterDeserialization() throws ClassNotFoundException, IOException { RecordBuilderImpl original = (RecordBuilderImpl) record() .setString("one", "1") .setString("two", "2") .setString("three", "3"); RecordBuilderImpl copy = (RecordBuilderImpl) serializeAndDeserialize(original); orig...
public static RecordBuilder record() { return new RecordBuilderImpl(); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
DataSetUtils { public static RecordBuilder record() { return new RecordBuilderImpl(); } static RecordBuilder record(); static StatementParametersBuilder statementParameters(); static DataSetProducerBuilder dataSetProducer(Schema schema); }
@Test public void testDeepCopy() { SelectStatement parentSelect = new SelectStatement(); SelectStatement childSelect = new SelectStatement(); UnionSetOperator original = new UnionSetOperator(ALL, parentSelect, childSelect); UnionSetOperator copy = (UnionSetOperator) original.deepCopy(noTransformation()).build(); assert...
@Override public Builder<SetOperator> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.<SetOperator>wrapper(new UnionSetOperator(getUnionStrategy(),transformer.deepCopy(getSelectStatement()))); }
UnionSetOperator implements SetOperator { @Override public Builder<SetOperator> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.<SetOperator>wrapper(new UnionSetOperator(getUnionStrategy(),transformer.deepCopy(getSelectStatement()))); } }
UnionSetOperator implements SetOperator { @Override public Builder<SetOperator> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.<SetOperator>wrapper(new UnionSetOperator(getUnionStrategy(),transformer.deepCopy(getSelectStatement()))); } UnionSetOperator(UnionStrategy unionStrategy, ...
UnionSetOperator implements SetOperator { @Override public Builder<SetOperator> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.<SetOperator>wrapper(new UnionSetOperator(getUnionStrategy(),transformer.deepCopy(getSelectStatement()))); } UnionSetOperator(UnionStrategy unionStrategy, ...
UnionSetOperator implements SetOperator { @Override public Builder<SetOperator> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.<SetOperator>wrapper(new UnionSetOperator(getUnionStrategy(),transformer.deepCopy(getSelectStatement()))); } UnionSetOperator(UnionStrategy unionStrategy, ...
@Test public void testInnerExpression() { assertEquals(plus(literal(1), literal(2)), onTest.getInnerExpression()); }
public MathsField getInnerExpression() { return innerExpression; }
BracketedExpression extends AliasedField implements Driver { public MathsField getInnerExpression() { return innerExpression; } }
BracketedExpression extends AliasedField implements Driver { public MathsField getInnerExpression() { return innerExpression; } BracketedExpression(MathsField innerExpression); private BracketedExpression(final String alias, MathsField innerExpression); }
BracketedExpression extends AliasedField implements Driver { public MathsField getInnerExpression() { return innerExpression; } BracketedExpression(MathsField innerExpression); private BracketedExpression(final String alias, MathsField innerExpression); @Override BracketedExpression as(String aliasName); MathsField ge...
BracketedExpression extends AliasedField implements Driver { public MathsField getInnerExpression() { return innerExpression; } BracketedExpression(MathsField innerExpression); private BracketedExpression(final String alias, MathsField innerExpression); @Override BracketedExpression as(String aliasName); MathsField ge...
@Test public void testDrive() { ObjectTreeTraverser.Callback callback = mock(ObjectTreeTraverser.Callback.class); onTest.drive(ObjectTreeTraverser.forCallback(callback)); verify(callback).visit(onTest.getInnerExpression()); }
@Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getInnerExpression()); }
BracketedExpression extends AliasedField implements Driver { @Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getInnerExpression()); } }
BracketedExpression extends AliasedField implements Driver { @Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getInnerExpression()); } BracketedExpression(MathsField innerExpression); private BracketedExpression(final String alias, MathsField innerExpression); }
BracketedExpression extends AliasedField implements Driver { @Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getInnerExpression()); } BracketedExpression(MathsField innerExpression); private BracketedExpression(final String alias, MathsField innerExpression); @Override BracketedExpressi...
BracketedExpression extends AliasedField implements Driver { @Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getInnerExpression()); } BracketedExpression(MathsField innerExpression); private BracketedExpression(final String alias, MathsField innerExpression); @Override BracketedExpressi...
@Test public void testDeepCopyDetail() { SelectStatement statementWithTwoFields = new SelectStatement(new FieldReference("agreementNumber")).from(new TableReference("Schedule")) .where(Criterion.eq(new FieldReference(new TableReference("Schedule"), "agreementNumber"), "A001003657")); FieldFromSelect ffs = new FieldFrom...
public SelectStatement getSelectStatement() { return selectStatement; }
FieldFromSelect extends AliasedField implements Driver { public SelectStatement getSelectStatement() { return selectStatement; } }
FieldFromSelect extends AliasedField implements Driver { public SelectStatement getSelectStatement() { return selectStatement; } private FieldFromSelect(String alias, SelectStatement selectStatement); FieldFromSelect(SelectStatement selectStatement); }
FieldFromSelect extends AliasedField implements Driver { public SelectStatement getSelectStatement() { return selectStatement; } private FieldFromSelect(String alias, SelectStatement selectStatement); FieldFromSelect(SelectStatement selectStatement); SelectStatement getSelectStatement(); @Override void drive(ObjectTr...
FieldFromSelect extends AliasedField implements Driver { public SelectStatement getSelectStatement() { return selectStatement; } private FieldFromSelect(String alias, SelectStatement selectStatement); FieldFromSelect(SelectStatement selectStatement); SelectStatement getSelectStatement(); @Override void drive(ObjectTr...
@Test public void testHashCode() { assertEquals(isEqual.hashCode(), onTest.hashCode()); assertEquals(isEqualAliased.hashCode(), onTestAliased.hashCode()); }
@Override public int hashCode() { return new HashCodeBuilder(1559, 887) .append(schemaName) .append(name) .append(alias) .append(temporary) .toHashCode(); }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public int hashCode() { return new HashCodeBuilder(1559, 887) .append(schemaName) .append(name) .append(alias) .append(temporary) .toHashCode(); } }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public int hashCode() { return new HashCodeBuilder(1559, 887) .append(schemaName) .append(name) .append(alias) .append(temporary) .toHashCode(); } private TableReference(...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public int hashCode() { return new HashCodeBuilder(1559, 887) .append(schemaName) .append(name) .append(alias) .append(temporary) .toHashCode(); } private TableReference(...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public int hashCode() { return new HashCodeBuilder(1559, 887) .append(schemaName) .append(name) .append(alias) .append(temporary) .toHashCode(); } private TableReference(...
@Test public void testEquals() { assertEquals(isEqual, onTest); assertFalse(onTest.equals(null)); assertNotEquals(notEqualDueToSchema, onTest); assertNotEquals(notEqualDueToName, onTest); assertNotEquals(notEqualDueToAlias, onTest); assertEquals(isEqualAliased, onTestAliased); assertNotEquals(differentSchema, onTestAli...
@Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TableReference)) return false; TableReference rhs = (TableReference)obj; return new EqualsBuilder() .append(schemaName, rhs.schemaName) .append(name, rhs.name) .append(alias, rhs.alias) .appen...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TableReference)) return false; TableReference rhs = (...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TableReference)) return false; TableReference rhs = (...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TableReference)) return false; TableReference rhs = (...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public boolean equals(Object obj) { if (obj == null) return false; if (obj == this) return true; if (!(obj instanceof TableReference)) return false; TableReference rhs = (...
@Test public void testAliasImmutability() { AliasedField.withImmutableBuildersEnabled(() -> { assertEquals(isEqual.as("A"), onTest.as("A")); assertEquals(isEqual.as("B").as("A"), onTest.as("A")); assertNotEquals(isEqual.as("A"), onTest.as("B")); assertNotSame(onTest, onTest.as("A")); }); }
public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
@Test public void testAliasMutablity() { AliasedField.withImmutableBuildersDisabled(() -> { assertSame(onTest, onTest.as("A")); }); }
public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { public TableReference as(String aliasName) { if (AliasedField.immutableDslEnabled()) { return new TableReference(this, aliasName); } else { this.alias = aliasName; return this; } } ...
@Test public void testDeepCopy() { TableReference deepCopy = onTest.deepCopy(); assertEquals(deepCopy, onTest); assertNotSame(deepCopy, onTest); }
@Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } private TableReference(TableRef...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } private TableReference(TableRef...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } private TableReference(TableRef...
@Test public void testNoChanges() { Schema sourceSchema = schema( view("View1", select(literal("x")).from(tableRef("a"))), view("VIEW2", select(literal("y")).from(tableRef("b"))), view("view3", select(literal("z")).from(tableRef("c"))) ); Schema targetSchema = schema( view("VIEW1", select(literal("x")).from(tableRef("a...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testDeepCopyAliased() { TableReference deepCopy = onTestAliased.deepCopy(); assertEquals(deepCopy, onTestAliased); assertNotSame(deepCopy, onTestAliased); }
@Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } }
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } private TableReference(TableRef...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } private TableReference(TableRef...
TableReference implements DeepCopyableWithTransformation<TableReference, Builder<TableReference>> { @Override public Builder<TableReference> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(deepCopy()); } private TableReference(TableRef...
@Test public void testGetAutoIncrementStartValue() { assertEquals("Failed to fetch correct value", 1234, DatabaseMetaDataProviderUtils.getAutoIncrementStartValue("AUTONUMSTART:[1234]")); assertEquals("Failed to fetch correct value from large string", 1234, DatabaseMetaDataProviderUtils.getAutoIncrementStartValue(" dfdf...
public static int getAutoIncrementStartValue(String columnComment) { if (StringUtils.isNotEmpty(columnComment)) { Matcher matcher = AUTONUM_START_REGEX.matcher(columnComment); if (matcher.find()) { return Integer.parseInt(matcher.group(1)); } } return -1; }
DatabaseMetaDataProviderUtils { public static int getAutoIncrementStartValue(String columnComment) { if (StringUtils.isNotEmpty(columnComment)) { Matcher matcher = AUTONUM_START_REGEX.matcher(columnComment); if (matcher.find()) { return Integer.parseInt(matcher.group(1)); } } return -1; } }
DatabaseMetaDataProviderUtils { public static int getAutoIncrementStartValue(String columnComment) { if (StringUtils.isNotEmpty(columnComment)) { Matcher matcher = AUTONUM_START_REGEX.matcher(columnComment); if (matcher.find()) { return Integer.parseInt(matcher.group(1)); } } return -1; } }
DatabaseMetaDataProviderUtils { public static int getAutoIncrementStartValue(String columnComment) { if (StringUtils.isNotEmpty(columnComment)) { Matcher matcher = AUTONUM_START_REGEX.matcher(columnComment); if (matcher.find()) { return Integer.parseInt(matcher.group(1)); } } return -1; } static int getAutoIncrementSt...
DatabaseMetaDataProviderUtils { public static int getAutoIncrementStartValue(String columnComment) { if (StringUtils.isNotEmpty(columnComment)) { Matcher matcher = AUTONUM_START_REGEX.matcher(columnComment); if (matcher.find()) { return Integer.parseInt(matcher.group(1)); } } return -1; } static int getAutoIncrementSt...
@Test public void shouldIgnoreIndex() { assertFalse(DatabaseMetaDataProviderUtils.shouldIgnoreIndex("Schedule_1")); assertFalse(DatabaseMetaDataProviderUtils.shouldIgnoreIndex("Fred")); assertFalse(DatabaseMetaDataProviderUtils.shouldIgnoreIndex("Schedule_PRF")); assertFalse(DatabaseMetaDataProviderUtils.shouldIgnoreIn...
public static boolean shouldIgnoreIndex(String indexName) { return indexName.toUpperCase().matches(".*_PRF\\d+$"); }
DatabaseMetaDataProviderUtils { public static boolean shouldIgnoreIndex(String indexName) { return indexName.toUpperCase().matches(".*_PRF\\d+$"); } }
DatabaseMetaDataProviderUtils { public static boolean shouldIgnoreIndex(String indexName) { return indexName.toUpperCase().matches(".*_PRF\\d+$"); } }
DatabaseMetaDataProviderUtils { public static boolean shouldIgnoreIndex(String indexName) { return indexName.toUpperCase().matches(".*_PRF\\d+$"); } static int getAutoIncrementStartValue(String columnComment); static Optional<String> getDataTypeFromColumnComment(String columnComment); static boolean shouldIgnoreIndex(...
DatabaseMetaDataProviderUtils { public static boolean shouldIgnoreIndex(String indexName) { return indexName.toUpperCase().matches(".*_PRF\\d+$"); } static int getAutoIncrementStartValue(String columnComment); static Optional<String> getDataTypeFromColumnComment(String columnComment); static boolean shouldIgnoreIndex(...
@Test public void testOpen() throws SQLException { Table table = buildTable(); String query = "select column from table"; given(dataSource.getConnection()) .willReturn(connection); SqlQueryDataSetProducer producer = new SqlQueryDataSetProducer(table, query, dataSource, sqlDialect); producer.open(); verify(connection).s...
@Override public void open() { try { this.connection = dataSource.getConnection(); this.wasAutoCommit = connection.getAutoCommit(); wasAutoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); } catch (SQLException e) { throw new RuntimeSqlException("Error opening connection", e); } }
SqlQueryDataSetProducer implements DataSetProducer { @Override public void open() { try { this.connection = dataSource.getConnection(); this.wasAutoCommit = connection.getAutoCommit(); wasAutoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); } catch (SQLException e) { throw new RuntimeSqlException("...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void open() { try { this.connection = dataSource.getConnection(); this.wasAutoCommit = connection.getAutoCommit(); wasAutoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); } catch (SQLException e) { throw new RuntimeSqlException("...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void open() { try { this.connection = dataSource.getConnection(); this.wasAutoCommit = connection.getAutoCommit(); wasAutoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); } catch (SQLException e) { throw new RuntimeSqlException("...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void open() { try { this.connection = dataSource.getConnection(); this.wasAutoCommit = connection.getAutoCommit(); wasAutoCommit = connection.getAutoCommit(); connection.setAutoCommit(false); } catch (SQLException e) { throw new RuntimeSqlException("...
@Test public void testClose() throws SQLException { Table table = buildTable(); String query = "select column from table"; given(dataSource.getConnection()) .willReturn(connection); given(connection.getAutoCommit()).willReturn(true); SqlQueryDataSetProducer producer = new SqlQueryDataSetProducer(table, query, dataSourc...
@Override public void close() { if (connection == null) { return; } try { for (ResultSetIterator resultSetIterator : openResultSets) { resultSetIterator.close(); } openResultSets.clear(); connection.setAutoCommit(wasAutoCommit); connection.close(); connection = null; } catch (SQLException e) { throw new RuntimeExceptio...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void close() { if (connection == null) { return; } try { for (ResultSetIterator resultSetIterator : openResultSets) { resultSetIterator.close(); } openResultSets.clear(); connection.setAutoCommit(wasAutoCommit); connection.close(); connection = null;...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void close() { if (connection == null) { return; } try { for (ResultSetIterator resultSetIterator : openResultSets) { resultSetIterator.close(); } openResultSets.clear(); connection.setAutoCommit(wasAutoCommit); connection.close(); connection = null;...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void close() { if (connection == null) { return; } try { for (ResultSetIterator resultSetIterator : openResultSets) { resultSetIterator.close(); } openResultSets.clear(); connection.setAutoCommit(wasAutoCommit); connection.close(); connection = null;...
SqlQueryDataSetProducer implements DataSetProducer { @Override public void close() { if (connection == null) { return; } try { for (ResultSetIterator resultSetIterator : openResultSets) { resultSetIterator.close(); } openResultSets.clear(); connection.setAutoCommit(wasAutoCommit); connection.close(); connection = null;...
@Test public void testRecords() throws SQLException { Table table = buildTable(); String query = "select column from table"; given(dataSource.getConnection()) .willReturn(connection); ResultSet resultSet = mock(ResultSet.class); given(statement.executeQuery(query)).willReturn(resultSet); given(resultSet.findColumn("Col...
@Override public Iterable<Record> records(String tableName) { Table table = getSchema().getTable(tableName); return new Iterable<Record>() { @Override public Iterator<Record> iterator() { ResultSetIterator resultSetIterator = new ResultSetIterator(table, query, connection, sqlDialect); openResultSets.add(resultSetItera...
SqlQueryDataSetProducer implements DataSetProducer { @Override public Iterable<Record> records(String tableName) { Table table = getSchema().getTable(tableName); return new Iterable<Record>() { @Override public Iterator<Record> iterator() { ResultSetIterator resultSetIterator = new ResultSetIterator(table, query, conne...
SqlQueryDataSetProducer implements DataSetProducer { @Override public Iterable<Record> records(String tableName) { Table table = getSchema().getTable(tableName); return new Iterable<Record>() { @Override public Iterator<Record> iterator() { ResultSetIterator resultSetIterator = new ResultSetIterator(table, query, conne...
SqlQueryDataSetProducer implements DataSetProducer { @Override public Iterable<Record> records(String tableName) { Table table = getSchema().getTable(tableName); return new Iterable<Record>() { @Override public Iterator<Record> iterator() { ResultSetIterator resultSetIterator = new ResultSetIterator(table, query, conne...
SqlQueryDataSetProducer implements DataSetProducer { @Override public Iterable<Record> records(String tableName) { Table table = getSchema().getTable(tableName); return new Iterable<Record>() { @Override public Iterator<Record> iterator() { ResultSetIterator resultSetIterator = new ResultSetIterator(table, query, conne...
@Test public void testIsCausedByTimeoutForSQLTimeoutException() { assertEquals(true, databaseExceptionHelper.isCausedByTimeoutException(new ExtendsSQLTimeoutException())); }
public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getClass().getSimpleName())) { r...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
@Test public void testIsCausedByTimeoutForMySQLTimeoutException() { assertEquals(true, databaseExceptionHelper.isCausedByTimeoutException(new MySQLTimeoutException())); }
public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getClass().getSimpleName())) { r...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
DatabaseExceptionHelper { public boolean isCausedByTimeoutException(Throwable throwable) { if (ExceptionUtils.indexOfType(throwable, SQLTimeoutException.class) != -1) { return true; } for (Throwable causeThrowable : ExceptionUtils.getThrowables(throwable)) { if (MYSQL_TIMEOUT_EXCEPTION_NAME.equals(causeThrowable.getCla...
@Test public void testParse() { ParseResult parseResult = NamedParameterPreparedStatement.parse( "SELECT :fee,:fi, :fo(:fum), ':eek' FROM :fum WHERE :fum AND :fo" ); assertThat("Parsed SQL", parseResult.getParsedSql(), equalTo("SELECT ?,?, ?(?), ':eek' FROM ? WHERE ? AND ?")); assertThat("fee", parseResult.getIndexesFo...
public static ParseResult parse(String sql) { return new ParseResult(sql); }
NamedParameterPreparedStatement implements AutoCloseable { public static ParseResult parse(String sql) { return new ParseResult(sql); } }
NamedParameterPreparedStatement implements AutoCloseable { public static ParseResult parse(String sql) { return new ParseResult(sql); } NamedParameterPreparedStatement(Connection connection, String query, Map<String, List<Integer>> indexMap, boolean queryOnly, ParseResult sql); }
NamedParameterPreparedStatement implements AutoCloseable { public static ParseResult parse(String sql) { return new ParseResult(sql); } NamedParameterPreparedStatement(Connection connection, String query, Map<String, List<Integer>> indexMap, boolean queryOnly, ParseResult sql); static ParseResult parse(String sql); boo...
NamedParameterPreparedStatement implements AutoCloseable { public static ParseResult parse(String sql) { return new ParseResult(sql); } NamedParameterPreparedStatement(Connection connection, String query, Map<String, List<Integer>> indexMap, boolean queryOnly, ParseResult sql); static ParseResult parse(String sql); boo...
@Test public void testExecute() throws SQLException { when(statement.getUpdateCount()).thenReturn(5).thenReturn(2); int result = sqlScriptExecutor.execute(sqlScripts); assertEquals("Return value", 7, result); }
public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get(); }
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
@Test public void testNoChangesButNoDeployedViewsTable() { View sourceView1 = view("View1", select(literal("x")).from(tableRef("a"))); View sourceView2 = view("VIEW2", select(literal("y")).from(tableRef("b"))); View sourceView3 = view("view3", select(literal("z")).from(tableRef("c"))); Schema sourceSchema = schema(sour...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testExecuteFailure() throws Exception { when(statement.execute(sqlScriptOne)).thenThrow(new SQLException()); try { sqlScriptExecutor.execute(sqlScripts); fail("Expected RuntimeSqlException"); } catch (RuntimeSqlException e) { assertTrue("Message", e.getMessage().startsWith("Error executing SQL [" + sq...
public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get(); }
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
@Test public void testExecuteWithScriptAndConnectionParameters() throws SQLException { when(statement.getUpdateCount()).thenReturn(5).thenReturn(2); int result = sqlScriptExecutor.execute(sqlScripts, connection); assertEquals("Return value", 7, result); }
public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get(); }
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
@Test public void testExecuteWithScriptAndConnectionParamatersFailure() throws Exception { when(statement.execute(sqlScriptOne)).thenThrow(new SQLException()); try { sqlScriptExecutor.execute(sqlScripts, connection); fail("Expected RuntimeSqlException"); } catch (RuntimeSqlException e) { assertTrue("Message", e.getMess...
public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get(); }
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
SqlScriptExecutor { public int execute(final Iterable<String> sqlScript) { final Holder<Integer> holder = new Holder<>(-1); doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { holder.set(SqlScriptExecutor.this.executeAndCommit(sqlScript, connection)); } }); return holder.get()...
@Test public void testExecuteAndCommit() throws SQLException { when(statement.getUpdateCount()).thenReturn(5).thenReturn(2); int result = sqlScriptExecutor.executeAndCommit(sqlScripts, connection); assertEquals("Return value", 7, result); verify(connection, times(sqlScripts.size())).commit(); }
public int executeAndCommit(Iterable<String> sqlScript, Connection connection) { int result = 0; try { visitor.executionStart(); for (String sql : sqlScript) { result += executeInternal(sql, connection); connection.commit(); } visitor.executionEnd(); } catch (SQLException e) { throw reclassifiedRuntimeException(e, "Err...
SqlScriptExecutor { public int executeAndCommit(Iterable<String> sqlScript, Connection connection) { int result = 0; try { visitor.executionStart(); for (String sql : sqlScript) { result += executeInternal(sql, connection); connection.commit(); } visitor.executionEnd(); } catch (SQLException e) { throw reclassifiedRunt...
SqlScriptExecutor { public int executeAndCommit(Iterable<String> sqlScript, Connection connection) { int result = 0; try { visitor.executionStart(); for (String sql : sqlScript) { result += executeInternal(sql, connection); connection.commit(); } visitor.executionEnd(); } catch (SQLException e) { throw reclassifiedRunt...
SqlScriptExecutor { public int executeAndCommit(Iterable<String> sqlScript, Connection connection) { int result = 0; try { visitor.executionStart(); for (String sql : sqlScript) { result += executeInternal(sql, connection); connection.commit(); } visitor.executionEnd(); } catch (SQLException e) { throw reclassifiedRunt...
SqlScriptExecutor { public int executeAndCommit(Iterable<String> sqlScript, Connection connection) { int result = 0; try { visitor.executionStart(); for (String sql : sqlScript) { result += executeInternal(sql, connection); connection.commit(); } visitor.executionEnd(); } catch (SQLException e) { throw reclassifiedRunt...
@Test public void testInsertDefaultedDecimalValue() { InsertStatementDefaulter defaulter = new InsertStatementDefaulter(schema); InsertStatement statement = insert().into(new TableReference("Car")).values(new FieldLiteral("bob").as("name")).build(); statement = defaulter.defaultMissingFields(statement); assertEquals("F...
public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
@Test public void testInsertDefaultedStringValue() { InsertStatementDefaulter defaulter = new InsertStatementDefaulter(schema); InsertStatement statement = insert().into(new TableReference("Car")).values(new FieldLiteral(1.0).as("engineCapacity")).build(); statement = defaulter.defaultMissingFields(statement); assertEq...
public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
@Test public void testInsertDefaultedVersion() { InsertStatementDefaulter defaulter = new InsertStatementDefaulter(schema); InsertStatement statement = insert().into(new TableReference("Car")).values(new FieldLiteral("bob").as("name")).build(); statement = defaulter.defaultMissingFields(statement); assertEquals("Field ...
public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
@Test public void testFrom() { InsertStatementDefaulter defaulter = new InsertStatementDefaulter(schema); InsertStatement statement = insert().into(new TableReference("Test")).from(new TableReference("Other")).build(); statement = defaulter.defaultMissingFields(statement); assertEquals("Field default size", 4, statemen...
public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } }
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
InsertStatementDefaulter { public InsertStatement defaultMissingFields(InsertStatement statement) { if (statement.isParameterisedInsert()) { return statement; } Set<String> columnsWithValues = getColumnsWithValues(statement); return addColumnDefaults(statement, columnsWithValues); } protected InsertStatementDefaulter(...
@Test public void testToString(){ String[] keys = {"one", "two", "three"}; ResultSetMismatch unitUnderTest = new ResultSetMismatch(MismatchType.MISSING_LEFT, 3, "left", "rightValue", keys); String expectedString = "Row key:[one, two, three] Type:[MISSING_LEFT] Column:[3] Values:[left <> rightValue]"; assertEquals(expec...
@Override public String toString(){ StringBuilder mismatchDetails = new StringBuilder(); if (key.length > 0) { mismatchDetails.append("Row key:").append(Arrays.toString(key)).append(" "); } mismatchDetails.append("Type:[").append(mismatchType) .append("] Column:[").append(mismatchColumnIndex); mismatchDetails.append("]...
ResultSetMismatch { @Override public String toString(){ StringBuilder mismatchDetails = new StringBuilder(); if (key.length > 0) { mismatchDetails.append("Row key:").append(Arrays.toString(key)).append(" "); } mismatchDetails.append("Type:[").append(mismatchType) .append("] Column:[").append(mismatchColumnIndex); misma...
ResultSetMismatch { @Override public String toString(){ StringBuilder mismatchDetails = new StringBuilder(); if (key.length > 0) { mismatchDetails.append("Row key:").append(Arrays.toString(key)).append(" "); } mismatchDetails.append("Type:[").append(mismatchType) .append("] Column:[").append(mismatchColumnIndex); misma...
ResultSetMismatch { @Override public String toString(){ StringBuilder mismatchDetails = new StringBuilder(); if (key.length > 0) { mismatchDetails.append("Row key:").append(Arrays.toString(key)).append(" "); } mismatchDetails.append("Type:[").append(mismatchType) .append("] Column:[").append(mismatchColumnIndex); misma...
ResultSetMismatch { @Override public String toString(){ StringBuilder mismatchDetails = new StringBuilder(); if (key.length > 0) { mismatchDetails.append("Row key:").append(Arrays.toString(key)).append(" "); } mismatchDetails.append("Type:[").append(mismatchType) .append("] Column:[").append(mismatchColumnIndex); misma...
@Test public void testNoChangesButEmptyDeployedViewsTable() { View sourceView1 = view("View1", select(literal("x")).from(tableRef("a"))); View sourceView2 = view("VIEW2", select(literal("y")).from(tableRef("b"))); Schema sourceSchema = schema(sourceView1, sourceView2); View targetView1 = view("VIEW1", select(literal("x...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testDropUnwantedViews() { View sourceView1 = view("View1", select(literal("x")).from(tableRef("a"))); View sourceView2 = view("VIEW2", select(literal("y")).from(tableRef("b"))); View sourceViewOld1= view("Old1", select(literal("z")).from(tableRef("c"))); View sourceViewOld2= view("Old2", select(litera...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testDeployMissingViews() { View sourceView1 = view("View1", select(literal("x")).from(tableRef("a"))); View sourceView2 = view("VIEW2", select(literal("y")).from(tableRef("b"))); Schema sourceSchema = schema(sourceView1, sourceView2); View targetView1 = view("VIEW1", select(literal("x")).from(tableRef...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testGetSchemaMethods() throws URISyntaxException { final SpreadsheetDataSetProducer producer = produceTestSpreadsheet(); try { producer.getSchema().getTable("Name"); fail("Exception should have been thrown"); } catch (UnsupportedOperationException e) { } try { producer.getSchema().tables(); fail("Exce...
@Override public Schema getSchema() { return new Schema() { @Override public Table getTable(String name) { throw new UnsupportedOperationException("Cannot get the metadata of a table for a spreadsheet"); } @Override public boolean isEmptyDatabase() { return tables.isEmpty(); } @Override public boolean tableExists(Strin...
SpreadsheetDataSetProducer implements DataSetProducer { @Override public Schema getSchema() { return new Schema() { @Override public Table getTable(String name) { throw new UnsupportedOperationException("Cannot get the metadata of a table for a spreadsheet"); } @Override public boolean isEmptyDatabase() { return tables...
SpreadsheetDataSetProducer implements DataSetProducer { @Override public Schema getSchema() { return new Schema() { @Override public Table getTable(String name) { throw new UnsupportedOperationException("Cannot get the metadata of a table for a spreadsheet"); } @Override public boolean isEmptyDatabase() { return tables...
SpreadsheetDataSetProducer implements DataSetProducer { @Override public Schema getSchema() { return new Schema() { @Override public Table getTable(String name) { throw new UnsupportedOperationException("Cannot get the metadata of a table for a spreadsheet"); } @Override public boolean isEmptyDatabase() { return tables...
SpreadsheetDataSetProducer implements DataSetProducer { @Override public Schema getSchema() { return new Schema() { @Override public Table getTable(String name) { throw new UnsupportedOperationException("Cannot get the metadata of a table for a spreadsheet"); } @Override public boolean isEmptyDatabase() { return tables...
@Test public void testDeployMissingViewsAndCleanUpOrphanedDeployedViewsRecord() { View sourceView1 = view("View1", select(literal("x")).from(tableRef("a"))); View sourceView2 = view("VIEW2", select(literal("y")).from(tableRef("b"))); Schema sourceSchema = schema(sourceView1, sourceView2); View targetView1 = view("VIEW1...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testMismatchedHash() { View sourceView1 = view("View1", select(literal("x")).from(tableRef("a"))); View sourceView2 = view("VIEW2", select(literal("y")).from(tableRef("b"))); View sourceView3 = view("view3", select(literal("z")).from(tableRef("c"))); Schema sourceSchema = schema(sourceView1, sourceVie...
public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSchema.views()); Optional<Map<...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
ExistingViewStateLoader { public Result viewChanges(Schema sourceSchema, Schema targetSchema) { Map<String, View> viewsToDrop = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (View view : sourceSchema.views()) { viewsToDrop.put(view.getName().toUpperCase(), view); } Set<View> viewsToDeploy = new HashSet<>(targetSche...
@Test public void testRemovingColumn() { Schema testSchema = schema(appleTable); Schema updatedSchema = removeColumn.apply(testSchema); Table resultTable = updatedSchema.getTable("Apple"); assertNotNull(resultTable); assertEquals("Post upgrade column count", 3, resultTable.columns().size()); assertEquals("Post upgrade ...
@Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundColumn = true; continue; } columns.add(c...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
@Test public void testRemovePrimaryKey() { Schema testSchema = schema(appleTable); RemoveColumn removeIdColumn = new RemoveColumn("Apple", column("id", DataType.BIG_INTEGER).primaryKey()); Schema updatedSchema = removeIdColumn.apply(testSchema); Table resultTable = updatedSchema.getTable("Apple"); assertNotNull(resultT...
@Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundColumn = true; continue; } columns.add(c...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
@Test public void testReverseAddingColumn() { appleTable.columns().remove(3); Schema testSchema = schema(appleTable); Schema downGradedSchema = removeColumn.reverse(testSchema); Table resultTable = downGradedSchema.getTable("Apple"); assertNotNull(resultTable); assertEquals("Post upgrade column count", 4, resultTable.c...
@Override public Schema reverse(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { columns.add(column.getName()); } columns.add(columnDefinition.getName()); return new TableOverrideSchema(schema, new AlteredTable(original, c...
RemoveColumn implements SchemaChange { @Override public Schema reverse(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { columns.add(column.getName()); } columns.add(columnDefinition.getName()); return new TableOverrideSche...
RemoveColumn implements SchemaChange { @Override public Schema reverse(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { columns.add(column.getName()); } columns.add(columnDefinition.getName()); return new TableOverrideSche...
RemoveColumn implements SchemaChange { @Override public Schema reverse(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { columns.add(column.getName()); } columns.add(columnDefinition.getName()); return new TableOverrideSche...
RemoveColumn implements SchemaChange { @Override public Schema reverse(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { columns.add(column.getName()); } columns.add(columnDefinition.getName()); return new TableOverrideSche...
@Test public void testRemovingNonExistantColumn() { Schema testSchema = schema(appleTable); try { removeColumn = new RemoveColumn("Apple", column("foo", DataType.STRING).nullable()); removeColumn.apply(testSchema); fail("Should fail since column is not there"); } catch (Exception e) { } }
@Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundColumn = true; continue; } columns.add(c...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
RemoveColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); boolean foundColumn = false; List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(columnDefinition.getName())) { foundC...
@Test public void testReverseRemovingTable() { Schema testSchema = schema(appleTable, mangoTable); testSchema.tables().remove(appleTable); Schema updatedSchema = removeTable.reverse(testSchema); assertEquals("Post upgrade table count", 2, updatedSchema.tables().size()); assertTrue(updatedSchema.tableExists("Apple")); a...
@Override public Schema reverse(Schema schema) { if(schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot perform reversal for for [" + tableToBeRemoved.getName() + "] table removal as it already exist."); } return new AugmentedSchema(schema, tableToBeRemoved); }
RemoveTable implements SchemaChange { @Override public Schema reverse(Schema schema) { if(schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot perform reversal for for [" + tableToBeRemoved.getName() + "] table removal as it already exist."); } return new AugmentedSc...
RemoveTable implements SchemaChange { @Override public Schema reverse(Schema schema) { if(schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot perform reversal for for [" + tableToBeRemoved.getName() + "] table removal as it already exist."); } return new AugmentedSc...
RemoveTable implements SchemaChange { @Override public Schema reverse(Schema schema) { if(schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot perform reversal for for [" + tableToBeRemoved.getName() + "] table removal as it already exist."); } return new AugmentedSc...
RemoveTable implements SchemaChange { @Override public Schema reverse(Schema schema) { if(schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot perform reversal for for [" + tableToBeRemoved.getName() + "] table removal as it already exist."); } return new AugmentedSc...
@Test public void testRemovingNonExistantIndex() { Schema testSchema = schema(appleTable); try { Table table = table("Orange").columns( column("colour", DataType.STRING, 10).nullable(), column("totalValue", DataType.STRING, 10).nullable() ); removeTable = new RemoveTable(table); removeTable.apply(testSchema); fail("Sho...
@Override public Schema apply(Schema schema) { if(!schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot remove table [" + tableToBeRemoved.getName() + "] as it does not exist."); } return new FilteredSchema(schema, tableToBeRemoved.getName()); }
RemoveTable implements SchemaChange { @Override public Schema apply(Schema schema) { if(!schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot remove table [" + tableToBeRemoved.getName() + "] as it does not exist."); } return new FilteredSchema(schema, tableToBeRemov...
RemoveTable implements SchemaChange { @Override public Schema apply(Schema schema) { if(!schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot remove table [" + tableToBeRemoved.getName() + "] as it does not exist."); } return new FilteredSchema(schema, tableToBeRemov...
RemoveTable implements SchemaChange { @Override public Schema apply(Schema schema) { if(!schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot remove table [" + tableToBeRemoved.getName() + "] as it does not exist."); } return new FilteredSchema(schema, tableToBeRemov...
RemoveTable implements SchemaChange { @Override public Schema apply(Schema schema) { if(!schema.tableExists(tableToBeRemoved.getName().toUpperCase())){ throw new IllegalArgumentException("Cannot remove table [" + tableToBeRemoved.getName() + "] as it does not exist."); } return new FilteredSchema(schema, tableToBeRemov...
@Test public void testApplyDoesNotChangeSchema() { Schema testSchema = schema(appleTable); AnalyseTable analyseTable = new AnalyseTable("Apple"); Schema updatedSchema = analyseTable.apply(testSchema); Table resultTable = updatedSchema.getTable("Apple"); assertNotNull(resultTable); assertEquals("Post upgrade column coun...
@Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; }
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } }
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } AnalyseTable(String tableName); }
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } AnalyseTable(String tableName); @Override void accept(SchemaC...
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } AnalyseTable(String tableName); @Override void accept(SchemaC...
@Test(expected = IllegalArgumentException.class) public void testAnalyseNonExistentTable() { Schema testSchema = schema(appleTable); AnalyseTable analyseTable = new AnalyseTable("Pear"); analyseTable.apply(testSchema); }
@Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; }
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } }
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } AnalyseTable(String tableName); }
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } AnalyseTable(String tableName); @Override void accept(SchemaC...
AnalyseTable implements SchemaChange { @Override public Schema apply(Schema schema) { if (!schema.tableExists(tableName.toUpperCase())) { throw new IllegalArgumentException("Cannot analyse table [" + tableName + "] as it does not exist."); } return schema; } AnalyseTable(String tableName); @Override void accept(SchemaC...
@Test public void testIgnoreTable() { final MockTableOutputter outputter = new MockTableOutputter(); final SpreadsheetDataSetConsumer consumer = new SpreadsheetDataSetConsumer( mock(OutputStream.class), Optional.<Map<String, Integer>>of(ImmutableMap.of("COMPANY", 5)), outputter ); consumer.table(table("NotCompany"), NO...
@Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [" + table.getName() + "] excluded in configuration." ); ...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
@Test public void testSqlOrderingWhenEmpty() { Set<UpgradeScriptAddition> upgradeScriptAdditions = Collections.emptySet(); UpgradePath path = new UpgradePath(upgradeScriptAdditions, sqlDialect, ImmutableList.of("INIT1", "INIT2"), ImmutableList.of("FIN1", "FIN2")); List<String> sql = path.getSql(); assertEquals("Result"...
public List<String> getSql() { List<String> results = Lists.newLinkedList(); if (!sql.isEmpty() || !upgradeScriptAdditions.isEmpty()) results.addAll(initialisationSql); results.addAll(sql); for (UpgradeScriptAddition addition : upgradeScriptAdditions) { Iterables.addAll(results, addition.sql()); } if (!results.isEmpty(...
UpgradePath implements SqlStatementWriter { public List<String> getSql() { List<String> results = Lists.newLinkedList(); if (!sql.isEmpty() || !upgradeScriptAdditions.isEmpty()) results.addAll(initialisationSql); results.addAll(sql); for (UpgradeScriptAddition addition : upgradeScriptAdditions) { Iterables.addAll(resul...
UpgradePath implements SqlStatementWriter { public List<String> getSql() { List<String> results = Lists.newLinkedList(); if (!sql.isEmpty() || !upgradeScriptAdditions.isEmpty()) results.addAll(initialisationSql); results.addAll(sql); for (UpgradeScriptAddition addition : upgradeScriptAdditions) { Iterables.addAll(resul...
UpgradePath implements SqlStatementWriter { public List<String> getSql() { List<String> results = Lists.newLinkedList(); if (!sql.isEmpty() || !upgradeScriptAdditions.isEmpty()) results.addAll(initialisationSql); results.addAll(sql); for (UpgradeScriptAddition addition : upgradeScriptAdditions) { Iterables.addAll(resul...
UpgradePath implements SqlStatementWriter { public List<String> getSql() { List<String> results = Lists.newLinkedList(); if (!sql.isEmpty() || !upgradeScriptAdditions.isEmpty()) results.addAll(initialisationSql); results.addAll(sql); for (UpgradeScriptAddition addition : upgradeScriptAdditions) { Iterables.addAll(resul...
@Test public void testAddCommentsToDropUpgradeStatusTable() { UpgradePath path = factory.create(ImmutableList.of(mock(UpgradeStep.class)), sqlDialect); path.writeSql(ImmutableList.of("ABC", "DEF")); when(sqlDialect.dropStatements(any(Table.class))).thenReturn(Arrays.asList("FLUSH UPGRADE TABLE","DROP UPGRADE TABLE")); ...
private void addCommentsToDropUpgradeStatusTable(final StringBuilder sqlOutput) { String separator = System.getProperty("line.separator"); sqlOutput.append("-- WARNING - This upgrade step creates a temporary table " + UpgradeStatusTableService.UPGRADE_STATUS + "." + separator); sqlOutput.append("-- WARNING - If the upg...
UpgradePath implements SqlStatementWriter { private void addCommentsToDropUpgradeStatusTable(final StringBuilder sqlOutput) { String separator = System.getProperty("line.separator"); sqlOutput.append("-- WARNING - This upgrade step creates a temporary table " + UpgradeStatusTableService.UPGRADE_STATUS + "." + separator...
UpgradePath implements SqlStatementWriter { private void addCommentsToDropUpgradeStatusTable(final StringBuilder sqlOutput) { String separator = System.getProperty("line.separator"); sqlOutput.append("-- WARNING - This upgrade step creates a temporary table " + UpgradeStatusTableService.UPGRADE_STATUS + "." + separator...
UpgradePath implements SqlStatementWriter { private void addCommentsToDropUpgradeStatusTable(final StringBuilder sqlOutput) { String separator = System.getProperty("line.separator"); sqlOutput.append("-- WARNING - This upgrade step creates a temporary table " + UpgradeStatusTableService.UPGRADE_STATUS + "." + separator...
UpgradePath implements SqlStatementWriter { private void addCommentsToDropUpgradeStatusTable(final StringBuilder sqlOutput) { String separator = System.getProperty("line.separator"); sqlOutput.append("-- WARNING - This upgrade step creates a temporary table " + UpgradeStatusTableService.UPGRADE_STATUS + "." + separator...
@Test public void testUpgrade() throws SQLException { Table upgradeAudit = upgradeAudit(); Table car = originalCar(); Table driver = table("Driver") .columns( idColumn(), versionColumn(), column("name", DataType.STRING, 10).nullable(), column("address", DataType.STRING, 10).nullable() ); Table carUpgraded = upgradedCar...
@Inject Upgrade(ConnectionResources connectionResources, DataSource dataSource, UpgradePathFactory factory, UpgradeStatusTableService upgradeStatusTableService) { super(); this.connectionResources = connectionResources; this.dataSource = dataSource; this.factory = factory; this.upgradeStatusTableService = upgradeStatus...
Upgrade { @Inject Upgrade(ConnectionResources connectionResources, DataSource dataSource, UpgradePathFactory factory, UpgradeStatusTableService upgradeStatusTableService) { super(); this.connectionResources = connectionResources; this.dataSource = dataSource; this.factory = factory; this.upgradeStatusTableService = upg...
Upgrade { @Inject Upgrade(ConnectionResources connectionResources, DataSource dataSource, UpgradePathFactory factory, UpgradeStatusTableService upgradeStatusTableService) { super(); this.connectionResources = connectionResources; this.dataSource = dataSource; this.factory = factory; this.upgradeStatusTableService = upg...
Upgrade { @Inject Upgrade(ConnectionResources connectionResources, DataSource dataSource, UpgradePathFactory factory, UpgradeStatusTableService upgradeStatusTableService) { super(); this.connectionResources = connectionResources; this.dataSource = dataSource; this.factory = factory; this.upgradeStatusTableService = upg...
Upgrade { @Inject Upgrade(ConnectionResources connectionResources, DataSource dataSource, UpgradePathFactory factory, UpgradeStatusTableService upgradeStatusTableService) { super(); this.connectionResources = connectionResources; this.dataSource = dataSource; this.factory = factory; this.upgradeStatusTableService = upg...
@Test public void testUpgradeWithTriggerMessage() throws SQLException { ResultSet viewResultSet = mock(ResultSet.class); when(viewResultSet.next()).thenReturn(true, true, false); when(viewResultSet.getString(1)).thenReturn("FooView", "OldView"); when(viewResultSet.getString(2)).thenReturn("XXX"); ResultSet upgradeResul...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithNoStepsToApply() { Table upgradeAudit = upgradeAudit(); Schema targetSchema = schema(upgradeAudit); Collection<Class<? extends UpgradeStep>> upgradeSteps = new ArrayList<>(); ConnectionResources mockConnectionResources = mock(ConnectionResources.class, RETURNS_DEEP_STUBS); SchemaResourc...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithOnlyViewsToDeploy() { Table upgradeAudit = upgradeAudit(); View testView = view("FooView", select(field("name")).from(tableRef("Foo"))); Schema sourceSchema = schema(upgradeAudit); Schema targetSchema = schema( schema(upgradeAudit), schema(testView) ); Collection<Class<? extends Upgrade...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithChangedViewsToDeploy() { Table upgradeAudit = upgradeAudit(); View otherView = view("OldView", select(field("name")).from(tableRef("Old"))); View testView = view("FooView", select(field("name")).from(tableRef("Foo"))); Schema sourceSchema = schema( schema(upgradeAudit), schema(otherView...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithUpgradeStepsAndViewDeclaredButNotPresent() throws SQLException { View testView = view("FooView", select(field("name")).from(tableRef("Foo"))); Schema sourceSchema = schema( schema(upgradeAudit(), deployedViews(), originalCar()) ); Schema targetSchema = schema( schema(upgradeAudit(), dep...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithUpgradeStepsAndViewDeclared() throws SQLException { View testView = view("FooView", select(field("name")).from(tableRef("Foo"))); Schema sourceSchema = schema( schema(upgradeAudit(), deployedViews(), originalCar()), schema(testView) ); Schema targetSchema = schema( schema(upgradeAudit()...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithViewDeclaredButNotPresent() throws SQLException { Table upgradeAudit = upgradeAudit(); Table deployedViews = deployedViews(); View testView = view("FooView", select(field("name")).from(tableRef("Foo"))); Schema sourceSchema = schema( schema(upgradeAudit, deployedViews) ); Schema targetS...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUnsupportedColumns() { TableOutputter outputter = mock(TableOutputter.class); final SpreadsheetDataSetConsumer consumer = new SpreadsheetDataSetConsumer( mock(OutputStream.class), Optional.<Map<String, Integer>>empty(), outputter ); Table one = table("one"); Table two = table("two"); when(outputte...
@Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [" + table.getName() + "] excluded in configuration." ); ...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
SpreadsheetDataSetConsumer implements DataSetConsumer { @Override public void table(Table table, Iterable<Record> records) { Integer maxSampleRows = DEFAULT_SAMPLE_ROWS; if (rowsPerTable.isPresent()) { maxSampleRows = rowsPerTable.get().get(table.getName().toUpperCase()); } if (maxSampleRows == null) { log.info("File [...
@Test public void testUpgradeWithOnlyViewsToDeployWithExistingDeployedViews() { Table upgradeAudit = upgradeAudit(); Table deployedViews = table("DeployedViews").columns(column("name", DataType.STRING, 30), column("hash", DataType.STRING, 64)); View testView = view("FooView", select(field("name")).from(tableRef("Foo"))...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithToDeployAndNewDeployedViews() throws SQLException { Table upgradeAudit = upgradeAudit(); Table deployedViews = deployedViews(); View otherView = view("OldView", select(field("name")).from(tableRef("Old"))); View testView = view("FooView", select(field("name")).from(tableRef("Foo"))); Vi...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testUpgradeWithStepsToApplyRebuildTriggers() throws SQLException { Schema sourceSchema = schema( schema(upgradeAudit(), deployedViews(), originalCar()) ); Schema targetSchema = schema( schema(upgradeAudit(), deployedViews(), upgradedCar()) ); Collection<Class<? extends UpgradeStep>> upgradeSteps = Imm...
public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeStatus.NONE) ...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
Upgrade { public UpgradePath findPath(Schema targetSchema, Collection<Class<? extends UpgradeStep>> upgradeSteps, Collection<String> exceptionRegexes) { final List<String> upgradeStatements = new ArrayList<>(); UpgradeStatus status = upgradeStatusTableService.getStatus(Optional.of(dataSource)); if (status != UpgradeSta...
@Test public void testAddingColumn() { Schema testSchema = schema(appleTable); Schema updatedSchema = addColumn.apply(testSchema); Table resultTable = updatedSchema.getTable("Apple"); assertNotNull(resultTable); assertEquals("Post upgrade column count", 4, resultTable.columns().size()); assertEquals("Post upgrade exist...
@Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(newColumnDefinition.getName())) { throw new IllegalStateException("Column [" + newColumnDefinition.getNam...
AddColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(newColumnDefinition.getName())) { throw new IllegalStateException("Co...
AddColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(newColumnDefinition.getName())) { throw new IllegalStateException("Co...
AddColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(newColumnDefinition.getName())) { throw new IllegalStateException("Co...
AddColumn implements SchemaChange { @Override public Schema apply(Schema schema) { Table original = schema.getTable(tableName); List<String> columns = new ArrayList<>(); for (Column column : original.columns()) { if (column.getName().equalsIgnoreCase(newColumnDefinition.getName())) { throw new IllegalStateException("Co...