use of com.datastax.oss.driver.internal.core.adminrequest.AdminRow in project java-driver by datastax.
the class SchemaParserTestBase method mockTypeRow.
protected static AdminRow mockTypeRow(String keyspace, String name, List<String> fieldNames, List<String> fieldTypes) {
AdminRow row = mock(AdminRow.class);
when(row.getString("keyspace_name")).thenReturn(keyspace);
when(row.getString("type_name")).thenReturn(name);
when(row.getListOfString("field_names")).thenReturn(fieldNames);
when(row.getListOfString("field_types")).thenReturn(fieldTypes);
return row;
}
use of com.datastax.oss.driver.internal.core.adminrequest.AdminRow in project java-driver by datastax.
the class SchemaParserTestBase method mockModernTableRow.
protected static AdminRow mockModernTableRow(String keyspace, String name) {
AdminRow row = mock(AdminRow.class);
when(row.contains("flags")).thenReturn(true);
when(row.contains("table_name")).thenReturn(true);
when(row.getString("keyspace_name")).thenReturn(keyspace);
when(row.getString("table_name")).thenReturn(name);
when(row.getSetOfString("flags")).thenReturn(ImmutableSet.of("compound"));
when(row.isString("caching")).thenReturn(false);
when(row.get("caching", RelationParser.MAP_OF_TEXT_TO_TEXT)).thenReturn(ImmutableMap.of("keys", "ALL", "rows_per_partition", "NONE"));
when(row.get("compaction", RelationParser.MAP_OF_TEXT_TO_TEXT)).thenReturn(ImmutableMap.of("class", "org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy", "mock_option", "1"));
return row;
}
use of com.datastax.oss.driver.internal.core.adminrequest.AdminRow in project java-driver by datastax.
the class SchemaParserTestBase method mockViewRow.
protected static AdminRow mockViewRow(String keyspaceName, String viewName, String baseTableName, boolean includeAllColumns, String whereClause) {
AdminRow row = mock(AdminRow.class);
when(row.getString("keyspace_name")).thenReturn(keyspaceName);
when(row.getString("view_name")).thenReturn(viewName);
when(row.getString("base_table_name")).thenReturn(baseTableName);
when(row.getBoolean("include_all_columns")).thenReturn(includeAllColumns);
when(row.getString("where_clause")).thenReturn(whereClause);
return row;
}
use of com.datastax.oss.driver.internal.core.adminrequest.AdminRow in project java-driver by datastax.
the class SchemaParserTestBase method mockModernColumnRow.
protected static AdminRow mockModernColumnRow(String keyspaceName, String tableName, String name, String kind, String dataType, String clusteringOrder, Integer position) {
AdminRow row = mock(AdminRow.class);
when(row.contains("kind")).thenReturn(true);
when(row.contains("position")).thenReturn(true);
when(row.contains("clustering_order")).thenReturn(true);
when(row.getString("keyspace_name")).thenReturn(keyspaceName);
when(row.getString("table_name")).thenReturn(tableName);
when(row.getString("column_name")).thenReturn(name);
when(row.getString("kind")).thenReturn(kind);
when(row.getString("type")).thenReturn(dataType);
when(row.getInteger("position")).thenReturn(position);
when(row.getString("clustering_order")).thenReturn(clusteringOrder);
return row;
}
use of com.datastax.oss.driver.internal.core.adminrequest.AdminRow in project java-driver by datastax.
the class SchemaParserTestBase method mockModernKeyspaceRow.
protected static AdminRow mockModernKeyspaceRow(String keyspaceName) {
AdminRow row = mock(AdminRow.class);
when(row.getString("keyspace_name")).thenReturn(keyspaceName);
when(row.getBoolean("durable_writes")).thenReturn(true);
when(row.contains("strategy_class")).thenReturn(false);
when(row.getMapOfStringToString("replication")).thenReturn(ImmutableMap.of("class", "org.apache.cassandra.locator.SimpleStrategy", "replication_factor", "1"));
return row;
}
Aggregations