Package javax.naming.ldap

Examples of javax.naming.ldap.Rdn


     * <p>
     * The expected result is that the name at the specified index is removed.
     * </p>
     */
    public void testRemove003() throws Exception {
        Rdn x = new Rdn("t=test");
        LdapName ln = new LdapName("t=test");
        assertEquals(x.toString(), ln.remove(0).toString());
    }
View Full Code Here


     * </p>
     */
    public void testGetRdns002() throws Exception {
        LdapName ln = new LdapName("uid=userid,t=test,cn=common");
        LinkedList<Rdn> compare = new LinkedList<Rdn>();
        compare.add(0, new Rdn("cn=common"));
        compare.add(1, new Rdn("t=test"));
        compare.add(2, new Rdn("uid=userid"));
        LinkedList<Rdn> notempty = new LinkedList<Rdn>(ln.getRdns());

        assertEquals(compare.size(), notempty.size());

        for (int j = 0; j < notempty.size(); j++) {
View Full Code Here

     * </p>
     */
    public void testCompareTo001() throws Exception {
        try {
            LdapName ln = new LdapName("t=test,cn=common");
            Rdn tocomp = null;
            ln.compareTo(tocomp);
            fail("The string is null.");
        } catch (ClassCastException e) {}
    }
View Full Code Here

        assertTrue(ln.compareTo(ln2) == 0);
    }

    public void testSerializationCompatibility() throws Exception{
        LdapName object = new LdapName("t=test\\, , t1=\\ test1");
        object.add(new Rdn("t2=te\\ st2"));
        SerializationTest.verifyGolden(this, object);
    }
View Full Code Here

   */
  public void testRdnString001() {

    try {
      for(int i=0;i<utf8Values001.length ;i++){
        Rdn x=new Rdn(utf8Values001[i]);
        assertNotNull(x);
      }
     
    } catch (InvalidNameException e) {
      fail("Failed with:"+e);
View Full Code Here

  public void testRdnString002() {

   
    try {
      for(int i=0;i<utf8Values002.length ;i++){
        Rdn x=new Rdn(utf8Values002[i]);
        assertNotNull(x);
       
      }
     
    } catch (InvalidNameException e) {
View Full Code Here

  public void testRdnString003() {
   
    for (int i = 0; i < utf8Values003.length; i++) {
      for (int j = 0; j < utf8Values004.length; j++) {
        try {
          Rdn x=new Rdn(this.type+this.utf8Values003[i]+this.utf8Values004[j]);
          assertNotNull(x);
          Object ret=x.getValue();
          String temp=utf8Values003[i].toString()+utf8Values004[j].toString();
          assertFalse(temp.equals(ret));
        } catch (InvalidNameException e) {
          fail("Failed with:"+e);
        }
View Full Code Here

  public void testRdnString004() {
   
    for (int i = 0; i < utf8Values004.length; i++) {
      for (int j = 0; j < utf8Values003.length; j++) {
        try {
          Rdn y=new Rdn(this.type+this.utf8Values004[i]+this.utf8Values003[j]);
          assertNotNull(y);
          Object ret=y.getValue();
          String temp=utf8Values004[i].toString()+utf8Values003[j].toString();
          assertFalse(temp.equals(ret));
        } catch (InvalidNameException e) {
          fail("Failed with:"+e );
        }
View Full Code Here

  public void testRdnString005() {
   
    for (int i = 0; i < utf8Values004.length; i++) {
      for (int j = 0; j < utf8Values003.length; j++) {
        try {
          Rdn y=new Rdn(this.type+this.utf8Values004[i]+this.utf8Values003[j]+this.utf8Values004[i]);
          assertNotNull(y);
          Object ret=y.getValue();
          String temp=utf8Values004[i].toString()+utf8Values003[j].toString()+utf8Values004[i].toString();
          assertFalse(temp.equals(ret));
        } catch (InvalidNameException e) {
          fail("Failed with:"+e );
        }
       
      }
    }
    for (int i = 0; i < utf8Values003.length; i++) {
      for (int j = 0; j < utf8Values004.length; j++) {
        try {
          Rdn y=new Rdn(this.type+this.utf8Values003[i]+this.utf8Values004[j]+this.utf8Values003[i]);
          assertNotNull(y);
          Object ret=y.getValue();
          String temp=utf8Values003[i].toString()+utf8Values004[j].toString()+utf8Values003[i].toString();
          assertFalse(temp.equals(ret));
        } catch (InvalidNameException e) {
          fail("Failed with:"+e);
        }
       
      }
    }
    for (int i = 0; i < utf8Values003.length; i++) {
      for (int j = 0; j < utf8Values004.length; j++) {
        try {
          Rdn y=new Rdn(this.type+this.utf8Values003[i]+this.utf8Values003[i]+this.utf8Values004[j]);
          assertNotNull(y);
          Object ret=y.getValue();
          String temp=utf8Values003[i].toString()+utf8Values003[i].toString()+utf8Values004[j].toString();
          assertFalse(temp.equals(ret));
        } catch (InvalidNameException e) {
          fail("Failed with:"+e);
        }
View Full Code Here

    for(int i=0;i<utf8Values003.length ;i++){
     
      try {
     
        Rdn x=new Rdn(utf8Values003[i]);
        fail("This is wrong."+i);
      } catch (InvalidNameException e) {
     
      }
           
    }
    for(int i=0;i<utf8Values004.length ;i++){
     
      try {
     
        Rdn x=new Rdn(utf8Values004[i]);
        fail("This is wrong."+i);
      } catch (InvalidNameException e) {
     
      }
           
View Full Code Here

TOP

Related Classes of javax.naming.ldap.Rdn

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.