Search in sources :

Example 16 with DataObjectSchema

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

Example 17 with DataObjectSchema

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

Example 18 with DataObjectSchema

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

Example 19 with DataObjectSchema

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

Example 20 with DataObjectSchema

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());
}
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