Package liquibase.diff

Examples of liquibase.diff.ObjectDifferences$DataTypeCompareFunction


    }

    @Override
    public void checkDiffResult(DiffResult diffResult, AlterSequenceChange change) {
        if (change.getMinValue() != null) {
            ObjectDifferences diff = diffResult.getChangedObject(new Sequence(change.getCatalogName(), change.getSchemaName(), change.getSequenceName()));
            assertEquals(change.getMinValue(), diff.getDifference("minValue").getComparedValue());
        }

        if (change.getMaxValue() != null) {
            ObjectDifferences diff = diffResult.getChangedObject(new Sequence(change.getCatalogName(), change.getSchemaName(), change.getSequenceName()));
            assertEquals(change.getMaxValue(), diff.getDifference("maxValue").getComparedValue());
        }

        if (change.getIncrementBy() != null) {
            ObjectDifferences diff = diffResult.getChangedObject(new Sequence(change.getCatalogName(), change.getSchemaName(), change.getSequenceName()));
            assertEquals(change.getIncrementBy(), diff.getDifference("incrementBy").getComparedValue());
        }

        if (change.isOrdered() != null) {
            ObjectDifferences diff = diffResult.getChangedObject(new Sequence(change.getCatalogName(), change.getSchemaName(), change.getSequenceName()));
            assertEquals(change.isOrdered(), diff.getDifference("ordered").getComparedValue());
        }
    }
View Full Code Here


    }

    @Override
    public void checkDiffResult(DiffResult diffResult, AddAutoIncrementChange change) {
        Column example = new Column().setName(change.getColumnName()).setRelation(new Table().setName(change.getTableName()).setSchema(new Schema(change.getCatalogName(), change.getSchemaName())));
        ObjectDifferences changes = diffResult.getChangedObject(example);
        assertNotNull(changes);
        assertNull(changes.getDifference("autoIncrementInformation").getReferenceValue());
        assertNotNull(changes.getDifference("autoIncrementInformation").getComparedValue());

        assertNull(changes.getDifference("dataType"));
    }
View Full Code Here

    @Override
    public void checkDiffResult(DiffResult diffResult, AddDefaultValueChange change) {
        Column example = new Column().setName(change.getColumnName()).setRelation(new Table().setName(change.getTableName()).setSchema(new Schema(change.getCatalogName(), change.getSchemaName())));

        ObjectDifferences diff = diffResult.getChangedObject(example);
        assertNotNull(diff);
        assertNotNull(diff.getDifference("defaultValue"));
        assertNull(diff.getDifference("defaultValue").getReferenceValue());
        assertNotNull(diff.getDifference("defaultValue").getComparedValue());
    }
View Full Code Here

    }

    @Override
    public void checkDiffResult(DiffResult diffResult, DropDefaultValueChange change) {
        ObjectDifferences diff = diffResult.getChangedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName()));
        assertNotNull(diff);

        assertNotNull(diff.getDifference("defaultValue").getReferenceValue());
        assertEquals("NULL", diff.getDifference("defaultValue").getComparedValue().toString());

    }
View Full Code Here

        return new Change[] {createTableChange };
    }

    @Override
    public void checkDiffResult(DiffResult diffResult, AddNotNullConstraintChange change) {
        ObjectDifferences diff = diffResult.getChangedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName()));
        assertNotNull(diff);
        assertEquals(true, diff.getDifference("nullable").getReferenceValue());
        assertEquals(false, diff.getDifference("nullable").getComparedValue());
//        assertNull(diff.getDifference("type").toString(), diff.getDifference("type"));

    }
View Full Code Here

        return new Change[] {createTableChange };
    }

    @Override
    public void checkDiffResult(DiffResult diffResult, DropNotNullConstraintChange change) {
        ObjectDifferences diff = diffResult.getChangedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName()));
        assertFalse((Boolean) diff.getDifference("nullable").getReferenceValue());
        assertTrue((Boolean) diff.getDifference("nullable").getComparedValue());
    }
View Full Code Here

    }

    @Override
    public void checkDiffResult(DiffResult diffResult, ModifyDataTypeChange change) {
        ObjectDifferences colDiff = diffResult.getChangedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName()));
        assertNotNull(colDiff);
        assertNotNull(colDiff.getDifference("type"));
//todo        assertEquals(change.getNewDataType(), colDiff.getDifference("type").getComparedValue().toString());
    }
View Full Code Here

TOP

Related Classes of liquibase.diff.ObjectDifferences$DataTypeCompareFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.