Search in sources :

Example 1 with DbProperty

use of org.alfresco.util.schemacomp.DbProperty in project alfresco-repository by Alfresco.

the class SchemaTest method doDiffTests.

@Override
protected void doDiffTests() {
    // We need to be warned if comparing, for example a version 500 schema with a
    // version 501 schema.
    inOrder.verify(comparisonUtils).compareSimple(new DbProperty(left, "version"), new DbProperty(right, "version"), ctx);
    // In addition to the base class functionality, Schema.diff() compares
    // the DbObjects held in the other schema with its own DbObjects.
    inOrder.verify(comparisonUtils).compareCollections(left.objects, right.objects, ctx);
}
Also used : DbProperty(org.alfresco.util.schemacomp.DbProperty)

Example 2 with DbProperty

use of org.alfresco.util.schemacomp.DbProperty in project alfresco-repository by Alfresco.

the class DbObjectTestBase method canDiffObjects.

@Test
public void canDiffObjects() {
    AbstractDbObject thisObject = getThisObject();
    thisObject.setComparisonUtils(comparisonUtils);
    AbstractDbObject thatObject = getThatObject();
    thatObject.setComparisonUtils(comparisonUtils);
    // Invoke the method under test
    thisObject.diff(thatObject, ctx);
    // The name of the object should be diffed
    inOrder.verify(comparisonUtils).compareSimple(new DbProperty(thisObject, "name"), new DbProperty(thatObject, "name"), ctx);
    // Then the doDiff() method should be processed...
    doDiffTests();
}
Also used : DbProperty(org.alfresco.util.schemacomp.DbProperty) Test(org.junit.Test)

Example 3 with DbProperty

use of org.alfresco.util.schemacomp.DbProperty in project alfresco-repository by Alfresco.

the class IndexTest method doDiffTests.

@Override
protected void doDiffTests() {
    inOrder.verify(comparisonUtils).compareSimpleOrderedLists(new DbProperty(thisIndex, "columnNames"), new DbProperty(thatIndex, "columnNames"), ctx);
    inOrder.verify(comparisonUtils).compareSimple(new DbProperty(thisIndex, "unique"), new DbProperty(thatIndex, "unique"), ctx);
}
Also used : DbProperty(org.alfresco.util.schemacomp.DbProperty)

Example 4 with DbProperty

use of org.alfresco.util.schemacomp.DbProperty in project alfresco-repository by Alfresco.

the class PrimaryKeyTest method doDiffTests.

@Override
protected void doDiffTests() {
    inOrder.verify(comparisonUtils).compareSimpleOrderedLists(new DbProperty(thisPK, "columnNames"), new DbProperty(thatPK, "columnNames"), ctx);
    inOrder.verify(comparisonUtils).compareSimpleOrderedLists(new DbProperty(thisPK, "columnOrders"), new DbProperty(thatPK, "columnOrders"), ctx);
}
Also used : DbProperty(org.alfresco.util.schemacomp.DbProperty)

Example 5 with DbProperty

use of org.alfresco.util.schemacomp.DbProperty in project alfresco-repository by Alfresco.

the class ForeignKey method doDiff.

@Override
protected void doDiff(DbObject right, DiffContext ctx) {
    ForeignKey thatFK = (ForeignKey) right;
    comparisonUtils.compareSimple(new DbProperty(this, "localColumn"), new DbProperty(thatFK, "localColumn"), ctx);
    comparisonUtils.compareSimple(new DbProperty(this, "targetTable"), new DbProperty(thatFK, "targetTable"), ctx);
    comparisonUtils.compareSimple(new DbProperty(this, "targetColumn"), new DbProperty(thatFK, "targetColumn"), ctx);
}
Also used : DbProperty(org.alfresco.util.schemacomp.DbProperty)

Aggregations

DbProperty (org.alfresco.util.schemacomp.DbProperty)17 ValidationResult (org.alfresco.util.schemacomp.ValidationResult)4 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)2 Test (org.junit.Test)2 Column (org.alfresco.util.schemacomp.model.Column)1 Index (org.alfresco.util.schemacomp.model.Index)1 Schema (org.alfresco.util.schemacomp.model.Schema)1 InOrder (org.mockito.InOrder)1