Package com.marklogic.xcc

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


  public void testRelToAbs9() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("http://www.google.com")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.google.com");         
  }
 
  public void testRelToAbs10() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here


  public void testRelToAbs10() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString("http://en.wikipedia.org/wiki/Star_Wars"),
        ValueFactory.newXSString("/wiki/File:Star_Wars_Logo.svg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals("http://en.wikipedia.org/wiki/File:Star_Wars_Logo.svg", s);         
  }
 
 
}
View Full Code Here

  public void testEmptyDatabase() throws Exception {
    executeLibraryModule(modulePath, moduleNamespace, "emptyDatabase");
    // Verify update by running a query
    String q = "fn:count(fn:doc())";
    ResultSequence rs = this.executeQuery(q, null, null);
    XSInteger qResult = (XSInteger)rs.itemAt(0);
    assertEquals(getName(), 0, qResult.asPrimitiveInt());
  }
 
  public void testInit() throws Exception {
    executeLibraryModule(modulePath, moduleNamespace, "init");
View Full Code Here

  public void testRelToAbs1() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("../lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/a/lena.jpg");         
  }
 
  public void testRelToAbs2() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here

  public void testRelToAbs2() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("./lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/a/b/lena.jpg");         
  }
 
  public void testRelToAbs3() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here

  public void testRelToAbs3() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("../../lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/lena.jpg");         
  }
 
  public void testRelToAbs4() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here

  public void testRelToAbs4() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("/lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/lena.jpg");         
  }
 
  public void testRelToAbs5() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here

  public void testRelToAbs5() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("../x/lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/a/x/lena.jpg");         
  }
 
  public void testRelToAbs6() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here

  public void testRelToAbs6() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("../../x/y/lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/x/y/lena.jpg");         
  }
 
  public void testRelToAbs7() throws Exception {
    XdmValue[] params = new XdmValue[] {
View Full Code Here

  public void testRelToAbs7() throws Exception {
    XdmValue[] params = new XdmValue[] {
        ValueFactory.newXSString(absURL),
        ValueFactory.newXSString("?w=90&h=60&f=lena.jpg")};
    ResultSequence rs = executeLibraryModule(modulePath, moduleNamespace, "rel-to-abs", params);
    String s = (String)rs.itemAt(0).asString();
    assertEquals(s, "http://www.example.com/a/b/c?w=90&h=60&f=lena.jpg");         
  }
 
  public void testRelToAbs8() throws Exception {
    XdmValue[] params = new XdmValue[] {
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.