/** * Pretend the server echos back client's operation. */ public TestConfig serverDoEchoBack(int startVersion, long timestamp) throws TransformException, OperationException { TransformedWaveletDelta d = TransformedWaveletDelta.cloneOperations( clientMock.getParticipantId(), genSignature(startVersion + 1), timestamp, Arrays.asList(SERVER_UTIL.noOp())); serverConnectionMock.triggerServerDeltas(Collections.singletonList(d)); return this; }
/** * Pretend the server echos back client's operation. */ public TestConfig serverDoEchoBack(int startVersion, long timestamp) throws TransformException, OperationException { TransformedWaveletDelta d = TransformedWaveletDelta.cloneOperations( clientMock.getParticipantId(), genSignature(startVersion + 1), timestamp, Arrays.asList(SERVER_UTIL.noOp())); serverConnectionMock.triggerServerDeltas(Collections.singletonList(d)); return this; }
/** * Pretend the server echos back client's operation. Timestamp default to 0L. */ public TestConfig serverDoEchoBackDocOp(int startVersion, String blipId) throws TransformException, OperationException { TransformedWaveletDelta d = TransformedWaveletDelta.cloneOperations( clientMock.getParticipantId(), genSignature(startVersion + 1), 0L, Arrays.asList(noOpDocOp(blipId))); serverConnectionMock.triggerServerDeltas(Collections.singletonList(d)); return this; }
/** * Pretend the server echos back client's operation. Timestamp default to 0L. */ public TestConfig serverDoEchoBackDocOp(int startVersion, String blipId) throws TransformException, OperationException { TransformedWaveletDelta d = TransformedWaveletDelta.cloneOperations( clientMock.getParticipantId(), genSignature(startVersion + 1), 0L, Arrays.asList(noOpDocOp(blipId))); serverConnectionMock.triggerServerDeltas(Collections.singletonList(d)); return this; }
/** * Pretend client did some ops. * * Assumption: Noops are not merged in OperationMergingDelta. If they are, then tests * will break as they count the number of ops sent from the client to the server. * * @throws TransformException */ public TestConfig clientDoOps(int numOps) throws OperationException, TransformException { for (int i = 0; i < numOps; i++) { clientMock.addClientOperation(new NoOp(new WaveletOperationContext( clientMock.getParticipantId(), 0L, 1L))); } clientMock.flush(); return this; }
/** * Pretend client did some ops. * * Assumption: Noops are not merged in OperationMergingDelta. If they are, then tests * will break as they count the number of ops sent from the client to the server. * * @throws TransformException */ public TestConfig clientDoOps(int numOps) throws OperationException, TransformException { for (int i = 0; i < numOps; i++) { clientMock.addClientOperation(new NoOp(new WaveletOperationContext( clientMock.getParticipantId(), 0L, 1L))); } clientMock.flush(); return this; }
private WaveletOperation noOpDocOp(String blipId) { WaveletOperationContext context = new WaveletOperationContext( clientMock.getParticipantId(), 0L, 1L); BlipContentOperation blipOp = new BlipContentOperation(context, (new DocOpBuilder()).build()); return new WaveletBlipOperation(blipId, blipOp); } /**
private WaveletOperation noOpDocOp(String blipId) { WaveletOperationContext context = new WaveletOperationContext( clientMock.getParticipantId(), 0L, 1L); BlipContentOperation blipOp = new BlipContentOperation(context, (new DocOpBuilder()).build()); return new WaveletBlipOperation(blipId, blipOp); } /**