Package com.marklogic.xcc

Examples of com.marklogic.xcc.ResultSequence.asString()


  public void testInit() throws Exception {
    executeLibraryModule(modulePath, moduleNamespace, "init");
    // Verify update by running a query
    String q = "fn:doc('/config/tarantula.xml')" + "//tara:switch/text()";
    ResultSequence rs = this.executeQuery(q, null, null);
    String qStr = rs.asString();
    assertEquals("on", qStr);
 
  }
 
  public void testTurnOff() throws Exception {
View Full Code Here


  public void testTurnOff() throws Exception {
    executeLibraryModule(modulePath, moduleNamespace, "turnOff");
    // Verify update by running a query
    String q = "fn:doc('/config/tarantula.xml')" + "//tara:switch/text()";
    ResultSequence rs = this.executeQuery(q, null, null);
    String qStr = rs.asString();
    assertEquals("off", qStr);
 
  }
 
  public void testTurnOn() throws Exception {
View Full Code Here

  public void testTurnOn() throws Exception {
    executeLibraryModule(modulePath, moduleNamespace, "turnOn");
    // Verify update by running a query
    String q = "fn:doc('/config/tarantula.xml')" + "//tara:switch/text()";
    ResultSequence rs = this.executeQuery(q, null, null);
    String qStr = rs.asString();
    assertEquals("on", qStr);
 
  }
 
//  public void testStartDepthCrawler() throws Exception {
View Full Code Here

    XdmValue[] params = new XdmValue[] {
      ValueFactory.newXSString(sampleURL1),
      ValueFactory.newXSInteger(1) };
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "x", null);
    //Verify update by running a query
    System.out.println(rs.asString());
 
    assertEquals(getName(), 0, 0);

  }
 
View Full Code Here

    XdmVariable[] variables = new XdmVariable[] {
        ValueFactory.newVariable(new XName("url"), ValueFactory.newXSString(sampleURL1))};
    ResultSequence rs = this.executeMainModule(modulePath, null, variables);
    String q = "fn:doc('" + sampleURL1 + "')//*:title/text()";
    ResultSequence rs2 = executeQuery(q, null, null);
    String qStr = rs2.asString();
    System.out.println(rs.asString());
    System.out.println(qStr);
    assertEquals("Star Wars - Wikipedia, the free encyclopedia", qStr);   
  }
 
View Full Code Here

    XdmVariable[] variables = new XdmVariable[] {
        ValueFactory.newVariable(new XName("url"), ValueFactory.newXSString(sampleURL1))};
    ResultSequence rs = this.executeMainModule(modulePath2, null, variables);
    String q = "fn:count(fn:doc('" + sampleURL1 + "')//*:link)";
    ResultSequence rs2 = executeQuery(q, null, null);
    String qStr = rs2.asString();
    try {
        // Create file
        FileWriter fstream = new FileWriter("link-queue.txt");
        BufferedWriter out = new BufferedWriter(fstream);
        out.write(rs.asString());
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.