Package org.teiid.cdk.api

Examples of org.teiid.cdk.api.ConnectorHost


    public void helpTestQuery(String sql, TranslationUtility metadata, Object[][] expectedResults) throws TranslatorException {
        helpTestQuery(sql, metadata, 0, 1, expectedResults);
    }

    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


     */
    public void defer_testWaitTime() throws Exception {
        int waitTime = 100;
        int testCount = 10;
       
        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

        LoopbackExecutionFactory connector = new LoopbackExecutionFactory();
        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

Related Classes of org.teiid.cdk.api.ConnectorHost

Copyright © 2018 www.massapicom. 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.