Package javax.naming

Examples of javax.naming.CompoundName.compareTo()


    props2.put("jndi.syntax.ignorecase", "false");
    props2.put("jndi.syntax.trimblanks", "true");
    CompoundName abcd_tb = new CompoundName("a/b/c/d", props2);
    CompoundName _a_b_c_d_tb = new CompoundName(" a / b / c / d ", props2);
    assertEquals(0, abcd_tb.compareTo(_a_b_c_d_tb));
    assertEquals(0, _a_b_c_d_tb.compareTo(abcd_tb));
    assertEquals(0, abcd_tb.compareTo(abcd));
    assertEquals(0, abcd.compareTo(abcd_tb));
    assertEquals(65, abcd.compareTo(_a_b_c_d_tb));
    assertEquals(0, _a_b_c_d_tb.compareTo(abcd));
  }
View Full Code Here


    assertEquals(0, abcd_tb.compareTo(_a_b_c_d_tb));
    assertEquals(0, _a_b_c_d_tb.compareTo(abcd_tb));
    assertEquals(0, abcd_tb.compareTo(abcd));
    assertEquals(0, abcd.compareTo(abcd_tb));
    assertEquals(65, abcd.compareTo(_a_b_c_d_tb));
    assertEquals(0, _a_b_c_d_tb.compareTo(abcd));
  }

  public void testSize() throws InvalidNameException {
    log.setMethod("testSize()");
    CompoundName name;
View Full Code Here

        CompoundName cName1 = new CompoundName("cName", properties);
        CompoundName cName2 = new CompoundName("CName", properties);
        assertTrue(cName1.equals(cName2));
        assertTrue(cName2.equals(cName1));
        assertEquals(0, cName1.compareTo(cName2));
        assertEquals(0, cName2.compareTo(cName1));

        // true-false
        properties.setProperty(key, "false");
        cName2 = new CompoundName("CName", properties);
        assertTrue(cName1.equals(cName2));
View Full Code Here

        properties.setProperty(key, "false");
        cName2 = new CompoundName("CName", properties);
        assertTrue(cName1.equals(cName2));
        assertFalse(cName2.equals(cName1));
        assertEquals(0, cName1.compareTo(cName2));
        assertTrue(cName2.compareTo(cName1) < 0);

        // false-false
        cName1 = new CompoundName("cName", properties);
        assertFalse(cName1.equals(cName2));
        assertFalse(cName2.equals(cName1));
View Full Code Here

        // false-false
        cName1 = new CompoundName("cName", properties);
        assertFalse(cName1.equals(cName2));
        assertFalse(cName2.equals(cName1));
        assertTrue(cName1.compareTo(cName2) > 0);
        assertTrue(cName2.compareTo(cName1) < 0);
    }

    public void testTrimBlank() throws InvalidNameException {
        String key = "jndi.syntax.trimblanks";
        Properties properties = new Properties();
View Full Code Here

        CompoundName cName1 = new CompoundName(" cName", properties);
        CompoundName cName2 = new CompoundName(" cName ", properties);
        assertTrue(cName1.equals(cName2));
        assertTrue(cName2.equals(cName1));
        assertEquals(0, cName1.compareTo(cName2));
        assertEquals(0, cName2.compareTo(cName1));

        // true-false
        properties.setProperty(key, "false");
        cName2 = new CompoundName(" cName ", properties);
        assertTrue(cName1.equals(cName2));
View Full Code Here

        properties.setProperty(key, "false");
        cName2 = new CompoundName(" cName ", properties);
        assertTrue(cName1.equals(cName2));
        assertFalse(cName2.equals(cName1));
        assertEquals(0, cName1.compareTo(cName2));
        assertTrue(cName2.compareTo(cName1) > 0);

        // false-false
        cName1 = new CompoundName(" cName", properties);
        assertFalse(cName1.equals(cName2));
        assertFalse(cName2.equals(cName1));
View Full Code Here

        // false-false
        cName1 = new CompoundName(" cName", properties);
        assertFalse(cName1.equals(cName2));
        assertFalse(cName2.equals(cName1));
        assertTrue(cName1.compareTo(cName2) < 0);
        assertTrue(cName2.compareTo(cName1) > 0);
    }
}
View Full Code Here

    assertEquals(0, abcd_tb.compareTo(_a_b_c_d_tb));
    assertEquals(0, _a_b_c_d_tb.compareTo(abcd_tb));
    assertEquals(0, abcd_tb.compareTo(abcd));
    assertEquals(0, abcd.compareTo(abcd_tb));
    assertEquals(65, abcd.compareTo(_a_b_c_d_tb));
    assertEquals(0, _a_b_c_d_tb.compareTo(abcd));
  }

  public void testSize() throws InvalidNameException {
    log.setMethod("testSize()");
    CompoundName name;
View Full Code Here

    log.setMethod("testCompareTo_Null()");
    CompoundName name;

    name = new CompoundName("a/b/c/d", props);
    try {
      name.compareTo(null);
      fail("compareTo(null) should throw ClassCastException");
    } catch (ClassCastException e) {
    }
  }
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.