use of org.teiid.query.sql.proc.AssignmentStatement in project teiid by teiid.
the class TestAssignmentStatement method sample2.
public static final AssignmentStatement sample2() {
Query query = new Query();
// $NON-NLS-1$
query.setSelect(new Select(Arrays.asList(new ElementSymbol("x"))));
// $NON-NLS-1$
query.setFrom(new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("y")))));
// $NON-NLS-1$
return new AssignmentStatement(new ElementSymbol("b"), query);
}
use of org.teiid.query.sql.proc.AssignmentStatement in project teiid by teiid.
the class TestAssignmentStatement method testSelfEquivalence.
public void testSelfEquivalence() {
AssignmentStatement s1 = sample1();
int equals = 0;
UnitTestUtil.helpTestEquivalence(equals, s1, s1);
}
use of org.teiid.query.sql.proc.AssignmentStatement in project teiid by teiid.
the class TestAssignmentStatement method testGetVariable.
// ################################## ACTUAL TESTS ################################
public void testGetVariable() {
AssignmentStatement s1 = sample1();
// $NON-NLS-1$ //$NON-NLS-2$
assertEquals("Didn't get the same parts ", s1.getVariable(), new ElementSymbol("a"));
}
use of org.teiid.query.sql.proc.AssignmentStatement in project teiid by teiid.
the class TestAssignmentStatement method testGetCommand.
public void testGetCommand() throws Exception {
AssignmentStatement s2 = sample2();
// $NON-NLS-1$
Query query = (Query) QueryParser.getQueryParser().parseCommand("Select x from y");
// $NON-NLS-1$
assertEquals("Didn't get the same parts ", ((ScalarSubquery) s2.getExpression()).getCommand(), query);
}
Aggregations