use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testGeoNewAnnotationOnNewField.
@Test
public void testGeoNewAnnotationOnNewField() {
DbSchema srcGeoSchema = new DataObjectSchema(GeoClassUT.class);
srcSchemas.addSchema(srcGeoSchema);
tgtSchema = new DataObjectSchema(GeoNewField.class);
tgtSchema.setType(srcSchema.getType());
tgtSchemas.addSchema(tgtSchema);
tgtSchemas.addSchema(srcSchema);
DbSchemasDiff diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
// Adding index on new field of Geo object is allowed
Assert.assertTrue(diff.isUpgradable());
Assert.assertTrue(diff.isChanged());
}
use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class BaseDbSchemaCheckerTest method testCustomMigrationExistingField.
@Test
public void testCustomMigrationExistingField() {
tgtSchema = new DataObjectSchema(CustomMigrationExistingField.class);
tgtSchema.setType(tgtSchema.getType());
tgtSchemas.addSchema(tgtSchema);
diff = new DbSchemasDiff(srcSchemas, tgtSchemas);
Assert.assertTrue(diff.isUpgradable());
Assert.assertFalse(diff.isChanged());
}
use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class BaseDbSchemaCheckerTest method initialize.
@Before
public void initialize() {
srcSchema = new DataObjectSchema(ClassUT.class);
srcSchemas = new DbSchemas();
srcSchemas.addSchema(srcSchema);
tgtSchemas = new DbSchemas();
}
use of com.emc.storageos.db.common.schema.DataObjectSchema in project coprhd-controller by CoprHD.
the class DbSchemaCheckerTest method testNewNotPermittedFieldAnnotation.
@Test
public void testNewNotPermittedFieldAnnotation() {
tgtSchema = new DataObjectSchema(NewNotPermittedFieldAnnotation.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 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());
}
Aggregations