Package org.apache.phoenix.jdbc

Examples of org.apache.phoenix.jdbc.PhoenixTestDriver


        setDefaultTestConfig(conf);
    }
   
    private static void setDefaultTestConfig(Configuration conf) {
        ConfigUtil.setReplicationConfigIfAbsent(conf);
        QueryServices services = new PhoenixTestDriver().getQueryServices();
        for (Entry<String,String> entry : services.getProps()) {
            conf.set(entry.getKey(), entry.getValue());
        }
        //no point doing sanity checks when running tests.
        conf.setBoolean("hbase.table.sanity.checks", false);
View Full Code Here


    /**
     * Create a {@link PhoenixTestDriver} and register it.
     * @return an initialized and registered {@link PhoenixTestDriver}
     */
    protected static PhoenixTestDriver initAndRegisterDriver(String url, ReadOnlyProps props) throws Exception {
        PhoenixTestDriver driver = new PhoenixTestDriver(props);
        DriverManager.registerDriver(driver);
        Assert.assertTrue(DriverManager.getDriver(url) == driver);
        Connection conn = driver.connect(url, PropertiesUtil.deepCopy(TEST_PROPERTIES));
        conn.close();
        return driver;
    }
View Full Code Here

        }
    }
   
    protected static synchronized PhoenixTestDriver initDriver(ReadOnlyProps props) throws Exception {
        if (driver == null) {
            driver = new PhoenixTestDriver(props);
            DriverManager.registerDriver(driver);
        }
        return driver;
    }
View Full Code Here

    public static void doTeardown() throws Exception {
        if (driver != null) {
            try {
                driver.close();
            } finally {
                PhoenixTestDriver driver = BaseConnectionlessQueryTest.driver;
                BaseConnectionlessQueryTest.driver = null;
                DriverManager.deregisterDriver(driver);
            }
        }
    }
View Full Code Here

    private static int driverRefCount = 0;

    protected static synchronized PhoenixTestDriver initDriver(QueryServices services) throws Exception {
        if (driver == null) {
            if (driverRefCount == 0) {
                BaseTest.driver = new PhoenixTestDriver(services);
                DriverManager.registerDriver(driver);
                driverRefCount++;
            }
        }
        return BaseTest.driver;
View Full Code Here

    protected static void startServer(String url, ReadOnlyProps props) throws Exception {
//        Pass config through initDriver for testing purposes
//        Don't create Config or surface getConfig or getProps in QueryServices
//        Create Config in ConnectionQueryServices, but don't surface it
//        Add getAdmin in ConnectionQueryServices
        PhoenixTestDriver driver = initDriver(new QueryServicesTestImpl(props));
        assertTrue(DriverManager.getDriver(url) == driver);
        driver.connect(url, TEST_PROPERTIES);
    }
View Full Code Here

    private static int driverRefCount = 0;

    protected static synchronized PhoenixTestDriver initDriver(ReadOnlyProps props) throws Exception {
        if (driver == null) {
            if (driverRefCount == 0) {
                BaseTest.driver = new PhoenixTestDriver(props);
                DriverManager.registerDriver(driver);
                driverRefCount++;
            }
        }
        return BaseTest.driver;
View Full Code Here

    protected static void startServer(String url, ReadOnlyProps props) throws Exception {
        assertNull(BaseTest.driver);
        // only load the test driver if we are testing locally - for integration tests, we want to
        // test on a wider scale
        if (PhoenixEmbeddedDriver.isTestUrl(url)) {
            PhoenixTestDriver driver = initDriver(props);
            assertTrue(DriverManager.getDriver(url) == driver);
        }
    }
View Full Code Here

        setDefaultTestConfig(conf);
    }
   
    private static void setDefaultTestConfig(Configuration conf) {
        ConfigUtil.setReplicationConfigIfAbsent(conf);
        QueryServices services = new PhoenixTestDriver().getQueryServices();
        for (Entry<String,String> entry : services.getProps()) {
            conf.set(entry.getKey(), entry.getValue());
        }
        //no point doing sanity checks when running tests.
        conf.setBoolean("hbase.table.sanity.checks", false);
View Full Code Here

    /**
     * Create a {@link PhoenixTestDriver} and register it.
     * @return an initialized and registered {@link PhoenixTestDriver}
     */
    protected static PhoenixTestDriver initAndRegisterDriver(String url, ReadOnlyProps props) throws Exception {
        PhoenixTestDriver driver = new PhoenixTestDriver(props);
        DriverManager.registerDriver(driver);
        Assert.assertTrue(DriverManager.getDriver(url) == driver);
        Connection conn = driver.connect(url, PropertiesUtil.deepCopy(TEST_PROPERTIES));
        conn.close();
        return driver;
    }
View Full Code Here

TOP

Related Classes of org.apache.phoenix.jdbc.PhoenixTestDriver

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.