use of edu.uci.ics.textdb.textql.statements.predicates.ProjectSomeFieldsPredicate in project textdb by TextDB.
the class CreateViewStatementTest method testCreateViewStatementBeansBuilder01.
/**
* Test the correctness of the generated beans by a CreateViewStatement with
* a SelectExtractStatement as sub-statement with a
* SelectSomeFieldsPredicate and a KeywordExtractPredicate.
* Get a graph by calling getInternalOperatorBeans() and getInternalLinkBeans()
* methods and check if the generated path form the node getInputNodeID() to
* the node getOutputNodeID() is correct. Also check whether getInputViews()
* is returning the correct dependencies.
*/
@Test
public void testCreateViewStatementBeansBuilder01() {
ProjectPredicate projectPredicate = new ProjectSomeFieldsPredicate(Arrays.asList("x", "y"));
ExtractPredicate extractPredicate = new KeywordExtractPredicate(Arrays.asList("a", "b"), "zzz", KeywordMatchingType.SUBSTRING_SCANBASED.toString());
Statement subStatement = new SelectStatement("id", projectPredicate, extractPredicate, "from", null, null);
CreateViewStatement createViewStatement = new CreateViewStatement("idx", subStatement);
List<PredicateBase> expectedGeneratedBeans = Collections.emptyList();
List<String> dependencies = Arrays.asList(subStatement.getId());
Assert.assertEquals(createViewStatement.getInputViews(), dependencies);
StatementTestUtils.assertGeneratedBeans(createViewStatement, expectedGeneratedBeans);
}
Aggregations