Package com.hp.hpl.squirrelrdf.ldap

Examples of com.hp.hpl.squirrelrdf.ldap.LdapSubQuery


  /* Check some internals */
  public void test2() throws NamingException
  {
    assertNotNull("I have a config", config);
   
    LdapSubQuery map = new LdapSubQuery(config);
   
    map.add(Triple.create("?s http://xmlns.com/foaf/0.1/name 'Paul\\sShabajee'"));
    map.add(Triple.create("?s http://xmlns.com/foaf/0.1/mbox ?mbox"));
   
    assertEquals("Predicate is foaf:name", Node.createURI("http://xmlns.com/foaf/0.1/name") , map.getTriples().get(0).getPredicate());
       
    NamingEnumeration<SearchResult> results = map.executeLdap(new BindingRoot(), null);
   
    assertTrue("I got a result", results.hasMore());
   
    SearchResult result = results.next();
   
    log.info("Result: " + result.getNameInNamespace());
   
    assertEquals("Paul's email address is right", "paul.shabajee@hp.com", result.getAttributes().get("uid").get(0));
   
    results.close();
   
    Iterator<Map <String, Node>> res = map.execute(new BindingRoot(), null);
   
    assertTrue("I got a result", res.hasNext());
   
    Map<String, Node> nextBinding = res.next();
   
View Full Code Here


  }
 
  /* Check it works when a subject is given, and email handling */
  public void test3() throws NamingException
  {
    LdapSubQuery map = new LdapSubQuery(config);
   
    map.add(Triple.create("ldap://ldap.hp.com/uid=paul.shabajee@hp.com,ou=People,o=hp.com http://xmlns.com/foaf/0.1/mbox ?mbox"));
   
    Iterator<Map <String, Node>> res = map.execute(new BindingRoot(), null);
   
    assertTrue("I got a result", res.hasNext());
   
    Map<String, Node> nextBinding = res.next();
   
View Full Code Here

  }
 
  /* Check ldap node reference works. Also checks non-search (just get attribute for paul node) */
  public void test4()
  {
    LdapSubQuery map = new LdapSubQuery(config);
   
    map.add(Triple.create("ldap://ldap.hp.com/uid=paul.shabajee@hp.com,ou=People,o=hp.com http://jena.hpl.hp.com/schemas/hpcorp#manager ?manager"));
   
    Iterator<Map <String, Node>> res = map.execute(new BindingRoot(), null);
   
    assertTrue("I got a result", res.hasNext());
   
    Map<String, Node> nextBinding = res.next();
   
View Full Code Here

  }
 
  /* More email handling -- checks un-emailing*/
  public void test6() throws NamingException
  {
    LdapSubQuery map = new LdapSubQuery(config);
   
    map.add(Triple.create("?person http://xmlns.com/foaf/0.1/mbox mailto:paul.shabajee@hp.com"));
    map.add(Triple.create("?person http://xmlns.com/foaf/0.1/name ?name"));
   
    Iterator<Map <String, Node>> res = map.execute(new BindingRoot(), null);
   
    assertTrue("I got a result", res.hasNext());
   
    Map<String, Node> nextBinding = res.next();
   
View Full Code Here

TOP

Related Classes of com.hp.hpl.squirrelrdf.ldap.LdapSubQuery

Copyright © 2018 www.massapicom. 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.