Examples of BlipData


Examples of org.waveprotocol.wave.model.wave.data.BlipData

    BlipOperation op = new FakeBlipOperation(context);
    assertEquals(op.getContext(), context);
  }

  public void testApplyInvokesSubclassDoApply() throws Exception {
    BlipData data = createBlipData();
    FakeBlipOperation op = new FakeBlipOperation(context);

    op.apply(data);
    assertTrue(op.applied);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  /**
   * Tests that apply() updates the blip timestamp to match the context
   */
  public void testApplyUpdatesTimestamp() throws Exception {
    BlipData data = createBlipData();
    BlipOperation op = createSampleContentOperation();

    assertFalse(context.getTimestamp() == data.getLastModifiedTime());
    op.apply(data);
    // The last modified time is now the context time
    assertEquals(context.getTimestamp(), data.getLastModifiedTime());
    // The blip version is updated to match the wavelet version + 1 (but the op
    // doesn't actually increment the wavelet/blip version until it's applied
    // to a wavelet).
    assertEquals(waveletData.getVersion() + 1,
        data.getLastModifiedVersion());
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    assertEquals(waveletData.getVersion() + 1,
        data.getLastModifiedVersion());
  }

  public void testNoneContributorMethodLeavesContributors() throws Exception {
    BlipData data = createBlipData();

    BlipOperation op = createSampleContentOperation(UpdateContributorMethod.NONE);
    op.apply(data);
    assertEquals(data.getContributors(), noParticipants);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    op.apply(data);
    assertEquals(data.getContributors(), noParticipants);
  }

  public void testAddContributorMethodAddsNewContributor() throws Exception {
    BlipData data = createBlipData();

    BlipOperation op = createSampleContentOperation(UpdateContributorMethod.ADD);
    op.apply(data);
    assertTrue(data.getContributors().contains(fred));

    op = createSampleContentOperation(createJaneContext(), UpdateContributorMethod.ADD);
    op.apply(data);
    assertTrue(data.getContributors().contains(fred));
    assertTrue(data.getContributors().contains(jane));
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    assertTrue(data.getContributors().contains(fred));
    assertTrue(data.getContributors().contains(jane));
  }

  public void testAddContributorMethodDoesntDuplicateContributors() throws Exception {
    BlipData data = createBlipData();

    BlipOperation op = createSampleContentOperation(UpdateContributorMethod.ADD);
    op.apply(data);

    op = createSampleContentOperation(UpdateContributorMethod.ADD);
    op.apply(data);

    assertEquals(Collections.singleton(fred), data.getContributors());
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    assertEquals(Collections.singleton(fred), data.getContributors());
  }

  public void testReverseAddContributorRemovesContributor() throws Exception {
    BlipData data = createBlipData();

    BlipOperation op = createSampleContentOperation(UpdateContributorMethod.ADD);
    List<? extends BlipOperation> reverseOps = op.applyAndReturnReverse(data); // adds fred
    for (BlipOperation rop : reverseOps) {
      rop.apply(data);
    }

    assertEquals(noParticipants, data.getContributors());
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  private final static DocOp docOp = new DocOpBuilder().characters("Hello").build();

  public void testApply() throws OperationException {
    BlipContentOperation op = new BlipContentOperation(context, docOp);
    BlipData blip = waveletData.createDocument("root", jane, noParticipants,
        EmptyDocument.EMPTY_DOCUMENT, 0L, 0L);

    op.apply(blip);

    // the op eventually reached the document
    assertEquals(docOp, ((FakeDocument) blip.getContent()).getConsumed());
    // editing the document makes the op creator a blip contributor
    assertEquals(Collections.singleton(fred), blip.getContributors());
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    assertEquals(Collections.singleton(fred), blip.getContributors());
  }

  public void testReverseRestoresContent() throws OperationException {
    BlipContentOperation op = new BlipContentOperation(context, docOp);
    BlipData blip = waveletData.createDocument("root", fred, Collections.<ParticipantId>emptyList(),
        EmptyDocument.EMPTY_DOCUMENT, 0L, 0L);

    List<? extends BlipOperation> reverseOps = op.applyAndReturnReverse(blip);

    for (BlipOperation reverse : reverseOps) {
      reverse.apply(blip);
    }

    ExtraAsserts.checkContent("", blip);
    assertEquals(noParticipants, blip.getContributors());
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

  }

  private void assertWaveletMetadataIsInitialState() {
    assertWaveletVersion(0);
    assertWaveletSignature(HashedVersion.unsigned(0));
    BlipData blip = waveletData.getDocument(ROOT_BLIP);
    if (blip != null) {
      assertBlipVersion(ROOT_BLIP, 0);
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.BlipData

    assertEquals(oldLastModifiedTime, listener.getOldLastModifiedTime());
    assertEquals(45L, listener.getNewLastModifiedTime());
  }

  public void testBlipDataAddedEventReceived() {
    BlipData blip1 = createBlip("b+one");
    assertEquals(blip1, listener.getBlipDataAdded());
    BlipData blip2 = createBlip("b+two");
    assertEquals(blip2, listener.getBlipDataAdded());
  }
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.