Package com.google.wave.api

Examples of com.google.wave.api.OperationRequest


    EventMessageBundle messages = new EventMessageBundle(ROBOT_NAME.toEmailAddress(), "");
    messages.addEvent(new DocumentChangedEvent(null, null, ALEX.getAddress(), 0L, "b+1234"));
    when(eventGenerator.generateEvents(
        any(WaveletAndDeltas.class), anyMap(), any(EventDataConverter.class))).thenReturn(messages);

    OperationRequest op = new OperationRequest("wavelet.fetch", "op1");
    List<OperationRequest> ops = Collections.singletonList(op);
    when(connector.sendMessageBundle(
        any(EventMessageBundle.class), eq(robot), any(ProtocolVersion.class))).thenReturn(ops);

    enqueueEmptyWavelet();
View Full Code Here


  protected static final ParticipantId BOB = ParticipantId.ofUnsafe("bob@example.com");
  protected static final ParticipantId ROBOT = ParticipantId.ofUnsafe("robot@example.com");

  protected static OperationRequest operationRequest(OperationType opType, String operationId,
      String rootBlipId, Parameter... params) {
    return new OperationRequest(opType.method(), operationId, s(WAVE_ID), s(WAVELET_ID),
        rootBlipId, params);
  }
View Full Code Here

  }

  /** Creates an operation request. */
  protected static OperationRequest operationRequest(OperationType opType, String rootBlipId,
      Parameter... params) {
    return new OperationRequest(opType.method(), OPERATION_ID, s(WAVE_ID), s(WAVELET_ID),
        rootBlipId, params);
  }
View Full Code Here

        rootBlipId, params);
  }

  /** Creates an operation request. */
  protected static OperationRequest operationRequest(OperationType opType, Parameter... params) {
    return new OperationRequest(opType.method(), OPERATION_ID, s(WAVE_ID), s(WAVELET_ID), params);
  }
View Full Code Here

            conversationUtil, validator, tokenContainer);
  }

  public void testDoPostExecutesAndWritesResponse() throws Exception {
    String operationId = "op1";
    OperationRequest operation = new OperationRequest("wavelet.create", operationId);
    List<OperationRequest> operations = Collections.singletonList(operation);
    when(robotSerializer.deserializeOperations(anyString())).thenReturn(operations);
    String responseValue = "response value";
    when(robotSerializer.serialize(any(), any(Type.class), any(ProtocolVersion.class))).thenReturn(
        responseValue);
View Full Code Here

    when(robot.getAccount()).thenReturn(ROBOT_ACCOUNT);
  }

  public void testSuccessfulSendMessageBundle() throws Exception {
    final List<OperationRequest> expectedOperations = Collections.unmodifiableList(
        Lists.newArrayList(new OperationRequest("wavelet.setTitle", "op1")));

    when(serializer.serialize(BUNDLE, PROTOCOL_VERSION)).thenReturn(SERIALIZED_BUNDLE);
    when(connection.postJson(TEST_RPC_ENDPOINT, SERIALIZED_BUNDLE)).thenReturn(RETURNED_OPERATION);
    when(serializer.deserializeOperations(RETURNED_OPERATION)).thenReturn(expectedOperations);
View Full Code Here

    // Append a random blip to check that we actually make a new child blip
    conversation.getRootThread().appendBlip();

    // Create a child to the rootblip
    String rootBlipId = ConversationUtil.getRootBlipId(conversation);
    OperationRequest operation = operationRequest(OperationType.BLIP_CREATE_CHILD, rootBlipId,
        Parameter.of(ParamsProperty.BLIP_DATA, blipData));

    service.execute(operation, context, ALEX);

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
View Full Code Here

    assertEquals("New blip should be the first blip in the first reply thread",
        it.next().getFirstBlip(), newBlip);
  }

  public void testAppendBlip() throws Exception {
    OperationRequest operation = operationRequest(OperationType.WAVELET_APPEND_BLIP,
        Parameter.of(ParamsProperty.BLIP_DATA, blipData));

    OperationContextImpl context = helper.getContext();
    service.execute(operation, context, ALEX);
View Full Code Here

        context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    // Append the custom markup to the newly created blip.
    ConversationBlip markupBlip = conversation.getRootThread().appendBlip();

    OperationRequest operation = operationRequest(OperationType.DOCUMENT_APPEND_MARKUP,
        markupBlip.getId(), Parameter.of(ParamsProperty.CONTENT, markup));

    try {
      service.execute(operation, context, ALEX);
View Full Code Here

        context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    // Append the custom markup to the newly created blip.
    ConversationBlip markupBlip = conversation.getRootThread().appendBlip();

    OperationRequest operation = operationRequest(OperationType.DOCUMENT_APPEND_MARKUP,
        markupBlip.getId(), Parameter.of(ParamsProperty.CONTENT, markup));

    service.execute(operation, context, ALEX);

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
View Full Code Here

TOP

Related Classes of com.google.wave.api.OperationRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.