Search in sources :

Example 41 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestAssignmentStatement method testGetExpression.

public void testGetExpression() {
    AssignmentStatement s1 = sample1();
    // $NON-NLS-1$ //$NON-NLS-2$
    assertEquals("Didn't get the same parts ", s1.getExpression(), new Constant("1"));
}
Also used : AssignmentStatement(org.teiid.query.sql.proc.AssignmentStatement) Constant(org.teiid.query.sql.symbol.Constant)

Example 42 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestFunction method testFunction1.

// ################################## TEST HELPERS ################################
// ################################## ACTUAL TESTS ################################
public void testFunction1() {
    // $NON-NLS-1$ //$NON-NLS-2$
    Function f1 = new Function("f1", new Expression[] { new Constant("xyz") });
    // $NON-NLS-1$ //$NON-NLS-2$
    Function f2 = new Function("f1", new Expression[] { new Constant("xyz") });
    UnitTestUtil.helpTestEquivalence(0, f1, f2);
}
Also used : Function(org.teiid.query.sql.symbol.Function) Constant(org.teiid.query.sql.symbol.Constant)

Example 43 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestFunction method testFunction6.

public void testFunction6() {
    // $NON-NLS-1$ //$NON-NLS-2$
    Function f1 = new Function("f1", new Expression[] { new Constant("xyz") });
    // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Function f2 = new Function("f1", new Expression[] { new Constant("xyz"), new Constant("xyz") });
    UnitTestUtil.helpTestEquivalence(1, f1, f2);
}
Also used : Function(org.teiid.query.sql.symbol.Function) Constant(org.teiid.query.sql.symbol.Constant)

Example 44 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestFunction method testFunction5.

public void testFunction5() {
    // $NON-NLS-1$
    Function f1 = new Function("f1", new Expression[] { null });
    // $NON-NLS-1$ //$NON-NLS-2$
    Function f2 = new Function("f1", new Expression[] { new Constant("xyz") });
    UnitTestUtil.helpTestEquivalence(1, f1, f2);
}
Also used : Function(org.teiid.query.sql.symbol.Function) Constant(org.teiid.query.sql.symbol.Constant)

Example 45 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestDynamicCommand method testClone1.

public void testClone1() {
    List symbols = new ArrayList();
    // $NON-NLS-1$
    ElementSymbol a1 = new ElementSymbol("a1");
    a1.setType(DataTypeManager.DefaultDataClasses.STRING);
    symbols.add(a1);
    DynamicCommand sqlCmd = new DynamicCommand();
    // $NON-NLS-1$
    Expression sql = new Constant("SELECT a1 FROM g WHERE a2 = 5");
    sqlCmd.setSql(sql);
    sqlCmd.setAsColumns(symbols);
    sqlCmd.setAsClauseSet(true);
    // $NON-NLS-1$
    sqlCmd.setIntoGroup(new GroupSymbol("#g"));
    UnitTestUtil.helpTestEquivalence(0, sqlCmd, sqlCmd.clone());
}
Also used : ElementSymbol(org.teiid.query.sql.symbol.ElementSymbol) DynamicCommand(org.teiid.query.sql.lang.DynamicCommand) Expression(org.teiid.query.sql.symbol.Expression) Constant(org.teiid.query.sql.symbol.Constant) ArrayList(java.util.ArrayList) GroupSymbol(org.teiid.query.sql.symbol.GroupSymbol) List(java.util.List) SetClauseList(org.teiid.query.sql.lang.SetClauseList) ArrayList(java.util.ArrayList)

Aggregations

Constant (org.teiid.query.sql.symbol.Constant)203 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)94 Test (org.junit.Test)88 ArrayList (java.util.ArrayList)61 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)48 List (java.util.List)38 Expression (org.teiid.query.sql.symbol.Expression)38 Function (org.teiid.query.sql.symbol.Function)31 CompareCriteria (org.teiid.query.sql.lang.CompareCriteria)25 Query (org.teiid.query.sql.lang.Query)22 Select (org.teiid.query.sql.lang.Select)15 Reference (org.teiid.query.sql.symbol.Reference)14 From (org.teiid.query.sql.lang.From)12 HashMap (java.util.HashMap)11 FunctionDescriptor (org.teiid.query.function.FunctionDescriptor)11 Criteria (org.teiid.query.sql.lang.Criteria)11 SetQuery (org.teiid.query.sql.lang.SetQuery)11 LinkedList (java.util.LinkedList)10 Limit (org.teiid.query.sql.lang.Limit)10 StoredProcedure (org.teiid.query.sql.lang.StoredProcedure)9