Search in sources :

Example 6 with DataObjectSchema

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

Example 7 with DataObjectSchema

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

Example 8 with DataObjectSchema

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

Example 9 with DataObjectSchema

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

Example 10 with DataObjectSchema

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