use of com.emc.storageos.db.common.schema.DataObjectSchema 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.schema.DataObjectSchema 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.schema.DataObjectSchema 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.schema.DataObjectSchema 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());
}
use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testRemovedFieldAnnotation.
@Test
public void testRemovedFieldAnnotation() {
tgtSchema = new DataObjectSchema(RemovedFieldAnnotation.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
}
Aggregations