Examples of JDBCConfiguration


Examples of org.apache.openjpa.jdbc.conf.JDBCConfiguration

    }

    public void setUp() throws Exception {
        super.setUp(Person.class, CLEAR_TABLES);
        OpenJPAEntityManager em = emf.createEntityManager();
        JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
        String user = conf.getConnectionUserName();
        if (user != null && !user.equals("")) {
            // Disable for non-Derby, due to connectionUserName to schema mapping failures
            setTestsDisabled(true);
            getLog().trace("TestOverrideNonJtaDataSource can only be executed against Derby w/o a schema");
        } else {
View Full Code Here

Examples of org.apache.openjpa.jdbc.conf.JDBCConfiguration

    @Override
    public void setUp() throws Exception {
        super.setUp(Person.class, CLEAR_TABLES);
        OpenJPAEntityManager em = emf.createEntityManager();
        JDBCConfiguration conf = (JDBCConfiguration) em.getConfiguration();
        String user = conf.getConnectionUserName();
        if (user != null && !user.equals("")) {
            // Disable for non-Derby, due to connectionUserName to schema mapping failures
            setTestsDisabled(true);
            getLog().trace("TestOverrideNonJtaDataSource can only be executed against Derby w/o a schema");
        } else {
View Full Code Here

Examples of org.geowebcache.diskquota.jdbc.JDBCConfiguration

    public void testDiskQuotaStorage() throws Exception {
        // normal state, quota is not enabled by default
        GWC gwc = GWC.get();
        ConfigurableQuotaStoreProvider provider = GeoServerExtensions.bean(ConfigurableQuotaStoreProvider.class);
        DiskQuotaConfig quota = gwc.getDiskQuotaConfig();
        JDBCConfiguration jdbc = gwc.getJDBCDiskQuotaConfig();
        assertFalse("Disk quota is enabled??", quota.isEnabled());
        assertNull("jdbc quota config should be missing", jdbc);
        assertTrue(getActualStore(provider) instanceof DummyQuotaStore);
       
        // enable disk quota in H2 mode
        quota.setEnabled(true);
        quota.setQuotaStore("H2");
        gwc.saveDiskQuotaConfig(quota, null);
        GeoServerDataDirectory dd = GeoServerExtensions.bean(GeoServerDataDirectory.class);
        File jdbcConfigFile = dd.findFile("gwc/geowebcache-diskquota-jdbc.xml");
        assertNull("jdbc config should not be there", jdbcConfigFile);
        File h2DefaultStore = dd.findFile("gwc/diskquota_page_store_h2");
        assertNotNull("jdbc store should be there", h2DefaultStore);
        assertTrue(getActualStore(provider) instanceof JDBCQuotaStore);
       
        // disable again and clean up
        quota.setEnabled(false);
        gwc.saveDiskQuotaConfig(quota, null);
        FileUtils.deleteDirectory(h2DefaultStore);
       
        // now enable it in JDBC mode, with H2 local storage
        quota.setEnabled(true);
        quota.setQuotaStore("JDBC");
        jdbc = new JDBCConfiguration();
        jdbc.setDialect("H2");
        ConnectionPoolConfiguration pool = new ConnectionPoolConfiguration();
        pool.setDriver("org.h2.Driver");
        pool.setUrl("jdbc:h2:./target/quota-h2");
        pool.setUsername("sa");
        pool.setPassword("");
        pool.setMinConnections(1);
        pool.setMaxConnections(1);
        pool.setMaxOpenPreparedStatements(50);
        jdbc.setConnectionPool(pool);
        gwc.saveDiskQuotaConfig(quota, jdbc);
        jdbcConfigFile = dd.findFile("gwc/geowebcache-diskquota-jdbc.xml");
        assertNotNull("jdbc config should be there", jdbcConfigFile);
        assertNull("jdbc store should be there", dd.findDataFile("gwc/diskquota_page_store_h2"));
        File newQuotaStore = new File("./target/quota-h2.data.db");
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.