use of org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder in project controller by opendaylight.
the class RemoteProxyTransactionTest method testForwardToRemoteModifyCommit3Phase.
@Test
public void testForwardToRemoteModifyCommit3Phase() throws Exception {
final TestProbe probe = createProbe();
final ModifyTransactionRequestBuilder builder = new ModifyTransactionRequestBuilder(TRANSACTION_ID, probe.ref());
builder.setSequence(0L);
builder.setCommit(true);
final ModifyTransactionRequest request = builder.build();
final ModifyTransactionRequest received = testForwardToRemote(request, ModifyTransactionRequest.class);
Assert.assertEquals(request.getPersistenceProtocol(), received.getPersistenceProtocol());
Assert.assertEquals(request.getModifications(), received.getModifications());
Assert.assertEquals(request.getTarget(), received.getTarget());
}
use of org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder in project controller by opendaylight.
the class FrontendReadWriteTransactionTest method testReadAfterAbort.
@Test(expected = IllegalStateException.class)
public void testReadAfterAbort() throws RequestException {
final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(TX_ID, mock(ActorRef.class));
b.setSequence(0);
b.setAbort();
final TransactionRequest<?> abortReq = b.build();
assertNull(handleRequest(abortReq));
verify(mockParent).abortTransaction(same(shardTransaction), any(Runnable.class));
handleRequest(new ReadTransactionRequest(TX_ID, 0, mock(ActorRef.class), YangInstanceIdentifier.EMPTY, true));
}
use of org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder in project controller by opendaylight.
the class FrontendReadWriteTransactionTest method testDuplicateReady.
@Test
public void testDuplicateReady() throws RequestException {
final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(TX_ID, mock(ActorRef.class));
b.setSequence(0);
b.setReady();
final TransactionRequest<?> readyReq = b.build();
assertNotNull(handleRequest(readyReq));
verify(mockParent).finishTransaction(same(shardTransaction));
assertNotNull(handleRequest(readyReq));
verifyNoMoreInteractions(mockParent);
}
use of org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequestBuilder in project controller by opendaylight.
the class FrontendReadWriteTransactionTest method testDuplicateDirect.
@Test
public void testDuplicateDirect() throws RequestException {
final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(TX_ID, mock(ActorRef.class));
b.setSequence(0);
b.setCommit(false);
final TransactionRequest<?> readyReq = b.build();
assertNull(handleRequest(readyReq));
verify(mockParent).finishTransaction(same(shardTransaction));
assertNull(handleRequest(readyReq));
verifyNoMoreInteractions(mockParent);
}
Aggregations