use of org.voltdb.catalog.Cluster in project voltdb by VoltDB.
the class TestCatalogUtil method testClusterSchemaSetting.
public void testClusterSchemaSetting() throws Exception {
final String defSchema = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + " <cluster hostcount='3' kfactor='1' sitesperhost='2'/>" + "</deployment>";
final String catalogSchema = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + " <cluster hostcount='3' kfactor='1' sitesperhost='2' schema='catalog'/>" + "</deployment>";
final String adhocSchema = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + " <cluster hostcount='3' kfactor='1' sitesperhost='2' schema='ddl'/>" + "</deployment>";
final File tmpDefSchema = VoltProjectBuilder.writeStringToTempFile(defSchema);
CatalogUtil.compileDeployment(catalog, tmpDefSchema.getPath(), false);
Cluster cluster = catalog.getClusters().get("cluster");
assertTrue(cluster.getUseddlschema());
setUp();
final File tmpCatalogSchema = VoltProjectBuilder.writeStringToTempFile(catalogSchema);
CatalogUtil.compileDeployment(catalog, tmpCatalogSchema.getPath(), false);
cluster = catalog.getClusters().get("cluster");
assertFalse(cluster.getUseddlschema());
setUp();
final File tmpAdhocSchema = VoltProjectBuilder.writeStringToTempFile(adhocSchema);
CatalogUtil.compileDeployment(catalog, tmpAdhocSchema.getPath(), false);
cluster = catalog.getClusters().get("cluster");
assertTrue(cluster.getUseddlschema());
}
Aggregations