Package com.mockrunner.mock.jdbc

Examples of com.mockrunner.mock.jdbc.MockDataSource


        DataNode node = action.buildDataNode(new DataDomain("DD"));

        assertNotNull(node);
        assertNotNull(node.getName());

        DataSource ds1 = new MockDataSource();
        node.setDataSource(ds1);

        assertSame("Project DataNode must not wrap the DataSource", ds1, node
                .getDataSource());
    }
View Full Code Here


        DataNode node = loader.createDataNode("ABC");

        assertNotNull(node);
        assertEquals("ABC", node.getName());

        DataSource ds1 = new MockDataSource();
        node.setDataSource(ds1);

        assertSame("Project DataNode must not wrap the DataSource", ds1, node
                .getDataSource());
    }
View Full Code Here

import com.mockrunner.mock.jdbc.MockDataSource;

public class MockDataSourceFactory implements DataSourceFactory {

    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) {
        return new MockDataSource();
    }
View Full Code Here

        DataNodeDescriptor descriptor = new DataNodeDescriptor();
        descriptor.setParameters("jdbc/TestDS");

        JNDISetup.doSetup();

        MockDataSource dataSource = new MockDataSource();
        InitialContext context = new InitialContext();
        context.bind(descriptor.getParameters(), dataSource);

        try {
View Full Code Here

        DataNodeDescriptor descriptor = new DataNodeDescriptor();
        descriptor.setParameters("jdbc/TestDS");

        JNDISetup.doSetup();

        MockDataSource dataSource = new MockDataSource();
        InitialContext context = new InitialContext();
        context.bind("java:comp/env/" + descriptor.getParameters(), dataSource);

        try {
View Full Code Here

            }
        });

        MockConnection connection = new MockConnection();

        MockDataSource dataSource = new MockDataSource();
        dataSource.setupConnection(connection);

        Module testModule = new Module() {

            public void configure(Binder binder) {
                binder.bind(JdbcEventLogger.class).to(CommonsJdbcEventLogger.class);
View Full Code Here

        DefaultDbAdapterFactory factory = new DefaultDbAdapterFactory(detectors);
        injector.injectMembers(factory);

        DbAdapter createdAdapter = factory.createAdapter(
                new DataNodeDescriptor(),
                new MockDataSource());
        assertNotNull(createdAdapter);
        assertTrue(
                "Unexpected class: " + createdAdapter.getClass().getName(),
                createdAdapter instanceof AutoAdapter);
        assertEquals("CREATE TABLE Test ()", createdAdapter.createTable(new DbEntity(
View Full Code Here

        DefaultDbAdapterFactory factory = new DefaultDbAdapterFactory(detectors);
        injector.injectMembers(factory);

        DbAdapter createdAdapter = factory.createAdapter(
                nodeDescriptor,
                new MockDataSource());
        assertNotNull(createdAdapter);
        assertTrue(
                "Unexpected class: " + createdAdapter.getClass().getName(),
                createdAdapter instanceof SybaseAdapter);
    }
View Full Code Here

       
        dataStore = new JDBCDataStore();
        dataStore.setFilterFactory(CommonFactoryFinder.getFilterFactory2());
        dataStore.setSQLDialect(createBasicSQLDialect());
       
        MockDataSource dataSource = new MockDataSource();
        dataSource.setupConnection(cx);
        dataStore.setDataSource(dataSource);
       
        featureType = Mockito.mock(SimpleFeatureType.class);
        Mockito.when(featureType.getTypeName()).thenReturn(SAMPLE_FEATURE_NAME);
        Mockito.when(featureType.getName()).thenReturn(new NameImpl(SAMPLE_FEATURE_NAME));
View Full Code Here

TOP

Related Classes of com.mockrunner.mock.jdbc.MockDataSource

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.