@Test public void sameAs() { // We have to assume that two schemas are always the same, regardless of name, // otherwise unless the reference schema has the same name as the target database // all the comparisons will fail - and users can choose to install databases with any schema // name they choose. assertTrue("Schemas should be considered the same", left.sameAs(right)); // Things are always the same as themselves. assertTrue("Schemas are the same physical object", left.sameAs(left)); assertFalse("A table is not the same as a schema", left.sameAs(new Table("left_schema"))); assertFalse("null is not the same as a schema", left.sameAs(null)); }
@Test public void acceptVisitor() { DbObject dbo1 = Mockito.mock(DbObject.class); left.add(dbo1); DbObject dbo2 = Mockito.mock(DbObject.class); left.add(dbo2); DbObject dbo3 = Mockito.mock(DbObject.class); left.add(dbo3); left.accept(visitor); verify(dbo1).accept(visitor); verify(dbo2).accept(visitor); verify(dbo3).accept(visitor); verify(visitor).visit(left); }