use of edu.uci.ics.texera.dataflow.common.PredicateBase in project textdb by TextDB.
the class ProjectAllFieldsPredicateTest method testGenerateOperatorBean.
/**
* Test the generateOperatorBean method.
* Build a SelectAllFieldsPredicate, invoke the generateOperatorBean and check
* whether a PassThroughBean with the right attributes is returned.
*/
@Test
public void testGenerateOperatorBean() {
ProjectAllFieldsPredicate projectAllFieldsPredicate = new ProjectAllFieldsPredicate();
PredicateBase projectionBean;
final String operatorId1 = "xxx";
projectionBean = projectAllFieldsPredicate.generateOperatorBean(operatorId1);
Assert.assertEquals(projectionBean, new PassThroughPredicate(operatorId1));
final String operatorId2 = "y0a9";
projectionBean = projectAllFieldsPredicate.generateOperatorBean(operatorId2);
Assert.assertEquals(projectionBean, new PassThroughPredicate(operatorId2));
}
use of edu.uci.ics.texera.dataflow.common.PredicateBase in project textdb by TextDB.
the class ProjectSomeFieldsPredicateTest method testGenerateOperatorBean00.
/**
* Test the generateOperatorBean method.
* Build a SelectSomeFieldsPredicate, invoke the generateOperatorBean and check
* whether a ProjectionBean with the right attributes is returned.
* An empty list is used as the list of projected fields.
*/
@Test
public void testGenerateOperatorBean00() {
String operatorId = "xxx";
List<String> projectedFields = Collections.emptyList();
ProjectSomeFieldsPredicate projectSomeFieldsPredicate = new ProjectSomeFieldsPredicate(projectedFields);
PredicateBase computedProjectionBean = projectSomeFieldsPredicate.generateOperatorBean(operatorId);
PredicateBase expectedProjectionBean = new ProjectionPredicate(Arrays.asList());
expectedProjectionBean.setID(operatorId);
Assert.assertEquals(expectedProjectionBean, computedProjectionBean);
}
Aggregations