assertEquals(data, ((H2HTestData) futureGet.getData().object()).getTestString());
}
@Test
public void testPutProcessFailure() throws NoPeerConnectionException, InvalidProcessStateException {
NetworkManager putter = network.get(0);
putter.getConnection().getPeer().getPeerBean().storage(new DenyingPutTestStorage());
NetworkManager proxy = network.get(1);
proxy.getConnection().getPeer().getPeerBean().storage(new DenyingPutTestStorage());
String locationKey = proxy.getNodeId();
String contentKey = NetworkTestUtil.randomString();
String data = NetworkTestUtil.randomString();
// initialize the process and the one and only step to test
TestPutProcessStep putStep = new TestPutProcessStep(locationKey, contentKey, new H2HTestData(data),
putter.getDataManager());
TestProcessComponentListener listener = new TestProcessComponentListener();
putStep.attachListener(listener);
putStep.start();
// wait for the process to finish
UseCaseTestUtil.waitTillFailed(listener, 10);
FutureGet futureGet = proxy.getDataManager().getUnblocked(
new Parameters().setLocationKey(locationKey).setContentKey(contentKey));
futureGet.awaitUninterruptibly();
assertNull(futureGet.getData());
}