new RmiTransportWriter(receiver, repositoryHash, "theFilename");
}
@Test
public void testSeriesOfWrites() throws JournalException, IOException {
RmiTransportWriter writer =
new RmiTransportWriter(receiver, repositoryHash, "theFilename");
assertCorrectNumberOfCalls(receiver, 1, 0, 0);
String text1 = "Some silly text";
char[] chars = text1.toCharArray();
writer.write(chars, 0, text1.length());
assertCorrectNumberOfCalls(receiver, 1, 1, 0);
assertEquals("unexpected text 1", text1, receiver.getText());
assertCorrectItemHash(receiver, 0);
String text2 = "This is something else";
writer.write(text2);
assertCorrectNumberOfCalls(receiver, 1, 2, 0);
assertEquals("unexpected text 2", text2, receiver.getText());
assertCorrectItemHash(receiver, 1);
String text3 = "What's going on?";
writer.write(text3, 3, 8);
assertCorrectNumberOfCalls(receiver, 1, 3, 0);
assertEquals("unexpected text 3", text3.substring(3, 11), receiver
.getText());
assertCorrectItemHash(receiver, 2);
}