Package org.apache.jackrabbit.jca

Examples of org.apache.jackrabbit.jca.JCAConnectionRequestInfo


     * Test the connection matching.
     */
    public void testMatching() throws Exception {

        // Create connection request infos
        JCAConnectionRequestInfo cri1 = new JCAConnectionRequestInfo(JCR_SUPERUSER, JCR_WORKSPACE);
        JCAConnectionRequestInfo cri2 = new JCAConnectionRequestInfo(JCR_ANONUSER, JCR_WORKSPACE);

        // Check if not same
        assertNotSame(cri1, cri2);

        // Create the connection factory
        mcf.createConnectionFactory();

        // Allocate connections
        ManagedConnection mc1 = mcf.createManagedConnection(null, cri1);
        ManagedConnection mc2 = mcf.createManagedConnection(null, cri2);

        // Check if not same
        assertTrue(mc1 != mc2);

        // Create a sef of connections
        HashSet connectionSet = new HashSet();
        connectionSet.add(mc1);
        connectionSet.add(mc2);

        // Match the first connection
        JCAConnectionRequestInfo cri3 = new JCAConnectionRequestInfo(cri1);
        assertTrue((cri1 != cri3) && cri1.equals(cri3));
        ManagedConnection mc3 = mcf.matchManagedConnections(connectionSet, null, cri3);
        assertTrue(mc1 == mc3);

        // Match the second connection
        JCAConnectionRequestInfo cri4 = new JCAConnectionRequestInfo(cri2);
        assertTrue((cri2 != cri4) && cri2.equals(cri4));
        ManagedConnection mc4 = mcf.matchManagedConnections(connectionSet, null, cri4);
        assertTrue(mc2 == mc4);
    }
View Full Code Here


     * Test the connection matching.
     */
    public void testMatching() throws Exception {

        // Create connection request infos
        JCAConnectionRequestInfo cri1 = new JCAConnectionRequestInfo(JCR_SUPERUSER, JCR_WORKSPACE);
        JCAConnectionRequestInfo cri2 = new JCAConnectionRequestInfo(JCR_ANONUSER, JCR_WORKSPACE);

        // Check if not same
        assertNotSame(cri1, cri2);

        // Allocate connections
        ManagedConnection mc1 = mcf.createManagedConnection(null, cri1);
        ManagedConnection mc2 = mcf.createManagedConnection(null, cri2);

        // Check if not same
        assertTrue(mc1 != mc2);

        // Create a sef of connections
        HashSet connectionSet = new HashSet();
        connectionSet.add(mc1);
        connectionSet.add(mc2);

        // Match the first connection
        JCAConnectionRequestInfo cri3 = new JCAConnectionRequestInfo(cri1);
        assertTrue((cri1 != cri3) && cri1.equals(cri3));
        ManagedConnection mc3 = mcf.matchManagedConnections(connectionSet, null, cri3);
        assertTrue(mc1 == mc3);

        // Match the second connection
        JCAConnectionRequestInfo cri4 = new JCAConnectionRequestInfo(cri2);
        assertTrue((cri2 != cri4) && cri2.equals(cri4));
        ManagedConnection mc4 = mcf.matchManagedConnections(connectionSet, null, cri4);
        assertTrue(mc2 == mc4);
    }
View Full Code Here

     * Test the connection matching.
     */
    public void testMatching() throws Exception {

        // Create connection request infos
        JCAConnectionRequestInfo cri1 = new JCAConnectionRequestInfo(JCR_SUPERUSER, JCR_WORKSPACE);
        JCAConnectionRequestInfo cri2 = new JCAConnectionRequestInfo(JCR_ANONUSER, JCR_WORKSPACE);

        // Check if not same
        assertNotSame(cri1, cri2);

        // Allocate connections
        ManagedConnection mc1 = mcf.createManagedConnection(null, cri1);
        ManagedConnection mc2 = mcf.createManagedConnection(null, cri2);

        // Check if not same
        assertTrue(mc1 != mc2);

        // Create a sef of connections
        HashSet connectionSet = new HashSet();
        connectionSet.add(mc1);
        connectionSet.add(mc2);

        // Match the first connection
        JCAConnectionRequestInfo cri3 = new JCAConnectionRequestInfo(cri1);
        assertTrue((cri1 != cri3) && cri1.equals(cri3));
        ManagedConnection mc3 = mcf.matchManagedConnections(connectionSet, null, cri3);
        assertTrue(mc1 == mc3);

        // Match the second connection
        JCAConnectionRequestInfo cri4 = new JCAConnectionRequestInfo(cri2);
        assertTrue((cri2 != cri4) && cri2.equals(cri4));
        ManagedConnection mc4 = mcf.matchManagedConnections(connectionSet, null, cri4);
        assertTrue(mc2 == mc4);
    }
View Full Code Here

     * Test the connection matching.
     */
    public void testMatching() throws Exception {

        // Create connection request infos
        JCAConnectionRequestInfo cri1 = new JCAConnectionRequestInfo(JCR_SUPERUSER, JCR_WORKSPACE);
        JCAConnectionRequestInfo cri2 = new JCAConnectionRequestInfo(JCR_ANONUSER, JCR_WORKSPACE);

        // Check if not same
        assertNotSame(cri1, cri2);

        // Allocate connections
        ManagedConnection mc1 = mcf.createManagedConnection(null, cri1);
        ManagedConnection mc2 = mcf.createManagedConnection(null, cri2);

        // Check if not same
        assertTrue(mc1 != mc2);

        // Create a sef of connections
        HashSet connectionSet = new HashSet();
        connectionSet.add(mc1);
        connectionSet.add(mc2);

        // Match the first connection
        JCAConnectionRequestInfo cri3 = new JCAConnectionRequestInfo(cri1);
        assertTrue((cri1 != cri3) && cri1.equals(cri3));
        ManagedConnection mc3 = mcf.matchManagedConnections(connectionSet, null, cri3);
        assertTrue(mc1 == mc3);

        // Match the second connection
        JCAConnectionRequestInfo cri4 = new JCAConnectionRequestInfo(cri2);
        assertTrue((cri2 != cri4) && cri2.equals(cri4));
        ManagedConnection mc4 = mcf.matchManagedConnections(connectionSet, null, cri4);
        assertTrue(mc2 == mc4);
    }
View Full Code Here

     * Test the connection matching.
     */
    public void testMatching() throws Exception {

        // Create connection request infos
        JCAConnectionRequestInfo cri1 = new JCAConnectionRequestInfo(JCR_SUPERUSER, JCR_WORKSPACE);
        JCAConnectionRequestInfo cri2 = new JCAConnectionRequestInfo(JCR_ANONUSER, JCR_WORKSPACE);

        // Check if not same
        assertNotSame(cri1, cri2);

        // Allocate connections
        ManagedConnection mc1 = mcf.createManagedConnection(null, cri1);
        ManagedConnection mc2 = mcf.createManagedConnection(null, cri2);

        // Check if not same
        assertTrue(mc1 != mc2);

        // Create a sef of connections
        HashSet connectionSet = new HashSet();
        connectionSet.add(mc1);
        connectionSet.add(mc2);

        // Match the first connection
        JCAConnectionRequestInfo cri3 = new JCAConnectionRequestInfo(cri1);
        assertTrue((cri1 != cri3) && cri1.equals(cri3));
        ManagedConnection mc3 = mcf.matchManagedConnections(connectionSet, null, cri3);
        assertTrue(mc1 == mc3);

        // Match the second connection
        JCAConnectionRequestInfo cri4 = new JCAConnectionRequestInfo(cri2);
        assertTrue((cri2 != cri4) && cri2.equals(cri4));
        ManagedConnection mc4 = mcf.matchManagedConnections(connectionSet, null, cri4);
        assertTrue(mc2 == mc4);
    }
View Full Code Here

     */
    public void testMatching()
            throws Exception {

        // Create connection request infos
        JCAConnectionRequestInfo cri1 = new JCAConnectionRequestInfo(JCR_SUPERUSER, JCR_WORKSPACE);
        JCAConnectionRequestInfo cri2 = new JCAConnectionRequestInfo(JCR_ANONUSER, JCR_WORKSPACE);

        // Check if not same
        assertNotSame(cri1, cri2);

        // Allocate connections
        ManagedConnection mc1 = mcf.createManagedConnection(null, cri1);
        ManagedConnection mc2 = mcf.createManagedConnection(null, cri2);

        // Check if not same
        assertTrue(mc1 != mc2);

        // Create a sef of connections
        HashSet connectionSet = new HashSet();
        connectionSet.add(mc1);
        connectionSet.add(mc2);
       
        // Match the first connection
        JCAConnectionRequestInfo cri3 = new JCAConnectionRequestInfo(cri1);
        assertTrue((cri1 != cri3) && cri1.equals(cri3));
        ManagedConnection mc3 = mcf.matchManagedConnections(connectionSet, null, cri3);
        assertTrue(mc1 == mc3);

        // Match the second connection
        JCAConnectionRequestInfo cri4 = new JCAConnectionRequestInfo(cri2);
        assertTrue((cri2 != cri4) && cri2.equals(cri4));
        ManagedConnection mc4 = mcf.matchManagedConnections(connectionSet, null, cri4);
        assertTrue(mc2 == mc4);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jca.JCAConnectionRequestInfo

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.