Package org.teiid.cdk.api

Examples of org.teiid.cdk.api.ConnectorHost.executeCommand()


    }

    public void helpTestQuery(String sql, TranslationUtility metadata, int waitTime, int rowCount, Object[][] expectedResults) throws TranslatorException {
      ConnectorHost host = new ConnectorHost(exampleProperties(waitTime, rowCount), null, metadata);
                             
      List actualResults = host.executeCommand(sql);
      
        // Compare actual and expected results
        assertEquals("Did not get expected number of rows", expectedResults.length, actualResults.size()); //$NON-NLS-1$
       
        if(expectedResults.length > 0) {
View Full Code Here


       
        ConnectorHost host = new ConnectorHost(exampleProperties(waitTime, 1), null, FakeTranslationFactory.getInstance().getBQTTranslationUtility());
               
        for(int i=0; i<testCount; i++) {
            long before = System.currentTimeMillis();
            host.executeCommand("SELECT intkey FROM BQT1.SmallA"); //$NON-NLS-1$
            long after = System.currentTimeMillis();
            assertTrue("Waited too long", (after-before) <= waitTime); //$NON-NLS-1$
        }           
    }
   
View Full Code Here

        connector.setWaitTime(200);
        connector.setRowCount(1000);
        connector.setPollIntervalInMilli(100L);
       
        ConnectorHost host = new ConnectorHost(connector, null, FakeTranslationFactory.getInstance().getBQTTranslationUtility());
        List results = host.executeCommand("SELECT intkey from bqt1.smalla"); //$NON-NLS-1$
        assertEquals(1000, results.size());
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.