ALF-10771: DiffContext is now passed around to provide the DB Dialect.

Instead of the Differences being passed around on their own, the DiffContext is able to provide more information -- at present just the Dialect. The dialect can be used to change the way database objects are validated or differenced.





git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31466 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-10-25 16:03:31 +00:00
parent 4ef52e4e72
commit 9b4cd0ab0e
23 changed files with 183 additions and 76 deletions

View File

@@ -38,6 +38,8 @@ import org.alfresco.util.schemacomp.model.PrimaryKey;
import org.alfresco.util.schemacomp.model.Schema;
import org.alfresco.util.schemacomp.model.Table;
import org.apache.commons.lang.ArrayUtils;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.MySQL5InnoDBDialect;
import org.junit.Before;
import org.junit.Test;
@@ -51,12 +53,14 @@ public class SchemaComparatorTest
private SchemaComparator comparator;
private Schema left;
private Schema right;
private Dialect dialect;
@Before
public void setup()
{
left = new Schema("left_schema");
right = new Schema("right_schema");
dialect = new MySQL5InnoDBDialect();
}
@@ -80,7 +84,7 @@ public class SchemaComparatorTest
right.add(table("table_in_right"));
comparator = new SchemaComparator(left, right);
comparator = new SchemaComparator(left, right, dialect);
comparator.compare();
dumpDiffs(comparator.getDifferences(), true);
@@ -144,7 +148,7 @@ public class SchemaComparatorTest
indexes("sys_random_idx_name id")));
comparator = new SchemaComparator(left, right);
comparator = new SchemaComparator(left, right, dialect);
comparator.compare();
dumpDiffs(comparator.getDifferences(), true);