Examples of Doc


Examples of anvil.doc.Doc

  /// @param ident Identifier of document to search for
  public static final Object[] p_getText = { "*type", null, "*ident", null };
  public Any m_getText(String type, String ident)
  {
    if (type != null) {
      Doc doc = _doc.findFirst(type, ident);
      return (doc != null) ? Any.create(doc.getText()) : UNDEFINED;
    } else {
      return Any.create(_doc.getText());
    }
  }
View Full Code Here

Examples of anvil.doc.Doc

  /// @param ident Identifier of document to search for
  public static final Object[] p_getHead = { "*type", null, "*ident", null };
  public Any m_getHead(String type, String ident)
  {
    if (type != null) {
      Doc doc = _doc.findFirst(type, ident);
      return (doc != null) ? Any.create(doc.getFirstSentence()) : UNDEFINED;
    } else {
      return Any.create(_doc.getFirstSentence());
    }
  }
View Full Code Here

Examples of anvil.doc.Doc

  /// @param ident Identifier of document to search for
  /// @return Doc or undefined, if there were no matching documents.
  public static final Object[] p_getChild = { "*type", null, "*ident", null };
  public Any m_getChild(String type, String ident)
  {
    Doc doc;
    if (type != null) {
      doc = _doc.findFirst(type, ident);
    } else {
      doc = _doc.getFirstChild();
    }
View Full Code Here

Examples of anvil.doc.Doc

  /// Returns next document (sibling).
  /// @synopsis Doc getNext()
  /// @return Doc or undefined, if there is no next sibling.
  public Any m_getNext()
  {
    Doc next = _doc.getNext();
    return (next != null) ? new AnyDoc(next) : UNDEFINED;
  }
View Full Code Here

Examples of com.azaptree.wadl.Doc

      if (command.hasXmlSchema()) {
        final Resource resource = new Resource();
        resource.setPath(commandName + ".xsd");
        resources.getResource().add(resource);

        final Doc doc = new Doc();
        doc.getContent().add("The command's XML schema is returned");
        resource.getDoc().add(doc);

        final Method method = new Method();
        method.setName("GET");
        resource.getMethodOrResource().add(method);
View Full Code Here

Examples of com.google.walkaround.slob.client.ChannelTestUtil.Doc

    DocOpScrub.setShouldScrubByDefault(false);
    r = RandomProviderImpl.ofSeed(seed);
    p = new Parameters();
    p.setMaxOpeningComponents(5);
    Doc client = new Doc();
    FakeServer server = new FakeServer(r, p);
    LinkedList<Integer> xhrResponses = Lists.newLinkedList();

    TransformQueue<DocOp> q = new TransformQueue<DocOp>(
        ChannelTestUtil.randomlyCompactingTransformer(0));
    q.init(0);

    int[] scenario = new int[8];

//    PrintStream out = System.out;
    PrintStream out = NULL_STREAM;

    int numConvergences = 0;
    for (int iter = 0; iter < numIterations; iter++) {
      Event e = randomEvent();
      out.println("\n" + iter + " " + e + " ========");
      eventCounts.put(e, (eventCounts.containsKey(e) ? eventCounts.get(e) : 0) + 1);
      switch (e) {
      case CLIENT_OP:
        DocOp op = randomOp(client);
        q.clientOp(op);
        break;
      case CLIENT_SEND:
        if (!q.hasUnacknowledgedClientOps() && q.hasQueuedClientOps()) {
          server.sendToServer(q.revision(), q.pushQueuedOpsToUnacked());
        }
        break;
      case SERVER_OP:
        server.randomServerOp();
        break;
      case XHR_RESPONSE:
        while (!xhrResponses.isEmpty()) {
          int responseVersion = xhrResponses.remove();
          q.ackOpsIfVersionMatches(responseVersion);
        }
        break;
      case CLIENT_RECEIVE:
      case CLIENT_RECEIVE_ALL:
        while (server.channelPending()) {
          UnitPackage p = server.clientReceive();
          if (p.clientSourced) {
            out.println("client");
            if (!q.expectedAck(p.resultingRevision)) {
              q.ackClientOp(p.resultingRevision);
            }
          } else {
            q.serverOp(p.resultingRevision, p.onlyOp());
          }

          if (e == Event.CLIENT_RECEIVE) {
            break;
          }
        }
        break;
      case CLIENT_APPLY:
        if (q.hasServerOp()) {
          client.consume(q.removeServerOp());
        }
        break;
      case SERVER_RECEIVE:
        if (server.serverReceive()) {
          xhrResponses.add(server.revision());
        }
        break;
      default:
        throw new AssertionError("Unhandled event");
      }

//      out.println(server);
//      out.println(q);
//      out.println(client);

      // Extra checking, simulate convergence
      if (iter % 10 == 0) {
        Doc clientCopy = client.copy();
        Doc serverCopy = server.at(q.revision()).copy();
        for (DocOp pendingServerOp : q.serverOps) {
          clientCopy.consume(pendingServerOp);
        }
        for (DocOp pendingClientOp : q.unackedClientOps) {
          serverCopy.consume(pendingClientOp);
        }
        for (DocOp pendingClientOp : q.queuedClientOps) {
          serverCopy.consume(pendingClientOp);
        }
        assertEquals("Unequal states", clientCopy.repr(), serverCopy.repr());
      }

      boolean qco = q.hasQueuedClientOps();
      boolean uco = q.hasUnacknowledgedClientOps();
      boolean so = q.hasServerOp();
View Full Code Here

Examples of com.iqbon.jcms.domain.Doc

    int number = docDAO.insertDoc(doc);
    logger.info(number);
  }

  public void testQueryDocById() {
    Doc one = docDAO.queryDocById("11111111111");
    logger.info(ToStringBuilder.reflectionToString(one));
  }
View Full Code Here

Examples of com.joshondesign.xml.Doc

    @Test
    public void testRectangle() throws Exception {
        page.clear();
        page.add(new SRect(0, 0, 20, 20).setFillPaint(FlatColor.RED));
        Doc xdoc = saveAndReadback(doc);
        assertTrue("0.0".equals(xdoc.xpathString("/svg/rect/@x")));
        assertTrue("1.0".equals(xdoc.xpathString("/svg/rect/@stroke-width")));
    }
View Full Code Here

Examples of com.joshondesign.xml.Doc

    }

    @Test public void testOval() throws Exception {
        page.clear();
        page.add(new SOval(0, 0, 20, 20).setFillPaint(FlatColor.RED));
        Doc xdoc = saveAndReadback(doc);
        assertTrue("10.0".equals(xdoc.xpathString("/svg/ellipse/@cx")));
        assertTrue("10.0".equals(xdoc.xpathString("/svg/ellipse/@ry")));
        assertTrue("1.0".equals(xdoc.xpathString("/svg/ellipse/@stroke-width")));
    }
View Full Code Here

Examples of com.joshondesign.xml.Doc

        poly.addPoint(new Point(10,0));
        poly.addPoint(new Point(0,10));
        poly.setClosed(true);
        page.clear();
        page.add(poly);
        Doc xdoc = saveAndReadback(doc);
        assertTrue("0.0,0.0 10.0,0.0 0.0,10.0 ".equals(xdoc.xpathString("/svg/polygon/@points")));       
    }
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.