use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.
the class StreamTableTypeTest method isStreamStoreValueTableReturnsFalseForOtherStreamStoreTableTypes.
@Test
public void isStreamStoreValueTableReturnsFalseForOtherStreamStoreTableTypes() {
List<StreamTableType> streamTypes = Lists.newArrayList(StreamTableType.METADATA, StreamTableType.INDEX, StreamTableType.HASH);
for (StreamTableType streamType : streamTypes) {
String tableName = streamType.getTableName(TEST_TABLE);
TableReference tableReference = TableReference.create(TEST_NAMESPACE, tableName);
assertFalse(StreamTableType.isStreamStoreValueTable(tableReference));
}
}
use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.
the class StreamTableTypeTest method isStreamStoreValueTableReturnsTrueForTableWithNamespace.
@Test
public void isStreamStoreValueTableReturnsTrueForTableWithNamespace() {
String tableName = StreamTableType.VALUE.getTableName(TEST_TABLE);
TableReference tableReference = TableReference.create(TEST_NAMESPACE, tableName);
assertTrue(StreamTableType.isStreamStoreValueTable(tableReference));
}
use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.
the class StreamTableTypeTest method isStreamStoreValueTableReturnsFalseForTestTable.
@Test
public void isStreamStoreValueTableReturnsFalseForTestTable() {
TableReference tableReference = TableReference.createWithEmptyNamespace(TEST_TABLE);
assertFalse(StreamTableType.isStreamStoreValueTable(tableReference));
}
use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.
the class SchemaTest method testLongTableNameLengthFailsNamespace.
@Test
public void testLongTableNameLengthFailsNamespace() throws IOException {
// If namespace is non-empty, internal table name length is |namespace| + |tableName| + 2
Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.DEFAULT_NAMESPACE);
String longTableName = String.join("", Collections.nCopies(40, "x"));
TableReference tableRef = TableReference.create(Namespace.DEFAULT_NAMESPACE, longTableName);
List<CharacterLimitType> kvsList = new ArrayList<CharacterLimitType>();
kvsList.add(CharacterLimitType.CASSANDRA);
assertThatThrownBy(() -> schema.addTableDefinition(longTableName, getSimpleTableDefinition(tableRef))).isInstanceOf(IllegalArgumentException.class).hasMessage(getErrorMessage(longTableName, kvsList));
}
use of com.palantir.atlasdb.keyvalue.api.TableReference in project atlasdb by palantir.
the class SchemaTest method testLongTableNameLengthFailsBoth.
@Test
public void testLongTableNameLengthFailsBoth() throws IOException {
Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE);
String longTableName = String.join("", Collections.nCopies(1000, "x"));
TableReference tableRef = TableReference.createWithEmptyNamespace(longTableName);
List<CharacterLimitType> kvsList = new ArrayList<CharacterLimitType>();
kvsList.add(CharacterLimitType.CASSANDRA);
kvsList.add(CharacterLimitType.POSTGRES);
assertThatThrownBy(() -> schema.addTableDefinition(longTableName, getSimpleTableDefinition(tableRef))).isInstanceOf(IllegalArgumentException.class).hasMessage(getErrorMessage(longTableName, kvsList));
}
Aggregations