Search in sources :

Example 11 with DataObjectSchema

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());
}
Also used : DataObjectSchema(com.emc.storageos.db.common.schema.DataObjectSchema) DbSchema(com.emc.storageos.db.common.schema.DbSchema) DbSchemasDiff(com.emc.storageos.db.common.diff.DbSchemasDiff) Test(org.junit.Test)

Example 12 with DataObjectSchema

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());
}
Also used : DataObjectSchema(com.emc.storageos.db.common.schema.DataObjectSchema) DbSchemasDiff(com.emc.storageos.db.common.diff.DbSchemasDiff) Test(org.junit.Test)

Example 13 with DataObjectSchema

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();
}
Also used : DataObjectSchema(com.emc.storageos.db.common.schema.DataObjectSchema) DbSchemas(com.emc.storageos.db.common.schema.DbSchemas) Before(org.junit.Before)

Example 14 with DataObjectSchema

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());
}
Also used : DataObjectSchema(com.emc.storageos.db.common.schema.DataObjectSchema) DbSchemasDiff(com.emc.storageos.db.common.diff.DbSchemasDiff) Test(org.junit.Test)

Example 15 with DataObjectSchema

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());
}
Also used : DataObjectSchema(com.emc.storageos.db.common.schema.DataObjectSchema) DbSchema(com.emc.storageos.db.common.schema.DbSchema) DbSchemasDiff(com.emc.storageos.db.common.diff.DbSchemasDiff) Test(org.junit.Test)

Aggregations

DataObjectSchema (com.emc.storageos.db.common.schema.DataObjectSchema)23 DbSchemasDiff (com.emc.storageos.db.common.diff.DbSchemasDiff)21 Test (org.junit.Test)21 DbSchema (com.emc.storageos.db.common.schema.DbSchema)6 DbKeyspace (com.emc.storageos.db.client.model.DbKeyspace)1 TimeSeries (com.emc.storageos.db.client.model.TimeSeries)1 TimeSeriesSerializer (com.emc.storageos.db.client.model.TimeSeriesSerializer)1 DataPointSchema (com.emc.storageos.db.common.schema.DataPointSchema)1 DbSchemas (com.emc.storageos.db.common.schema.DbSchemas)1 TimeSeriesSchema (com.emc.storageos.db.common.schema.TimeSeriesSchema)1 Before (org.junit.Before)1