use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseConvertModifier 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 TestSybaseConvertModifier method testBooleanToIntegerb.
@Test
public void testBooleanToIntegerb() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("integer", Integer.class) }, Integer.class);
// $NON-NLS-1$
helpGetString1(func, "cast(0 AS int)");
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseConvertModifier method testIntegerToShort.
@Test
public void testIntegerToShort() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(new Integer(1232321), Integer.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("short", Short.class) }, Short.class);
// $NON-NLS-1$
helpGetString1(func, "cast(1232321 AS smallint)");
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseConvertModifier method testShortToInteger.
@Test
public void testShortToInteger() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(new Short((short) 1243), Short.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("integer", Integer.class) }, Integer.class);
// $NON-NLS-1$
helpGetString1(func, "cast(1243 AS int)");
}
use of org.teiid.language.Function in project teiid by teiid.
the class TestSybaseConvertModifier method testBooleanToDoubleb.
@Test
public void testBooleanToDoubleb() throws Exception {
Function func = // $NON-NLS-1$
LANG_FACTORY.createFunction(// $NON-NLS-1$
"convert", new Expression[] { LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), // $NON-NLS-1$
LANG_FACTORY.createLiteral("double", Double.class) }, Double.class);
// $NON-NLS-1$
helpGetString1(func, "cast(0 AS double precision)");
}
Aggregations