Package org.waveprotocol.wave.model.document.bootstrap

Examples of org.waveprotocol.wave.model.document.bootstrap.BootstrapDocument.consume()


  /**
   * Stand-alone main() for quick experimentation.
   */
  public static void main(String[] args) throws OperationException {
    BootstrapDocument initialDoc = new BootstrapDocument();
    initialDoc.consume(new DocInitializationBuilder()
        .elementStart("blip", Attributes.EMPTY_MAP)
        .elementStart("p", Attributes.EMPTY_MAP)
        .characters("abc")
        .elementEnd()
        .elementEnd().build());
View Full Code Here


    p.setMaxOpeningComponents(10);

    RandomProvider r = RandomProviderImpl.ofSeed(2538);
    for (int i = 0; i < 200; i++) {
      BootstrapDocument doc = new BootstrapDocument();
      doc.consume(initialDoc.asOperation());
      for (int j = 0; j < 20; j++) {
        System.err.println("i=" + i + ", j=" + j);
        System.err.println("old: " + DocOpUtil.toXmlString(doc.asOperation()));
        System.err.println("old: " + DocOpUtil.toConciseString(doc.asOperation()));
        DocOp op = generate(r, p, doc);
View Full Code Here

        System.err.println("i=" + i + ", j=" + j);
        System.err.println("old: " + DocOpUtil.toXmlString(doc.asOperation()));
        System.err.println("old: " + DocOpUtil.toConciseString(doc.asOperation()));
        DocOp op = generate(r, p, doc);
        System.err.println("op:  " + DocOpUtil.toConciseString(op));
        doc.consume(op);
        System.err.println("new: " + DocOpUtil.toConciseString(doc.asOperation()));
        System.err.println("new: " + DocOpUtil.toXmlString(doc.asOperation()));
        if (!DocOpValidator.validate(null, DocumentSchema.NO_SCHEMA_CONSTRAINTS,
            doc.asOperation()).isValid()) {
          throw new RuntimeException("doc not valid");
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.