public void testMakeWideTableCreate() throws CObjectParseException, IOException {
String json = TestHelpers.readFileToString(this.getClass(), "CObjectCQLGeneratorTestData.js");
CDefinition def = CDefinition.fromJsonString(json);
Subject subject = new Subject(1000);
CQLStatement cql1 = subject.makeWideTableCreate(def, def.getIndexes().get("foreignid"));
CQLStatement expected1 = CQLStatement.make(
"CREATE TABLE \"testspace\".\"testtype7f9bb4e56d3cae5b11c553547cfe5897\" (id timeuuid, shardid bigint, filtered int,data1 varchar,data2 varchar,data3 varchar,instance bigint,type int,foreignid bigint, PRIMARY KEY ((shardid, foreignid),id) );",
TABLE_NAME
);
assertEquals(expected1, cql1);
CQLStatement cql2 = subject.makeWideTableCreate(def, def.getIndexes().get("instance:type"));
CQLStatement expected2 = CQLStatement.make(
"CREATE TABLE \"testspace\".\"testtype6671808f3f51bcc53ddc76d2419c9060\" (id timeuuid, shardid bigint, filtered int,data1 varchar,data2 varchar,data3 varchar,instance bigint,type int,foreignid bigint, PRIMARY KEY ((shardid, instance, type),id) );",
TABLE_NAME
);
assertEquals(expected2, cql2);
CQLStatement cql3 = subject.makeWideTableCreate(def, def.getIndexes().get("foreignid:instance:type"));
CQLStatement expected3 = CQLStatement.make(
"CREATE TABLE \"testspace\".\"testtypef9bf3332bb4ec879849ec43c67776131\" (id timeuuid, shardid bigint, filtered int,data1 varchar,data2 varchar,data3 varchar,instance bigint,type int,foreignid bigint, PRIMARY KEY ((shardid, foreignid, instance, type),id) );",
TABLE_NAME
);
assertEquals(expected3, cql3);
}