Package org.waveprotocol.wave.model.document.operation.impl

Examples of org.waveprotocol.wave.model.document.operation.impl.DocOpBuffer


  }

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

    DocOpBuffer ba = new DocOpBuffer();
    ba.characters("a");
    DocOp da = ba.finish();
    DocOpBuffer bb = new DocOpBuffer();
    bb.deleteCharacters("a");
    DocOp db = bb.finish();

    CoreWaveletDocumentOperation a1 = new CoreWaveletDocumentOperation("a", da);
    CoreWaveletDocumentOperation a2 = new CoreWaveletDocumentOperation("a", da);
    CoreWaveletDocumentOperation b1 = new CoreWaveletDocumentOperation("a", db);
    CoreWaveletDocumentOperation b2 = new CoreWaveletDocumentOperation("a", db);
View Full Code Here


public class RangeNormalizerTest extends TestCase {

  public void testMultipleRetainNormalization() {
    RangeNormalizer<DocOp> normalizer =
        new RangeNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.characters("a");
    normalizer.retain(1);
    normalizer.retain(1);
    normalizer.retain(1);
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testEmptyRetainNormalization() {
    RangeNormalizer<DocOp> normalizer =
        new RangeNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.characters("a");
    normalizer.retain(0);
    normalizer.characters("b");
    normalizer.retain(1);
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testMultipleCharactersNormalization() {
    RangeNormalizer<DocOp> normalizer =
        new RangeNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.characters("a");
    normalizer.characters("b");
    normalizer.characters("c");
    normalizer.retain(1);
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testEmptyCharactersNormalization() {
    RangeNormalizer<DocOp> normalizer =
        new RangeNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.characters("");
    normalizer.retain(1);
    DocOp docOp = normalizer.finish();
    DocOp expected = new DocOpBuilder()
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testMultipleDeleteCharactersNormalization() {
    RangeNormalizer<DocOp> normalizer =
        new RangeNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.deleteCharacters("a");
    normalizer.deleteCharacters("b");
    normalizer.deleteCharacters("c");
    normalizer.retain(1);
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testEmptyDeleteCharactersNormalization() {
    RangeNormalizer<DocOp> normalizer =
        new RangeNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.deleteCharacters("");
    normalizer.retain(1);
    DocOp docOp = normalizer.finish();
    DocOp expected = new DocOpBuilder()
View Full Code Here

      .updateValues("y", "n", "f")
      .build();

  public void testAnnotationNormalization1() {
    AnnotationsNormalizer<DocOp> normalizer =
        new AnnotationsNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.annotationBoundary(ANNOTATIONS1);
    normalizer.retain(1);
    normalizer.annotationBoundary(ANNOTATIONS2);
    normalizer.retain(1);
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testAnnotationNormalization2() {
    AnnotationsNormalizer<DocOp> normalizer =
        new AnnotationsNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.annotationBoundary(ANNOTATIONS1);
    normalizer.annotationBoundary(ANNOTATIONS2);
    normalizer.retain(1);
    normalizer.annotationBoundary(ANNOTATIONS3);
View Full Code Here

    assertTrue(OpComparators.SYNTACTIC_IDENTITY.equal(expected, docOp));
  }

  public void testAnnotationNormalization3() {
    AnnotationsNormalizer<DocOp> normalizer =
        new AnnotationsNormalizer<DocOp>(new DocOpBuffer());
    normalizer.retain(1);
    normalizer.annotationBoundary(ANNOTATIONS1);
    normalizer.retain(1);
    normalizer.annotationBoundary(ANNOTATIONS2);
    normalizer.annotationBoundary(ANNOTATIONS3);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.impl.DocOpBuffer

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.