Search in sources :

Example 16 with SelectStatement

use of edu.uci.ics.textdb.textql.statements.SelectStatement in project textdb by TextDB.

the class SelectStatementTest method testSelectStatementBeansBuilder01.

/**
     * Test the correctness of the generated beans by a SelectStatement with a
     * ProjectAllFieldsPredicate.
     * Get a graph by calling getInternalPredicateBases() 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 testSelectStatementBeansBuilder01() {
    ProjectPredicate projectPredicate = new ProjectAllFieldsPredicate();
    SelectStatement selectStatement = new SelectStatement("id", projectPredicate, null, "Table", null, null);
    List<PredicateBase> expectedGeneratedBeans = Collections.emptyList();
    List<String> dependencies = Arrays.asList("Table");
    Assert.assertEquals(selectStatement.getInputViews(), dependencies);
    StatementTestUtils.assertGeneratedBeans(selectStatement, expectedGeneratedBeans);
}
Also used : SelectStatement(edu.uci.ics.textdb.textql.statements.SelectStatement) ProjectPredicate(edu.uci.ics.textdb.textql.statements.predicates.ProjectPredicate) PredicateBase(edu.uci.ics.textdb.exp.common.PredicateBase) ProjectAllFieldsPredicate(edu.uci.ics.textdb.textql.statements.predicates.ProjectAllFieldsPredicate) Test(org.junit.Test)

Aggregations

SelectStatement (edu.uci.ics.textdb.textql.statements.SelectStatement)16 Test (org.junit.Test)16 ProjectPredicate (edu.uci.ics.textdb.textql.statements.predicates.ProjectPredicate)13 ExtractPredicate (edu.uci.ics.textdb.textql.statements.predicates.ExtractPredicate)12 KeywordExtractPredicate (edu.uci.ics.textdb.textql.statements.predicates.KeywordExtractPredicate)12 ProjectSomeFieldsPredicate (edu.uci.ics.textdb.textql.statements.predicates.ProjectSomeFieldsPredicate)11 ProjectAllFieldsPredicate (edu.uci.ics.textdb.textql.statements.predicates.ProjectAllFieldsPredicate)10 PredicateBase (edu.uci.ics.textdb.exp.common.PredicateBase)8 CreateViewStatement (edu.uci.ics.textdb.textql.statements.CreateViewStatement)8 Statement (edu.uci.ics.textdb.textql.statements.Statement)8 TextQLParser (edu.uci.ics.textdb.textql.languageparser.TextQLParser)4 KeywordPredicate (edu.uci.ics.textdb.exp.keywordmatcher.KeywordPredicate)3 ProjectionPredicate (edu.uci.ics.textdb.exp.projection.ProjectionPredicate)2 ParseException (edu.uci.ics.textdb.textql.languageparser.ParseException)1 TokenMgrError (edu.uci.ics.textdb.textql.languageparser.TokenMgrError)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 PipedInputStream (java.io.PipedInputStream)1 PipedOutputStream (java.io.PipedOutputStream)1 PrintStream (java.io.PrintStream)1