/** * Submit this wavelet when the given {@code other} wavelet is submitted. * * Wavelets constructed outside of the event callback need to * be either explicitly submitted using {@code AbstractRobot.submit(Wavelet)} * or be associated with a different wavelet that will be submitted or is part * of the event callback. * * @param other the other wavelet whose operation queue will be joined with. */ public void submitWith(Wavelet other) { operationQueue.submitWith(other.operationQueue); }
public void testSubmitWith() throws Exception { OperationQueue otherOpQueue = mock(OperationQueue.class); Set<String> participants = new LinkedHashSet<String>(); participants.add("foo@bar.com"); Map<String, String> roles = new HashMap<String, String>(); Map<String, BlipThread> threads = new HashMap<String, BlipThread>(); Wavelet other = new Wavelet(WAVE_ID, WAVELET_ID, "foo@bar.com", 1l, 1l, "Hello world", "blip1", null, roles, participants, new HashMap<String, String>(), Collections.<String>emptySet(), new HashMap<String, Blip>(), threads, otherOpQueue); wavelet.submitWith(other); verify(opQueue).submitWith(otherOpQueue); }
public void testSubmitWith() throws Exception { OperationQueue otherOpQueue = mock(OperationQueue.class); Set<String> participants = new LinkedHashSet<String>(); participants.add("foo@bar.com"); Map<String, String> roles = new HashMap<String, String>(); Map<String, BlipThread> threads = new HashMap<String, BlipThread>(); Wavelet other = new Wavelet(WAVE_ID, WAVELET_ID, "foo@bar.com", 1l, 1l, "Hello world", "blip1", null, roles, participants, new HashMap<String, String>(), Collections.<String>emptySet(), new HashMap<String, Blip>(), threads, otherOpQueue); wavelet.submitWith(other); verify(opQueue).submitWith(otherOpQueue); }
public void testSubmitWith() throws Exception { OperationQueue queue = new OperationQueue(); queue.createWavelet("example.com", Collections.<String>emptySet()); OperationQueue queue2 = new OperationQueue(); queue2.setTitleOfWavelet(wavelet, "My title"); queue2.submitWith(queue); List<OperationRequest> ops = queue.getPendingOperations(); assertEquals(2, ops.size()); assertEquals(OperationType.ROBOT_CREATE_WAVELET.method(), ops.get(0).getMethod()); assertEquals(OperationType.WAVELET_SET_TITLE.method(), ops.get(1).getMethod()); assertEquals(queue.getPendingOperations(), queue2.getPendingOperations()); }
public void testSubmitWith() throws Exception { OperationQueue queue = new OperationQueue(); queue.createWavelet("example.com", Collections.<String>emptySet()); OperationQueue queue2 = new OperationQueue(); queue2.setTitleOfWavelet(wavelet, "My title"); queue2.submitWith(queue); List<OperationRequest> ops = queue.getPendingOperations(); assertEquals(2, ops.size()); assertEquals(OperationType.ROBOT_CREATE_WAVELET.method(), ops.get(0).getMethod()); assertEquals(OperationType.WAVELET_SET_TITLE.method(), ops.get(1).getMethod()); assertEquals(queue.getPendingOperations(), queue2.getPendingOperations()); }