use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseIQConvertModifier method testModDrop.
// original test -- this is not a drop one anymore
@Test
public void testModDrop() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { // $NON-NLS-1$
LANG_FACTORY.createLiteral("5", String.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("integer", String.class) }, Integer.class);
// $NON-NLS-1$
assertEquals("cast('5' AS int)", helpGetString(func));
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseIQConvertModifier method testDoubleToInteger.
@Test
public void testDoubleToInteger() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(new Double(1.0), Double.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("integer", Integer.class) }, Integer.class);
// $NON-NLS-1$
helpGetString1(func, "cast(1.0 AS int)");
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseIQConvertModifier method testDoubleToShort.
@Test
public void testDoubleToShort() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(new Double(1.0), Double.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("short", Short.class) }, Short.class);
// $NON-NLS-1$
helpGetString1(func, "cast(1.0 AS smallint)");
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseIQConvertModifier method testFloatToShort.
@Test
public void testFloatToShort() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(new Float((float) 123.0), Float.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("short", Short.class) }, Short.class);
// $NON-NLS-1$
helpGetString1(func, "cast(123.0 AS smallint)");
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseIQConvertModifier method testBooleanToDoublea.
@Test
public void testBooleanToDoublea() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("double", Double.class) }, Double.class);
// $NON-NLS-1$
helpGetString1(func, "cast(1 AS double)");
}
Aggregations