use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestDQPCoreRequestHandling method testRemoveConnectorInfo.
public void testRemoveConnectorInfo() {
DQPCore rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
// $NON-NLS-1$
RequestMessage r0 = new RequestMessage("foo");
RequestID requestID = new RequestID(SESSION_STRING, 1);
RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
AtomicRequestMessage atomicReq = new AtomicRequestMessage(workItem.requestMsg, workItem.getDqpWorkContext(), 1);
DataTierTupleSource info = Mockito.mock(DataTierTupleSource.class);
workItem.addConnectorRequest(atomicReq.getAtomicRequestID(), info);
workItem.closeAtomicRequest(atomicReq.getAtomicRequestID());
DataTierTupleSource arInfo = workItem.getConnectorRequest(atomicReq.getAtomicRequestID());
assertNull(arInfo);
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestDQPCoreRequestHandling method testGetConnectorInfo.
public void testGetConnectorInfo() {
DQPCore rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
// $NON-NLS-1$
RequestMessage r0 = new RequestMessage("foo");
RequestID requestID = new RequestID(SESSION_STRING, 1);
RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
AtomicRequestMessage atomicReq = new AtomicRequestMessage(workItem.requestMsg, workItem.getDqpWorkContext(), 1);
DataTierTupleSource info = Mockito.mock(DataTierTupleSource.class);
workItem.addConnectorRequest(atomicReq.getAtomicRequestID(), info);
DataTierTupleSource arInfo = workItem.getConnectorRequest(atomicReq.getAtomicRequestID());
assertTrue(arInfo == info);
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestDQPCoreRequestHandling method testAddRequest.
public void testAddRequest() {
DQPCore rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
// $NON-NLS-1$
RequestMessage r0 = new RequestMessage("foo");
RequestID requestID = new RequestID(SESSION_STRING, 1);
addRequest(rm, r0, requestID, null, null);
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestDQPCoreRequestHandling method testGetRequestsSessionToken2.
/**
* Test for Collection getRequests(SessionToken) - 1 request
*/
public void testGetRequestsSessionToken2() {
DQPCore rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
Set<RequestID> reqs = new HashSet<RequestID>();
RequestID id = addRequest(rm, SESSION_STRING, 1);
reqs.add(id);
Collection<RequestMetadata> actualReqs = rm.getRequestsForSession(SESSION_STRING);
compareReqInfos(reqs, actualReqs);
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestRequestID method testGetters1.
public void testGetters1() {
// $NON-NLS-1$
String connID = "100";
long executionID = 200;
RequestID r = new RequestID(connID, executionID);
// $NON-NLS-1$
assertEquals("Lost connectionID", connID, r.getConnectionID());
// $NON-NLS-1$
assertEquals("Lost executionID", executionID, r.getExecutionID());
// $NON-NLS-1$ //$NON-NLS-2$
assertEquals("Wrong string representation", "100.200", r.toString());
}
Aggregations