public class TestEvalString extends TestCase {
@Test
public void testUPPER() throws Exception {
UPPER func = new UPPER();
// test excution
String data = "Hello World!";
String expected = "HELLO WORLD!";
DataAtom field = new DataAtom(data);
Tuple input = new Tuple(field);
DataAtom output = new DataAtom();
func.exec(input, output);
assertTrue(output.strval().equals(expected));
// test schema creation
String fieldName = "field1";
AtomSchema fieldSchema = new AtomSchema(fieldName);
TupleSchema tupleSchema = new TupleSchema();
tupleSchema.add(fieldSchema, false);
Schema outSchema = func.outputSchema(tupleSchema);
assertTrue(outSchema.toString().equals("upper_" + fieldName));
}