use of com.datastax.oss.driver.api.core.type.SetType in project java-driver by datastax.
the class UserDefinedTypeListParserTest method should_resolve_set_dependency.
@Test
public void should_resolve_set_dependency() {
UserDefinedTypeParser parser = new UserDefinedTypeParser(new DataTypeCqlNameParser(), context);
Map<CqlIdentifier, UserDefinedType> types = parser.parse(KEYSPACE_ID, mockTypeRow("ks", "a", ImmutableList.of("bs"), ImmutableList.of("frozen<set<frozen<b>>>")), mockTypeRow("ks", "b", ImmutableList.of("i"), ImmutableList.of("int")));
assertThat(types).hasSize(2);
UserDefinedType aType = types.get(CqlIdentifier.fromInternal("a"));
UserDefinedType bType = types.get(CqlIdentifier.fromInternal("b"));
assertThat(((SetType) aType.getFieldTypes().get(0)).getElementType()).isEqualTo(bType);
}
use of com.datastax.oss.driver.api.core.type.SetType in project java-driver by datastax.
the class DataTypeDetachableTest method attaching_set_should_attach_its_element.
@Test
public void attaching_set_should_attach_its_element() {
TupleType tuple = DataTypes.tupleOf(DataTypes.INT);
SetType set = DataTypes.setOf(tuple);
assertThat(tuple.isDetached()).isTrue();
assertThat(set.isDetached()).isTrue();
set.attach(attachmentPoint);
assertThat(tuple.isDetached()).isFalse();
}
Aggregations