Package org.teiid.test.framework.query

Examples of org.teiid.test.framework.query.AbstractQueryTransactionTest


     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testSingleSourceSelect() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceSelect") {
            public void testCase() throws Exception {
                execute("select * from pm1.g1 where pm1.g1.e1 < 100");
                assertRowCount(100);
            }
        };       
View Full Code Here


     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testSingleSourceUpdate() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceUpdate") {
            public void testCase() throws Exception {
                execute("insert into pm1.g1 (e1, e2) values(100, '100')");
            }
        };       
       
        // run test
        getTransactionContainter().runTransaction(userTxn);      
       
        // now verify the results
        AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
        test.execute("select * from g1 where e1 = 100");
        test.assertRowCount(1);
    }
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testSingleSourcePreparedUpdate() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourcePreparedUpdate") {
           
            public void testCase() throws Exception {
                execute("insert into pm1.g1 (e1, e2) values(?, ?)", new Object[] {new Integer(102), "102"});               
            }
        };       
       
        // run test
        getTransactionContainter().runTransaction(userTxn);
       
        // now verify the results
        AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
        test.execute("select * from g1 where e1 = 102");
        test.assertRowCount(1);
     
    }   
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testSingleSourceMultipleCommands() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceMultipleCommands") {
            public void testCase() throws Exception {
               
                execute("delete from pm1.g1 where pm1.g1.e1 >= ?", new Object[] {new Integer(100)});
               
                execute("select * from pm1.g1");
                assertRowCount(100);
               
                for (int i = 100; i < 110; i++) {
                    Integer val = new Integer(i);
                    execute("insert into pm1.g1 (e1, e2) values(?,?)", new Object[] {val, val.toString()});
                    execute("insert into pm1.g2 (e1, e2) values(?,?)", new Object[] {val, val.toString()});
                }
            }
        };       
       
        // run test
        getTransactionContainter().runTransaction(userTxn);     

        // now verify the results
        AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
        test.execute("select * from g1 where e1 >= 100");
        test.assertRowCount(10);
        test.execute("select * from g2 where e1 >= 100");
        test.assertRowCount(10);       
     
View Full Code Here

     * Batching = Partial Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testSingleSourcePartialProcessing() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourcePartialProcessing") {
            public void testCase() throws Exception {
                execute("select * from pm1.g1 where pm1.g1.e1 < 100 limit 10");
                assertRowCount(10);
            }
        };       
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testMultipleSourceSelect() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelect") {
            public void testCase() throws Exception {
                execute("select * from pm1.g1 join pm2.g1 on pm1.g1.e1 = pm2.g1.e1 where pm1.g1.e1 < 100");
                assertRowCount(100);
            }
        };       
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */   
    @Test
    public void testMultipleSourceVirtualSelect() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceVirtualSelect") {
            public void testCase() throws Exception {
                execute("select * from vm.g1 where vm.g1.pm1e1 < 100");
                assertRowCount(100);
            }
        };       
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testMultipleSourceUpdate() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceUpdate") {
            public void testCase() throws Exception {
                execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(500, '500', 500, '500')");
            }
        };       
       
        // run test
        getTransactionContainter().runTransaction(userTxn);      
       
        // now verify the results
        AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
        test.execute("select * from g1 where e2 = '500'");
        test.assertRowCount(1);
        test.closeConnection();
       
        test = new QueryExecution(userTxn.getSource("pm2"));
        test.execute("select * from g1 where e2 = '500'");
        test.assertRowCount(1);
    }
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testMultipleSourceSelectInto() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceSelectInto") {
            public void testCase() throws Exception {
                execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(501, '501', 501, '501')");
                execute("select pm1.g1.e1, pm1.g1.e2 into pm2.g2 from pm1.g1 where pm1.g1.e1 = 501");
            }
        };       
       
        // run test
        getTransactionContainter().runTransaction(userTxn);      
       
        // now verify the results
        AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
        test.execute("select * from g1 where e2 = '501'");
        test.assertRowCount(1);
       
        test = new QueryExecution(userTxn.getSource("pm2"));
        test.execute("select * from g1 where e2 = '501'");
        test.assertRowCount(1);
    }   
View Full Code Here

     * Batching = Full Processing, Single Connector Batch
     * result = commit
     */
    @Test
    public void testMultipleSourceBulkRowInsert() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsert") {
            public void testCase() throws Exception {
                for (int i = 100; i < 112; i++) {
                    Integer val = new Integer(i);
                    execute("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values(?,?,?,?)", new Object[] {val, val.toString(), val, val.toString()});
                }
                execute("select pm1.g1.e1, pm1.g1.e2 into pm2.g2 from pm1.g1 where pm1.g1.e1 >= 100");
            }
        };       
       
        // run test
        getTransactionContainter().runTransaction(userTxn);      
       
        // now verify the results
        AbstractQueryTest test = new QueryExecution(userTxn.getSource("pm1"));
        test.execute("select * from g1 where e1 >= 100 and e1 < 112");
        test.assertRowCount(12);
       
        test = new QueryExecution(userTxn.getSource("pm2"));
        test.execute("select * from g1 where e1 >= 100 and e1 < 112");
        test.assertRowCount(12);
        test.execute("select * from g2 where e1 >= 100 and e1 < 112");
        test.assertRowCount(12);       
    }   
View Full Code Here

TOP

Related Classes of org.teiid.test.framework.query.AbstractQueryTransactionTest

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.