Package org.apache.cayenne.configuration.server

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


    public void testDbApdater() throws Exception {
        Log log = mock(Log.class);
        Injector i = DIBootstrap.createInjector(new ToolsModule(log));

        DbAdapterFactory factory = i.getInstance(DbAdapterFactory.class);

        DataNodeDescriptor nodeDescriptor = mock(DataNodeDescriptor.class);
        DataSource dataSource = mock(DataSource.class);

        assertTrue(factory.createAdapter(nodeDescriptor, dataSource) instanceof AutoAdapter);
    }
View Full Code Here


    }

    protected DbAdapter getAdapter(Injector injector, DataSource dataSource)
            throws Exception {

        DbAdapterFactory adapterFactory = injector
                .getInstance(DbAdapterFactory.class);

        DataNodeDescriptor nodeDescriptor = new DataNodeDescriptor();
        nodeDescriptor.setAdapterType(adapter);

        return adapterFactory.createAdapter(nodeDescriptor, dataSource);
    }
View Full Code Here

TOP

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

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.