use of edu.uci.ics.texera.api.schema.Attribute in project textdb by TextDB.
the class JsonSerializationTest method testTuple.
@Test
public void testTuple() {
Schema schema = new Schema(Arrays.asList(new Attribute("_id", AttributeType._ID_TYPE), new Attribute("text", AttributeType.TEXT)));
Tuple tuple = new Tuple(schema, Arrays.asList(IDField.newRandomID(), new TextField("tuple test text")));
TestUtils.testJsonSerialization(tuple);
}
use of edu.uci.ics.texera.api.schema.Attribute in project textdb by TextDB.
the class SchemaTest method testGetAttributes.
@Test
public void testGetAttributes() {
List<Attribute> attributes = schema.getAttributes();
Assert.assertEquals(this.attributes.length, attributes.size());
for (Attribute attribute : this.attributes) {
Assert.assertTrue(attributes.contains(attribute));
}
}
use of edu.uci.ics.texera.api.schema.Attribute in project textdb by TextDB.
the class SchemaTest method testAddingNewAttribute.
@Test(expected = UnsupportedOperationException.class)
public void testAddingNewAttribute() {
// Should fail due to immutability
List<Attribute> attributes = schema.getAttributes();
attributes.add(new Attribute("sampleField_3", AttributeType.STRING));
}
Aggregations