use of com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table in project esop by instaclustr.
the class ManifestComponentsTest method testTableEquality.
@Test
public void testTableEquality() throws Exception {
Manifest manifest = parseManifest();
Snapshot snapshot = manifest.getSnapshot();
Keyspace keyspace = snapshot.getKeyspace("ks1").orElseThrow(IllegalStateException::new);
Table table = keyspace.getTable("ks1t1").orElseThrow(IllegalStateException::new);
Table cloned = table.clone();
assertNotSame(table, cloned);
assertEquals(table, cloned);
cloned.add("me-1-big-Data.db", new ManifestEntry(Paths.get("abc/def"), null, Type.FILE, 50, null, null));
assertNotEquals(table, cloned);
}
use of com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table in project esop by instaclustr.
the class ManifestComponentsTest method testSnapshotEquality.
@Test
public void testSnapshotEquality() throws Exception {
Manifest manifest = parseManifest();
Snapshot snapshot = manifest.getSnapshot();
Snapshot cloned = snapshot.clone();
assertNotSame(cloned, snapshot);
assertEquals(cloned, snapshot);
Keyspace ks = new Keyspace(new HashMap<>());
Table tb = snapshot.getTable("ks1", "ks1t2").orElseThrow(IllegalStateException::new);
ks.add("t100", tb);
cloned.add("k100", ks);
assertNotEquals(snapshot, cloned);
}
use of com.instaclustr.esop.impl.Snapshots.Snapshot.Keyspace.Table in project esop by instaclustr.
the class ManifestComponentsTest method testSchemaParsing.
@Test
public void testSchemaParsing() throws Exception {
Manifest manifest = parseManifest();
Table t1 = manifest.getSnapshot().getKeyspace("ks1").get().getTable("ks1t1").get();
Table t2 = manifest.getSnapshot().getKeyspace("ks1").get().getTable("ks1t1").get();
assertTrue(t1.schemaEqualsTo(t2.getSchemaContent()));
assertTrue(t1.schemaEqualsTo(t2));
}
Aggregations