Examples of JNDIDataSourceFactory


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

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

        try {

            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
            assertSame(dataSource, factory.getDataSource(descriptor));
        }
        finally {
            // since the context is shared, must clear it after the test
            context.unbind(descriptor.getParameters());
        }
View Full Code Here

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

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

        try {

            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
            assertSame(dataSource, factory.getDataSource(descriptor));
        }
        finally {
            // since the context is shared, must clear it after the test
            context.unbind("java:comp/env/" + descriptor.getParameters());
        }
View Full Code Here

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

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

        JNDISetup.doSetup();

        JNDIDataSourceFactory factory = new JNDIDataSourceFactory();

        try {
            factory.getDataSource(descriptor);
            fail("Didn't throw on unbound name");
        }
        catch (NameNotFoundException e) {
            // expected
        }
View Full Code Here

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

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

        try {

            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
            injector.injectMembers(factory);
            assertSame(dataSource, factory.getDataSource(descriptor));
        }
        finally {
            // since the context is shared, must clear it after the test
            context.unbind(descriptor.getParameters());
        }
View Full Code Here

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

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

        try {

            JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
            injector.injectMembers(factory);
            assertSame(dataSource, factory.getDataSource(descriptor));
        }
        finally {
            // since the context is shared, must clear it after the test
            context.unbind("java:comp/env/" + descriptor.getParameters());
        }
View Full Code Here

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

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

        JNDISetup.doSetup();

        JNDIDataSourceFactory factory = new JNDIDataSourceFactory();
        injector.injectMembers(factory);

        try {
            factory.getDataSource(descriptor);
            fail("Didn't throw on unbound name");
        }
        catch (NameNotFoundException e) {
            // expected
        }
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.