Package javax.resource.spi

Examples of javax.resource.spi.ConnectionRequestInfo


      }
   }

   public Connection getConnection(String user, String password) throws SQLException
   {
      ConnectionRequestInfo cri = new WrappedConnectionRequestInfo(user, password);
      try
      {
         WrappedConnection wc = (WrappedConnection) cm.allocateConnection(mcf, cri);
         wc.setDataSource(this);
         return wc;
View Full Code Here


        assertEquals("Got back what we set", s, mc.getSubject());
    }

    @Test
    public void testGetSetConnectionRequestInfo() {
        ConnectionRequestInfo ri = new ConnectionRequestInfo() {
        };

        mc.setConnectionRequestInfo(ri);
        assertEquals("Got back what we set", ri, mc.getConnectionRequestInfo());
    }
View Full Code Here

    @Test
    public void testMatchConnectionSameConnectioRequestInfoNotBound() throws Exception {
        Subject subject = null;
        Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<AbstractManagedConnectionImpl>();
        ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
        DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
        connectionSet.add(con1);

        ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
        assertEquals(con1, mcon);
View Full Code Here

    @Test
    public void testMatchConnectionSameConnectioRequestInfoBound() throws Exception {
        Subject subject = null;
        Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<AbstractManagedConnectionImpl>();
        ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
        DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
        con1.setBound(true);
        connectionSet.add(con1);

        ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
View Full Code Here

        assertEquals(con1, mcon);
    }

    @Test
    public void testMatchConnectionDifferentConnectioRequestInfoNotBound() throws Exception {
        ConnectionRequestInfo cri1 = new DummyConnectionRequestInfo();
        ConnectionRequestInfo cri2 = new DummyConnectionRequestInfo();

        Subject subject = null;
        assertTrue("request info object are differnt", cri1 != cri2);

        Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<AbstractManagedConnectionImpl>();
View Full Code Here

        assertEquals("incorrect connection returned", con1, mcon);
    }

    @Test
    public void testMatchConnectionDifferentConnectioRequestInfoBound() throws Exception {
        ConnectionRequestInfo cri1 = new DummyConnectionRequestInfo();
        ConnectionRequestInfo cri2 = new DummyConnectionRequestInfo();

        Subject subject = null;

        assertTrue("request info object are differnt", cri1 != cri2);
View Full Code Here

    @Test
    public void testMatchConnectionInvalidatedWithSameConnectioRequestInfo() throws Exception {
        Subject subject = null;
        Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<AbstractManagedConnectionImpl>();
        ConnectionRequestInfo cri = new DummyConnectionRequestInfo();

        DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
        con1.setBound(true);
        con1.setCon(connectionSet);
        connectionSet.add(con1);
View Full Code Here

        assertEquals("Got back what we set", s, mc.getSubject());
    }

    @Test
    public void testGetSetConnectionRequestInfo() {
        ConnectionRequestInfo ri = new ConnectionRequestInfo() {
        };

        mc.setConnectionRequestInfo(ri);
        assertEquals("Got back what we set", ri, mc.getConnectionRequestInfo());
    }
View Full Code Here

    @Test
    public void testMatchConnectionSameConnectioRequestInfoNotBound() throws Exception {
        Subject subject = null;
        Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<AbstractManagedConnectionImpl>();
        ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
        DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
        connectionSet.add(con1);

        ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
        assertEquals(con1, mcon);
View Full Code Here

    @Test
    public void testMatchConnectionSameConnectioRequestInfoBound() throws Exception {
        Subject subject = null;
        Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<AbstractManagedConnectionImpl>();
        ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
        DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
        con1.setBound(true);
        connectionSet.add(con1);

        ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
View Full Code Here

TOP

Related Classes of javax.resource.spi.ConnectionRequestInfo

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.