Package org.nasutekds.server.api

Examples of org.nasutekds.server.api.SubtreeSpecification


  public void testValueOf4() throws Exception {

    String input = "{relativeBase \"dc=sun, dc=com\"}";
    String output = "{ relativeBase \"dc=sun,dc=com\" }";

    SubtreeSpecification ss = RelativeSubtreeSpecification.valueOf(rootDN,
        input);
    assertEquals(output, ss.toString());
  }
View Full Code Here


    String input = "{ relativeBase \"dc=sun, dc=com\", "
        + "specificationFilter \"(objectClass=*)\" }";
    String output = "{ relativeBase \"dc=sun,dc=com\", "
        + "specificationFilter \"(objectClass=*)\" }";

    SubtreeSpecification ss = RelativeSubtreeSpecification.valueOf(rootDN,
        input);
    assertEquals(output, ss.toString());
  }
View Full Code Here

  public void testMatches1() throws Exception {
    DN dn = DN.decode("dc=abc, dc=sun, dc=com");

    String value = "{ relativeBase \"dc=sun, dc=com\", "
        + "specificationFilter \"(objectClass=person)\" }";
    SubtreeSpecification ss = RelativeSubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(true, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

  public void testMatches2() throws Exception {
    DN dn = DN.decode("dc=abc, dc=sun, dc=com");

    String value = "{ relativeBase \"dc=sun, dc=com\", "
        + "specificationFilter \"(objectClass=organization)\" }";
    SubtreeSpecification ss = RelativeSubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(false, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

            DirectoryServer.getSubentryManager().getSubentries();
    for (SubEntry subentry : rfc3672SubList)
    {
      if (subentry.getDN().equals(ldapSubentry.getDN()))
      {
        SubtreeSpecification spec = subentry.getSubTreeSpecification();
        assertTrue(spec instanceof RFC3672SubtreeSpecification);
      }
    }

    InternalClientConnection connection =
         InternalClientConnection.getRootConnection();

    // Add Relative Spec test subentry.
    Entry relativeSubentry = TestCaseUtils.makeEntry(
         "dn: cn=Relative Subentry," + SUFFIX,
         "objectClass: top",
         "objectclass: subentry",
         "subtreeSpecification: {relativeBase \"ou=Test SubEntry Manager\"}",
         "cn: Subentry");
    AddOperation addOperation =
         connection.processAdd(relativeSubentry.getDN(),
                               relativeSubentry.getObjectClasses(),
                               relativeSubentry.getUserAttributes(),
                               relativeSubentry.getOperationalAttributes());
    assertEquals(addOperation.getResultCode(), ResultCode.SUCCESS);
    assertNotNull(DirectoryServer.getEntry(relativeSubentry.getDN()));

    List<SubEntry> relativeSubList =
            DirectoryServer.getSubentryManager().getSubentries();
    for (SubEntry subentry : relativeSubList)
    {
      if (subentry.getDN().equals(relativeSubentry.getDN()))
      {
        SubtreeSpecification spec = subentry.getSubTreeSpecification();
        assertTrue(spec instanceof RelativeSubtreeSpecification);
      }
    }

    // Remove Relative Spec test subentry.
View Full Code Here

  @Test
  public void testMatches11() throws Exception {
    DN dn = DN.decode("dc=bar, dc=foo, dc=sun, dc=com");

    String value = "{ base \"dc=sun, dc=com\", maximum 2 }";
    SubtreeSpecification ss = RFC3672SubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(true, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

  public void testMatches12() throws Exception {
    DN dn = DN.decode("dc=sun, dc=com");

    String value = "{ base \"dc=sun, dc=com\", "
        + "specificExclusions { chopAfter:\"\" } }";
    SubtreeSpecification ss = RFC3672SubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(true, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

  public void testMatches13() throws Exception {
    DN dn = DN.decode("dc=foo, dc=sun, dc=com");

    String value = "{ base \"dc=sun, dc=com\", "
        + "specificExclusions { chopAfter:\"\" } }";
    SubtreeSpecification ss = RFC3672SubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(false, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

  public void testMatches14() throws Exception {
    DN dn = DN.decode("dc=foo, dc=sun, dc=com");

    String value = "{ base \"dc=sun, dc=com\", "
        + "specificExclusions { chopAfter:\"dc=foo\" } }";
    SubtreeSpecification ss = RFC3672SubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(true, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

  public void testMatches15() throws Exception {
    DN dn = DN.decode("dc=bar, dc=foo, dc=sun, dc=com");

    String value = "{ base \"dc=sun, dc=com\", "
        + "specificExclusions { chopAfter:\"dc=foo\" } }";
    SubtreeSpecification ss = RFC3672SubtreeSpecification.valueOf(rootDN,
        value);

    assertEquals(false, ss
        .isWithinScope(createEntry(dn, getObjectClasses())));
  }
View Full Code Here

TOP

Related Classes of org.nasutekds.server.api.SubtreeSpecification

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.