Package javax.naming.ldap

Examples of javax.naming.ldap.Rdn


   *
   */
  public void testRdnString017(){
    try{
      for (int i = 0; i < utf8Values003.length; i++) {
        Rdn x=new Rdn(type+utf8Values003[i]+"+"+type+utf8Values003[i]+"+"+type+utf8Values003[i]);
        assertNotNull(x);   
      }
      for (int i = 0; i < utf8Values003.length; i++) {
        for (int j = 0; j < utf8Values004.length; j++) {
          Rdn x=new Rdn(type+utf8Values003[i]+"+"+type+utf8Values004[j]+"+"+type+utf8Values003[i]);
          assertNotNull(x);
        }
           
      }
                 
    }catch (InvalidNameException e) {
      fail();
    }
    try{
     
      for (int i = 0; i < utf8Values003.length; i++) {
        for (int j = 0; j < utf8Values004.length; j++) {
          for (int k = 0; k < utf8Values006.length; k++) {
            Rdn x=new Rdn(utf8Values005[0]+utf8Values006[k]+"="+utf8Values003[i]+"+"+type+utf8Values004[j]+"+"+type+utf8Values003[i]);
            fail();
          }
         
        }
           
      }
      for (int i = 0; i < utf8Values003.length; i++) {
        for (int j = 0; j < utf8Values004.length; j++) {
          for (int k = 0; k < utf8Values006.length; k++) {
            Rdn x=new Rdn(type+utf8Values003[i]+"+"+utf8Values005[0]+utf8Values006[k]+"="+utf8Values004[j]+"+"+type+utf8Values003[i]);
            fail();
          }
         
        }
           
      }
      for (int i = 0; i < utf8Values003.length; i++) {
        for (int j = 0; j < utf8Values004.length; j++) {
          for (int k = 0; k < utf8Values006.length; k++) {
            Rdn x=new Rdn(type+utf8Values003[i]+"+"+utf8Values004[j]+"="+utf8Values004[j]+"+"+type+utf8Values003[i]);
            fail();
          }
         
        }
           
View Full Code Here


   *
   */
  public void testRdnString018(){
    try{
      for (int i = 0; i < utf8Values009.length; i++) {
        Rdn x=new Rdn(type+"\""+utf8Values009[i]+"\""+"+"+type+utf8Values009[i]+"+"+type+utf8Values009[i]);
        assertNotNull(x);
        String temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+utf8Values009[i];
        assertEquals(temp,x.toString());
      }
      for (int j = 0; j < utf8Values004.length; j++) {
        Rdn x=new Rdn(type+"\""+utf8Values004[j]+"\"");
        assertNotNull(x);
        String temp=null;
        if(j<(utf8Values004.length-9)){
         
          temp=type+Rdn.unescapeValue(utf8Values004[j]);
        }else{
          temp=type+"\\"+Rdn.unescapeValue(utf8Values004[j]);
         
        }
       
        assertEquals(0,temp.compareToIgnoreCase(x.toString()));
                 
      }
     
    }catch (InvalidNameException e) {
      fail();
View Full Code Here

    try{
     
      for (int i = 0; i < utf8Values009.length; i++) {
        for (int j = 1; j < utf8Values004.length; j++) {//starts in one because that will be test in the next method.
               
          Rdn x=new Rdn(type+"\""+utf8Values009[i]+"\""+"+"+type+"\""+utf8Values004[j]+"\""+"+"+type+utf8Values009[i]);
     
          assertNotNull(x);
          String temp=null;
          if(j<(utf8Values004.length-9)){
         
            if(((String)Rdn.unescapeValue(utf8Values004[j])).compareToIgnoreCase(utf8Values009[i])>0){
              temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+Rdn.unescapeValue(utf8Values004[j]);
     
              if((j!=82&&j!=83&&j<109)&&((j>=55&j<=80|j>=84&j<=108)&&utf8Values009[i]=="[")|(i==49&utf8Values009[i]=="]")){
                temp=type+Rdn.unescapeValue(utf8Values004[j])+"+"+type+utf8Values009[i]+"+"+type+utf8Values009[i];
                     
              }

              if((i==50|i==51|i==52)&((j>=55&j<83)|(j>=84&j<109))){
                temp=type+Rdn.unescapeValue(utf8Values004[j])+"+"+type+utf8Values009[i]+"+"+type+utf8Values009[i];
     
              }
            }else{
              temp=type+Rdn.unescapeValue(utf8Values004[j])+"+"+type+utf8Values009[i]+"+"+type+utf8Values009[i];
     
              if((i>=22|i<=59)&&(utf8Values004[j]=="\\5b"|utf8Values004[j]=="\\5d"|utf8Values004[j]=="\\5e"
                |utf8Values004[j]=="\\5f")&&/*(i!=49&(utf8Values009[i]!="]"|utf8Values009[i]!="["))&&*/(i<49|i>52)&&(i<79)){
                temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+Rdn.unescapeValue(utf8Values004[j]);
     
               
              }
            }
            if(((String)Rdn.unescapeValue(utf8Values004[j])).compareToIgnoreCase(utf8Values009[i])==0){
              temp=type+utf8Values009[i]+"+"+type+Rdn.unescapeValue(utf8Values004[j])+"+"+type+utf8Values009[i];
 
            }

                     
          }else{
           
           
            if(((String)Rdn.unescapeValue(utf8Values004[j])).compareToIgnoreCase(utf8Values009[i])<0){
              temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+"\\"+Rdn.unescapeValue(utf8Values004[j]);
 
            }
           
            if(utf8Values004[j]=="\\22"|utf8Values004[j]=="\\23"|utf8Values004[j]=="\\2b"|utf8Values004[j]=="\\2c"
            |utf8Values004[j]=="\\3c"|utf8Values004[j]=="\\3d"|utf8Values004[j]=="\\3e"|utf8Values004[j]=="\\3b"
              |utf8Values004[j]=="\\5c"){
              temp=type+"\\"+Rdn.unescapeValue(utf8Values004[j])+"+"+type+utf8Values009[i]+"+"+type+utf8Values009[i];
 
             
                           
              if(utf8Values009[i]=="!"|utf8Values009[i]=="$"|utf8Values009[i]=="$"|utf8Values009[i]=="%"|
                utf8Values009[i]=="%"|utf8Values009[i]=="&"|utf8Values009[i]=="'"|utf8Values009[i]=="("|utf8Values009[i]==")"
                  |utf8Values009[i]=="*"|utf8Values009[i]=="["
                  &&utf8Values004[j]=="\\2b"|utf8Values004[j]=="\\2c"&&i!=48){
                temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+"\\"+Rdn.unescapeValue(utf8Values004[j]);
 
              }
             
              if(utf8Values009[i]=="!"|(i>=22|i<=59&&utf8Values004[j]=="\\5c")&i!=49&i!=50&i!=51&i!=52&i!=79&i!=80&i!=81&i!=82){
                  temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+"\\"+Rdn.unescapeValue(utf8Values004[j]);
 
                }
            }
           
            if(utf8Values004[j]=="\\3c"|utf8Values004[j]=="\\3d"|utf8Values004[j]=="\\3e"|utf8Values004[j]=="\\3b"
                |utf8Values004[j]=="\\5c"&&i<22){
                temp=type+utf8Values009[i]+"+"+type+utf8Values009[i]+"+"+type+"\\"+Rdn.unescapeValue(utf8Values004[j]);
 
            }

          }
          assertEquals(0,temp.compareTo(x.toString()));
        }
           
      }
 
    }catch (InvalidNameException e) {
View Full Code Here

    try{
      for (int i = 0; i < 16; i++) {
        for (int j = 0; j < 16; j++) {
             
          String[] hex={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
          Rdn x=new Rdn("t=#"+hex[i]+hex[j]);
          assertNotNull(x);
        }
      }
                 
    }catch (InvalidNameException e) {
      fail();
    }catch (IllegalArgumentException e) {
      fail();
    }
   
    for (int i = 0; i < 16; i++) {
      for (int j = 0; j < 16; j++) {
        for (int k = 0; k < 16; k++) {
          try{
       
            String[] hex={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
            Rdn x=new Rdn("t=#"+hex[i]+hex[j]+hex[k]);
            fail();
          }catch (InvalidNameException e) {
           
          }catch (IllegalArgumentException e) {
           
          }
        }
      }
    }
    try{
      for (int i = 0; i < 16; i++) {
        for (int j = 0; j < 16; j++) {
          for (int k = 0; k < 16; k++) {
            for (int f = 0; f < 16; f++) {
             
           
             
              String[] hex={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
              Rdn x=new Rdn("t=#"+hex[i]+hex[j]+hex[k]+hex[f]);
              assertNotNull(x);
            }
          }
        }
      }
View Full Code Here

   *
   */
  public void testRDNNULL() {
    try {
      String y="ca=nine+type="+Rdn.escapeValue("\\00");
      Rdn x=new Rdn("ca=nine+type=\"liom,\"+type=\"\\00\"");
      byte[] temp=new byte[]{99,97,61,110,105,110,101,43,116,121,112,101,61,0,43,116,121,112,101,61,108,105,111,109,92,44};
      for(int i=0;i<26;i++){
        assertEquals(temp[i],x.toString().getBytes()[i]);
      }
     
      x=new Rdn("ca=nine+pe=\"liom,\"+type=\"\\00\"");
      assertEquals("ca=nine+pe=liom\\,+type="+Rdn.unescapeValue("\\00"),x.toString());
    } catch (InvalidNameException e) {
      fail();
     
    }
   
View Full Code Here

  public void testClone001() {
   
    LdapName ln;
    try {
      List<Rdn> lista = new ArrayList<Rdn>();
      Rdn x=new Rdn("t"," ");
      lista.add(x);
      ln = new LdapName(lista);
      LdapName cloned=(LdapName) ln.clone();
      assertNotNull(cloned);
      assertEquals(cloned,ln);     
View Full Code Here

  public void testClone002() {
   
    LdapName ln;
    try {
      List<Rdn> lista = new ArrayList<Rdn>();
      Rdn x=new Rdn("t","asd");
      lista.add(x);
      ln = new LdapName(lista);
      LdapName cloned=(LdapName) ln.clone();
      assertNotNull(cloned);
      assertTrue(cloned.equals(ln));
View Full Code Here

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

   */
  public void testStartsWithListOfRdn004() {
   
    LinkedList<Rdn> test=new LinkedList<Rdn>();
    try {
      test.add(new Rdn("t=test"));
      LdapName x=new LdapName("t=t");
      assertFalse(x.startsWith(test));
    } catch (InvalidNameException e) {
      fail("Failed with:"+e);
    }
View Full Code Here

   */
  public void testequals(){
    LinkedList<Rdn> test=new LinkedList<Rdn>();
    LinkedList<Rdn> test1=new LinkedList<Rdn>();
    try {
      test.add(new Rdn("t=test"));
      test1.add(new Rdn("t=test"));
      test1.add(new Rdn("t=test"));
      LdapName x=new LdapName(test);
      LdapName y=new LdapName(test1);
      assertFalse(x.equals(y));
    } catch (InvalidNameException e) {
      fail("Failed with:"+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.