Package ca.ecliptical.emf.xpath

Examples of ca.ecliptical.emf.xpath.EMFXPath.selectSingleNode()


  }

  public final void testSelectChildWithPredicate() throws Exception {
    EMFXPath xpath = new EMFXPath("lib:books[lib:title='Book 1']");
    xpath.addNamespace("lib", LibraryPackage.eNS_URI);
    Book book = (Book) xpath.selectSingleNode(fixture);
    assertNotNull(book);
    assertEquals("Book 1", book.getTitle());
  }

  public final void testNonContainmentRef() throws Exception {
View Full Code Here


  }

  public final void testNonContainmentRef() throws Exception {
    EMFXPath xpath = new EMFXPath("lib:books[lib:author=current()/lib:writers[lib:name='Writer 1']]");
    xpath.addNamespace("lib", LibraryPackage.eNS_URI);
    Book book = (Book) xpath.selectSingleNode(fixture);
    assertNotNull(book);
    assertEquals("Book 1", book.getTitle());
  }
 
  public final void testStringValueOf() throws Exception {
View Full Code Here

 
  public final void testFeatureMap() throws Exception {
    EMFXPath xpath = new EMFXPath("/resources/contents/t:test/t:subTest[x:value='2']");
    xpath.addNamespace("t", "urn:test");
    xpath.addNamespace("x", XMLTypePackage.eNS_URI);
    SimpleAnyType result = (SimpleAnyType) xpath.selectSingleNode(fixture);
    assertNotNull(result);
    assertEquals(new Integer(2), result.getValue());
  }
 
  public final void testNamespaces() throws Exception {
View Full Code Here

  }

  public final void testContentsFunction() throws Exception {
    EMFXPath xpath = new EMFXPath("lib:books[contents(lib:author)/lib:name='Writer 1']");
    xpath.addNamespace("lib", LibraryPackage.eNS_URI);
    Book book = (Book) xpath.selectSingleNode(fixture);
    assertNotNull(book);
    assertEquals("Book 1", book.getTitle());
  }

  public final void testEClassFunction() throws Exception {
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.