Examples of EventMessageBundle


Examples of com.google.wave.api.impl.EventMessageBundle

    String annotationKey = "key";
    String annotationValue = "value";
    rootBlip.getContent().setAnnotation(0, 1, annotationKey, annotationValue);

    EventMessageBundle messages = generateAndCheckEvents(EventType.ANNOTATED_TEXT_CHANGED);
    assertEquals("Expected one event only", 1, messages.getEvents().size());
    AnnotatedTextChangedEvent event = AnnotatedTextChangedEvent.as(messages.getEvents().get(0));
    assertEquals("Expected the key of the annotation", annotationKey, event.getName());
    assertEquals("Expected the value of the annotation", annotationValue, event.getValue());
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

    List<WaveletOperation> ops2 = Lists.newArrayList(output.getOps());
    HashedVersion endVersion2 = HashedVersion.unsigned(waveletData.getVersion());
    TransformedWaveletDelta delta2 = makeDeltaFromCapturedOps(ROBOT, ops2, endVersion2, 0L);
    output.clear();

    EventMessageBundle messages = generateEventsFromDeltas(delta1, delta2);
    assertEquals("Expected two events", 2, messages.getEvents().size());
    checkEventTypeWasGenerated(messages, EventType.WAVELET_SELF_ADDED,
        EventType.WAVELET_PARTICIPANTS_CHANGED);
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

    List<WaveletOperation> ops2 = Lists.newArrayList(output.getOps());
    HashedVersion endVersion2 = HashedVersion.unsigned(waveletData.getVersion());
    TransformedWaveletDelta delta2 = makeDeltaFromCapturedOps(ALEX, ops2, endVersion2, 0L);
    output.clear();

    EventMessageBundle messages = generateEventsFromDeltas(delta1, delta2);
    assertEquals("Expected three events", 3, messages.getEvents().size());
    checkEventTypeWasGenerated(messages, EventType.WAVELET_BLIP_CREATED,
        EventType.DOCUMENT_CHANGED, EventType.WAVELET_PARTICIPANTS_CHANGED);
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

    List<WaveletOperation> ops2 = output.getOps();
    HashedVersion endVersion2 = HashedVersion.unsigned(waveletData.getVersion());
    TransformedWaveletDelta delta2 = makeDeltaFromCapturedOps(ALEX, ops2, endVersion2, 0L);
    output.clear();

    EventMessageBundle messages = generateEventsFromDeltas(delta1, delta2);
    assertEquals("Expected three events", 3, messages.getEvents().size());
    checkEventTypeWasGenerated(messages, EventType.WAVELET_PARTICIPANTS_CHANGED,
        EventType.WAVELET_BLIP_CREATED, EventType.WAVELET_SELF_REMOVED);
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

   *         robot is subscribed to all possible events.
   *
   * @see #generateAndCheckEvents(EventType, ParticipantId)
   */
  private EventMessageBundle generateAndCheckEvents(EventType eventType) throws Exception {
    EventMessageBundle eventMessageBundle = generateAndCheckEvents(eventType, ALEX);
    return eventMessageBundle;
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

    // Put the wanted event in the capabilities map
    Map<EventType, Capability> capabilities = Maps.newHashMap();
    capabilities.put(eventType, new Capability(eventType));

    // Generate the events
    EventMessageBundle messages =
        eventGenerator.generateEvents(waveletAndDeltas, capabilities, CONVERTER);

    // Check that the event was generated and that no other types were generated
    checkEventTypeWasGenerated(messages, eventType);
    checkAllEventsAreInCapabilites(messages, capabilities);
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

    WaveletAndDeltas waveletAndDeltas =
        WaveletAndDeltas.create(waveletData, DeltaSequence.of(deltas));

    Map<EventType, Capability> capabilities = ALL_CAPABILITIES;
    // Generate the events
    EventMessageBundle messages =
        eventGenerator.generateEvents(waveletAndDeltas, capabilities, CONVERTER);
    return messages;
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

        return null;
      }
    }).when(gateway).updateRobotAccount(robot);

    // Generate no events on default
    EventMessageBundle emptyMessageBundle = new EventMessageBundle(ROBOT_NAME.toEmailAddress(), "");
    when(eventGenerator.generateEvents(
        any(WaveletAndDeltas.class), anyMap(), any(EventDataConverter.class))).thenReturn(
        emptyMessageBundle);
  }
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

        any(ReadableWaveletData.class), any(HashedVersion.class), eq(ACCOUNT));
  }

  @SuppressWarnings("unchecked")
  public void testProcessSendsBundleAndCallsOperationsApplicator() throws Exception {
    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);
View Full Code Here

Examples of com.google.wave.api.impl.EventMessageBundle

    BlipSubmittedEvent event1 = new BlipSubmittedEvent(null, null, "foo@test.com", 1l, "blip1");
    DocumentChangedEvent event2 = new DocumentChangedEvent(null, null, "foo@test.com", 1l, "blip1");
    WaveletTagsChangedEvent event3 = new WaveletTagsChangedEvent(null, null, "foo@test.com", 1l,
        "blip1");

    EventMessageBundle bundle = new EventMessageBundle("Foo", "http://gmodules.com/api/rpc");
    bundle.addEvent(event1);
    bundle.addEvent(event2);
    bundle.addEvent(event3);
    bundle.setWaveletData(waveletData);
    String json = new GsonFactory().create().toJson(bundle);

    MockWriter mockWriter = new MockWriter();
    robot.doPost(
        makeMockRequest(JSONRPC_PATH, new BufferedReader(new StringReader(json))),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.