Package org.waveprotocol.wave.model.wave

Examples of org.waveprotocol.wave.model.wave.ParticipantId


    assertEquals(CollectionUtils.immutableSet(p("public@a.gwave.com"), p("joe@example.com")),
        indexability.getIndexDecisions());
  }

  protected ParticipantId p(String address) {
    return new ParticipantId(address);
  }
View Full Code Here


    verify(listener, never()).onChanged();
    reset(listener);
  }

  protected ParticipantId p(String address) {
    return new ParticipantId(address);
  }
View Full Code Here

    // Test both (de)serialising a single operation...
    assertEquals(op, CoreWaveletOperationSerializer.deserialize(
        CoreWaveletOperationSerializer.serialize(op), OP_CONTEXT));

    List<WaveletOperation> ops = ImmutableList.of(op, op, op);
    ParticipantId author = new ParticipantId("kalman@google.com");
    HashedVersion hashedVersion = HashedVersion.unsigned(0);
    WaveletDelta delta = new WaveletDelta(author, hashedVersion, ops);
    ProtocolWaveletDelta serialized = CoreWaveletOperationSerializer.serialize(delta);
    WaveletDelta deserialized = CoreWaveletOperationSerializer.deserialize(serialized);
    assertEquals(hashedVersion.getVersion(), serialized.getHashedVersion().getVersion());
View Full Code Here

  public void testNoOp() {
    assertReversible(new NoOp(OP_CONTEXT));
  }

  public void testAddParticipant() {
    assertReversible(new AddParticipant(OP_CONTEXT, new ParticipantId("kalman@google.com")));
  }
View Full Code Here

  public void testAddParticipant() {
    assertReversible(new AddParticipant(OP_CONTEXT, new ParticipantId("kalman@google.com")));
  }

  public void testRemoveParticipant() {
    assertReversible(new RemoveParticipant(OP_CONTEXT, new ParticipantId("kalman@google.com")));
  }
View Full Code Here

   * @return a simple wavelet.
   */
  public static WaveletData createSimpleWaveletData() {
    WaveletName name = WaveletName.of(
        WaveId.of("example.com", "w+abc123"), WaveletId.of("example.com", "conv+root"));
    ParticipantId creator = ParticipantId.ofUnsafe("sam@example.com");
    long time = 1234567890;

    WaveletData wavelet = WaveletDataUtil.createEmptyWavelet(name, creator,
        HashedVersion.unsigned(0), time);

View Full Code Here

  public void testRegisterNewUserEnabled() throws Exception {
    attemptToRegister(req, resp, "foo@example.com", "internet", false);

    verify(resp).setStatus(HttpServletResponse.SC_OK);
    ParticipantId participantId = ParticipantId.ofUnsafe("foo@example.com");
    AccountData account = store.getAccount(participantId);
    assertNotNull(account);
    assertTrue(account.asHuman().getPasswordDigest().verify("internet".toCharArray()));
    verify(welcomeBot).greet(eq(participantId));
  }
View Full Code Here

  public void testRegisterNewUserDisabled() throws Exception {
    attemptToRegister(req, resp, "foo@example.com", "internet", true);

    verify(resp).setStatus(HttpServletResponse.SC_FORBIDDEN);
    ParticipantId participantId = ParticipantId.ofUnsafe("foo@example.com");
    AccountData account = store.getAccount(participantId);
    assertNull(account);
  }
View Full Code Here

   * Sets up the test supplement with a real wave model behind it.
   */
  private WaveletBasedConversation setUpWithWaveModel() {
    FakeConversationView view = FakeConversationView.builder().with(schemas).build();
    WaveletBasedConversation conversation = view.createRoot();
    ParticipantId viewer = new ParticipantId("nobody@nowhere.com");
    supplement = SupplementedWaveImpl.create(substrate, view, viewer, DefaultFollow.ALWAYS);
    return conversation;
  }
View Full Code Here

   */
  public void testCopySnapshotDoesNotCauseWrites() {
    FakeConversationView view = FakeConversationView.builder().with(schemas).build();
    Wavelet udw = view.getWaveView().createUserData();
    PrimitiveSupplement substrate = WaveletBasedSupplement.create(udw);
    ParticipantId viewer = new ParticipantId("nobody@google.com");
    SupplementedWave swave = SupplementedWaveImpl.create(substrate, view, viewer, ALWAYS);

    // Do something that is readable
    view.createRoot().addParticipant(viewer);
    swave.markAsRead();
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.wave.ParticipantId

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.