use of com.emc.storageos.db.common.diff.DbSchemasDiff in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testGeoNewAnnotationOnExistingField.
@Test
public void testGeoNewAnnotationOnExistingField() {
DbSchema srcGeoSchema = new DataObjectSchema(GeoClassUT.class);
srcSchemas.addSchema(srcGeoSchema);
tgtSchema = new DataObjectSchema(GeoNewAnnotationOnExistingField.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
tgtSchemas.addSchema(srcSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
// Adding index on existing field of Geo object is not allowed
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
}
use of com.emc.storageos.db.common.diff.DbSchemasDiff in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testDuplicateCF.
@Test
public void testDuplicateCF() {
tgtSchema = new DataObjectSchema(DuplicateCF1.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
srcSchema = new DataObjectSchema(classUT2.class);
srcSchemas.addSchema(srcSchema);
tgtSchema = new DataObjectSchema(DuplicateCF2.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
tgtSchemas.addSchema(srcSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
Assert.assertFalse(diff.getSchemaCT().getDuplicateList().isEmpty());
}
use of com.emc.storageos.db.common.diff.DbSchemasDiff in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testRemoveNamedRelationIndex.
@Test
public void testRemoveNamedRelationIndex() {
srcSchema = new DataObjectSchema(WithNamedRelationIndex.class);
srcSchema.setType(srcSchema.getType());
srcSchemas.addSchema(srcSchema);
tgtSchema = new DataObjectSchema(WithRemovedIndexAnnotation.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
}
use of com.emc.storageos.db.common.diff.DbSchemasDiff in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testNewFieldAnnotation.
@Test
public void testNewFieldAnnotation() {
tgtSchema = new DataObjectSchema(NewFieldAnnotation.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertTrue(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
Assert.assertTrue(diff.getNewClasses().isEmpty());
Assert.assertTrue(diff.getNewFields().isEmpty());
Assert.assertTrue(diff.getNewClassAnnotations().isEmpty());
Assert.assertFalse(diff.getNewFieldAnnotations().isEmpty());
Assert.assertEquals(diff.getNewFieldAnnotations().size(), 1);
Assert.assertTrue(diff.getNewAnnotationValues().isEmpty());
}
use of com.emc.storageos.db.common.diff.DbSchemasDiff in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testRemovedField.
@Test
public void testRemovedField() {
tgtSchema = new DataObjectSchema(RemovedField.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
}
Aggregations