Package org.apache.cayenne.configuration.server

Examples of org.apache.cayenne.configuration.server.DBCPDataSourceFactory


        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
        nodeDescriptor.setConfigurationSource(new URLResource(url));
        nodeDescriptor.setParameters("testDBCP.properties");

        DBCPDataSourceFactory factory = new DBCPDataSourceFactory();
        DataSource dataSource = factory.getDataSource(nodeDescriptor);
        assertNotNull(dataSource);

        assertTrue(dataSource instanceof BasicDataSource);
        BasicDataSource basicDataSource = (BasicDataSource) dataSource;
        assertEquals("com.example.jdbc.Driver", basicDataSource.getDriverClassName());
View Full Code Here


        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
        nodeDescriptor.setConfigurationSource(new URLResource(url));
        nodeDescriptor.setParameters("testDBCP_legacy.properties");

        DBCPDataSourceFactory factory = new DBCPDataSourceFactory();
        DataSource dataSource = factory.getDataSource(nodeDescriptor);
        assertNotNull(dataSource);

        assertTrue(dataSource instanceof BasicDataSource);
        BasicDataSource basicDataSource = (BasicDataSource) dataSource;
        assertEquals("com.example.jdbc.Driver", basicDataSource.getDriverClassName());
View Full Code Here

        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
        nodeDescriptor.setConfigurationSource(new URLResource(url));
        nodeDescriptor.setParameters("testDBCP.properties.nosuchfile");

        DBCPDataSourceFactory factory = new DBCPDataSourceFactory();

        try {
            factory.getDataSource(nodeDescriptor);
            fail("didn't throw on abscent config file");
        }
        catch (IOException ex) {
            // expected
        }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.configuration.server.DBCPDataSourceFactory

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.