use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class DummyManagedConnectionFactoryImpl method testMatchConnectionInvalidatedWithSameConnectioRequestInfo.
@Test
public void testMatchConnectionInvalidatedWithSameConnectioRequestInfo() throws Exception {
Subject subject = null;
Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<>();
ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
con1.setBound(true);
con1.setCon(connectionSet);
connectionSet.add(con1);
ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
assertNull("Connection must be null", mcon);
}
use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class DummyManagedConnectionFactoryImpl method testMatchConnectionDifferentConnectioRequestInfoNotBound.
@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<>();
DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri1, subject);
connectionSet.add(con1);
ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri2);
assertEquals("incorrect connection returned", con1, mcon);
}
use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class DummyManagedConnectionFactoryImpl method testMatchConnectionSameConnectioRequestInfoBound.
@Test
public void testMatchConnectionSameConnectioRequestInfoBound() throws Exception {
Subject subject = null;
Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<>();
ConnectionRequestInfo cri = new DummyConnectionRequestInfo();
DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri, subject);
con1.setBound(true);
connectionSet.add(con1);
ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri);
assertEquals(con1, mcon);
}
use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class DummyManagedConnectionFactoryImpl method testMatchConnectionDifferentConnectioRequestInfoBound.
@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);
Set<AbstractManagedConnectionImpl> connectionSet = new HashSet<>();
DummyManagedConnectionImpl con1 = new DummyManagedConnectionImpl(mcf, cri1, subject);
con1.setBound(true);
connectionSet.add(con1);
ManagedConnection mcon = mcf.matchManagedConnections(connectionSet, subject, cri2);
assertNull("should not get a match", mcon);
}
use of javax.resource.spi.ConnectionRequestInfo in project cxf by apache.
the class ManagedConnectionImplTest method testGetSetConnectionRequestInfo.
@Test
public void testGetSetConnectionRequestInfo() {
ConnectionRequestInfo ri = new ConnectionRequestInfo() {
};
mc.setConnectionRequestInfo(ri);
assertEquals("Got back what we set", ri, mc.getConnectionRequestInfo());
}
Aggregations