use of org.teiid.metadata.Procedure in project teiid by teiid.
the class TestProcedure method testProcedureWithResultSet.
public void testProcedureWithResultSet() throws Exception {
// $NON-NLS-1$
Procedure proc = getProcedure("ConnectorMetadata.TestProc2", 1, CONNECTOR_METADATA_UTILITY);
assertEquals(null, proc.getNameInSource());
String[] nameInSource = new String[] { null };
ProcedureParameter.Type[] direction = new ProcedureParameter.Type[] { ProcedureParameter.Type.In };
int[] index = new int[] { 1 };
Class<?>[] type = new Class[] { String.class };
checkParams(proc, nameInSource, direction, index, type);
List<Column> rsCols = proc.getResultSet().getColumns();
// Check first column of result set
assertEquals(2, rsCols.size());
Column elemID = rsCols.get(0);
// $NON-NLS-1$
assertEquals("RSCol1", elemID.getName());
// $NON-NLS-1$
assertEquals("ConnectorMetadata.TestProc2.RSParam.RSCol1", elemID.getFullName());
// $NON-NLS-1$
assertEquals("Result set column name in source", elemID.getNameInSource());
assertEquals(java.sql.Timestamp.class, elemID.getJavaType());
assertEquals(1, elemID.getPosition());
Column elemID2 = rsCols.get(1);
// $NON-NLS-1$
assertEquals("RSCol2", elemID2.getName());
// $NON-NLS-1$
assertEquals("ConnectorMetadata.TestProc2.RSParam.RSCol2", elemID2.getFullName());
assertEquals(null, elemID2.getNameInSource());
assertEquals(String.class, elemID2.getJavaType());
assertEquals(2, elemID2.getPosition());
Properties props = new Properties();
// $NON-NLS-1$ //$NON-NLS-2$
props.put("ColProp", "defaultvalue");
// failing because default extension properties aren't in the VDB file
// assertEquals(props, e2.getProperties());
}
use of org.teiid.metadata.Procedure in project teiid by teiid.
the class TestDynamicImportedMetaData method testProcImport.
@Test
public void testProcImport() throws Exception {
server.deployVDB("vdb", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb");
// $NON-NLS-1$
Connection conn = server.createConnection("jdbc:teiid:vdb");
Properties importProperties = new Properties();
importProperties.setProperty("importer.importProcedures", Boolean.TRUE.toString());
MetadataFactory mf = getMetadata(importProperties, conn);
Procedure p = mf.asMetadataStore().getSchemas().get("TEST").getProcedures().get("VDB.SYS.GETXMLSCHEMAS");
assertEquals(1, p.getResultSet().getColumns().size());
}
Aggregations