SelectStatement extends Statement { @Override public List<String> getInputViews(){ return Arrays.asList(this.fromClause); } SelectStatement();  SelectStatement(String id, ProjectPredicate projectPredicate, ExtractPredicate extractPredicate,
            String fromClause, Integer limitClause, Integer offsetClause); ProjectPredicate getProjectPredicate(); void setProjectPredicate(ProjectPredicate projectPredicate); ExtractPredicate getExtractPredicate(); void setExtractPredicate(ExtractPredicate extractPredicate); String getFromClause(); void setFromClause(String fromClause); Integer getLimitClause(); void setLimitClause(Integer limitClause); Integer getOffsetClause(); void setOffsetClause(Integer offsetClause); @Override String getInputNodeID(); @Override String getOutputNodeID(); @Override List<PredicateBase> getInternalOperatorBeans(); @Override List<OperatorLink> getInternalLinkBeans(); @Override List<String> getInputViews(); @Override boolean equals(Object other);  }
@Test public void testSelectStatementBeansBuilder00() { SelectStatement selectStatement = new SelectStatement("id", null, null, "tableX", null, null); List<PredicateBase> expectedGeneratedBeans = Collections.emptyList(); List<String> dependencies = Arrays.asList("tableX"); Assert.assertEquals(selectStatement.getInputViews(), dependencies); StatementTestUtils.assertGeneratedBeans(selectStatement, expectedGeneratedBeans); }
@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); }
@Test public void testSelectStatementBeansBuilder02() { ProjectPredicate projectPredicate = new ProjectSomeFieldsPredicate(Arrays.asList("a", "b")); SelectStatement selectStatement = new SelectStatement("idX", projectPredicate, null, "from", null, null); List<PredicateBase> expectedGeneratedBeans = Arrays.asList( new ProjectionPredicate(Arrays.asList("a", "b")) ); List<String> dependencies = Arrays.asList("from"); Assert.assertEquals(selectStatement.getInputViews(), dependencies); StatementTestUtils.assertGeneratedBeans(selectStatement, expectedGeneratedBeans); }
@Test public void testSelectStatementBeansBuilder03() { ExtractPredicate extractPredicate = new KeywordExtractPredicate(Arrays.asList("c", "d"), "word", KeywordMatchingType.SUBSTRING_SCANBASED.toString()); SelectStatement selectStatement = new SelectStatement("id", null, extractPredicate, "TableP9", null, null); List<PredicateBase> expectedGeneratedBeans = Arrays.asList( new KeywordPredicate("word", Arrays.asList("c", "d"), null, KeywordMatchingType.SUBSTRING_SCANBASED, "id_e") ); List<String> dependencies = Arrays.asList("TableP9"); Assert.assertEquals(selectStatement.getInputViews(), dependencies); StatementTestUtils.assertGeneratedBeans(selectStatement, expectedGeneratedBeans); }
@Test public void testSelectStatementBeansBuilder04() { ProjectPredicate projectPredicate = new ProjectAllFieldsPredicate(); ExtractPredicate extractPredicate = new KeywordExtractPredicate(Arrays.asList("f1"), "keyword", KeywordMatchingType.CONJUNCTION_INDEXBASED.toString()); SelectStatement selectStatement = new SelectStatement("id", projectPredicate, extractPredicate, "source", null, null); List<PredicateBase> expectedGeneratedBeans = Arrays.asList( new KeywordPredicate("keyword", Arrays.asList("f1"), null, KeywordMatchingType.CONJUNCTION_INDEXBASED, "id_e") ); List<String> dependencies = Arrays.asList("source"); Assert.assertEquals(selectStatement.getInputViews(), dependencies); StatementTestUtils.assertGeneratedBeans(selectStatement, expectedGeneratedBeans); }
@Test public void testSelectStatementBeansBuilder05() { ProjectPredicate projectPredicate = new ProjectSomeFieldsPredicate(Arrays.asList("a", "b")); ExtractPredicate extractPredicate = new KeywordExtractPredicate(Arrays.asList("a", "b"), "x", KeywordMatchingType.SUBSTRING_SCANBASED.toString()); SelectStatement selectStatement = new SelectStatement("_sid4", projectPredicate, extractPredicate, "from", null, null); List<PredicateBase> expectedGeneratedBeans = Arrays.asList( new KeywordPredicate("x", Arrays.asList("a", "b"), null, KeywordMatchingType.SUBSTRING_SCANBASED, "_sid4_e"), new ProjectionPredicate(Arrays.asList("a", "b")) ); List<String> dependencies = Arrays.asList("from"); Assert.assertEquals(selectStatement.getInputViews(), dependencies); StatementTestUtils.assertGeneratedBeans(selectStatement, expectedGeneratedBeans); }