Package org.waveprotocol.wave.model.wave

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


    }
  }

  public void testOpenExistingWaveletForNonParticipantThrowsInvalidRequestException()
      throws Exception {
    ParticipantId nonExistingParticipant = ParticipantId.ofUnsafe("nonexisting@example.com");
    assertFalse("This participant should not exist",
        waveletData.getParticipants().contains(nonExistingParticipant));
    try {
      operationContext.openWavelet(WAVE_ID, WAVELET_ID, nonExistingParticipant);
      fail("Expected InvalidRequestException for a non-existing participant");
View Full Code Here


        hashedVersionZero, 0L);
    robot.waveletUpdate(waveletData, DeltaSequence.empty());

    // We are making an delta which applies to version 1, however the robot only
    // knows about version 0.
    ParticipantId bob = ParticipantId.of("bob@exmaple.com");
    HashedVersion v2 = HashedVersion.unsigned(2);
    WaveletOperation addBob = new AddParticipant(new WaveletOperationContext(ALEX, 0L, 1, v2), bob);
    addBob.apply(waveletData);
    waveletData.setHashedVersion(v2);
    waveletData.setVersion(2);
View Full Code Here

    verify(waveletProvider).submitRequest(
        eq(WAVELET_NAME), any(ProtocolWaveletDelta.class), eq(requestListener));
  }
 
  public void testToProxyParticipant() throws Exception {
    ParticipantId participant = ParticipantId.of("foo@example.com");
    ParticipantId proxyParticipant = ParticipantId.of("foo+proxyFor@example.com");
    assertEquals(proxyParticipant, OperationUtil.toProxyParticipant(participant, "proxyFor"));
    // If participant is already a proxy - return without a change.
    assertEquals(proxyParticipant, OperationUtil.toProxyParticipant(proxyParticipant, "proxyFor"));
  }
View Full Code Here

    DeltaTestUtil util = new DeltaTestUtil(USER_ID);

    // Receive an operation from the server that doesn't affect the document.
    TransformedWaveletDelta delta1 =
        util.delta(1L, util.addParticipant(new ParticipantId("reuben@example.com")));
    openCallback.onUpdate(new FakeWaveViewServiceUpdate()
        .setWaveletId(GENERATED_WAVELET_ID).addDelta(delta1));

    assertEquals(2, createdWavelet.getParticipantIds().size());
View Full Code Here

    // Check participant list
    assertEquals(participants, wavelet.getParticipants());

    // Add lots of participants
    for (int i = 0; i < 10; i++) {
      ParticipantId p = new ParticipantId("abc" + i + "@example.com");
      op = new AddParticipant(createContext(), p);
      participants.add(p);
      op.apply(wavelet);
    }
View Full Code Here

    assertEquals(participants, currentParticipantList());

    // The reverse of removing any of the participants is an AddParticipant with the
    // correct position which, when applied, rolls back the participant list.
    for (int i = 0; i < participants.size(); i++) {
      ParticipantId p = participants.get(i);
      List<? extends WaveletOperation> reverse =
          new RemoveParticipant(createContext(), p).applyAndReturnReverse(wavelet);
      assertEquals(
        Arrays.<WaveletOperation>asList(new AddParticipant(createContext(), p, i)),
        reverse);
View Full Code Here

      EditorStaticDeps.setPopupChromeProvider(PopupChromeFactory.getProvider());

      // Eagerly install some features.
      WavePanelImpl panel = stageTwo.getStageOne().getWavePanel();
      FocusFramePresenter focus = stageTwo.getStageOne().getFocusFrame();
      ParticipantId user = stageTwo.getSignedInUser();
      ModelAsViewProvider models = stageTwo.getModelAsViewProvider();
      ProfileManager profiles = stageTwo.getProfileManager();

      MenuMessages menuMessages = GWT.create(MenuMessages.class);
      ParticipantMessages participantMessages = GWT.create(ParticipantMessages.class);
View Full Code Here

  public void testTypes() {
    OpEquator eq = OpComparators.SYNTACTIC_IDENTITY;

    CoreWaveletOperation a = CoreNoOp.INSTANCE;
    CoreWaveletOperation b = new CoreAddParticipant(new ParticipantId(""));
    CoreWaveletOperation c = new CoreRemoveParticipant(new ParticipantId(""));
    CoreWaveletOperation d = new CoreWaveletDocumentOperation("", new DocOpBuffer().finish());

    assertTrue (a.equals(a));
    assertFalse(a.equals(b));
    assertFalse(a.equals(c));
View Full Code Here

  }

  public void testAddParticipant() {
    OpEquator eq = OpComparators.SYNTACTIC_IDENTITY;

    CoreAddParticipant a1 = new CoreAddParticipant(new ParticipantId("a"));
    CoreAddParticipant a2 = new CoreAddParticipant(new ParticipantId("a"));
    CoreAddParticipant b1 = new CoreAddParticipant(new ParticipantId("b"));
    CoreAddParticipant b2 = new CoreAddParticipant(new ParticipantId("b"));

    assertTrue(a1.equals(a1));
    assertTrue(a1.equals(a2));
    assertTrue(a2.equals(a1));
    assertTrue(a2.equals(a2));
View Full Code Here

  }

  public void testRemoveParticipant() {
    OpEquator eq = OpComparators.SYNTACTIC_IDENTITY;

    CoreRemoveParticipant a1 = new CoreRemoveParticipant(new ParticipantId("a"));
    CoreRemoveParticipant a2 = new CoreRemoveParticipant(new ParticipantId("a"));
    CoreRemoveParticipant b1 = new CoreRemoveParticipant(new ParticipantId("b"));
    CoreRemoveParticipant b2 = new CoreRemoveParticipant(new ParticipantId("b"));

    assertTrue(a1.equals(a1));
    assertTrue(a1.equals(a2));
    assertTrue(a2.equals(a1));
    assertTrue(a2.equals(a2));
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.