use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testNewClassAnnotationValue.
@Test
public void testNewClassAnnotationValue() {
tgtSchema = new DataObjectSchema(NewClassAnnotationValue.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 testRemovedClassAnnotation.
@Test
public void testRemovedClassAnnotation() {
tgtSchema = new DataObjectSchema(RemovedClassAnnotation.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 testNewClassAnnotation.
@Test
public void testNewClassAnnotation() {
tgtSchema = new DataObjectSchema(NewClassAnnotation.class);
// a little bit of hack
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
// No new class annotation is allowed
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
Assert.assertTrue(diff.getNewClasses().isEmpty());
Assert.assertTrue(diff.getNewFields().isEmpty());
Assert.assertFalse(diff.getNewClassAnnotations().isEmpty());
Assert.assertEquals(diff.getNewClassAnnotations().size(), 1);
Assert.assertTrue(diff.getNewFieldAnnotations().isEmpty());
Assert.assertTrue(diff.getNewAnnotationValues().isEmpty());
}
use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testNewField.
@Test
public void testNewField() {
tgtSchema = new DataObjectSchema(NewField.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.assertFalse(diff.getNewFields().isEmpty());
Assert.assertEquals(diff.getNewFields().size(), 1);
Assert.assertTrue(diff.getNewClassAnnotations().isEmpty());
Assert.assertTrue(diff.getNewFieldAnnotations().isEmpty());
Assert.assertTrue(diff.getNewAnnotationValues().isEmpty());
}
use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testNewFieldType.
@Test
public void testNewFieldType() {
tgtSchema = new DataObjectSchema(NewFieldType.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertFalse(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
}
Aggregations