Code example for RuleBasedCollator

Methods: equals, getDecomposition, getStrength, setDecomposition, setStrength

0
                myCollator.compare("\u00e0\u0325", "a\u0325\u0300") == 0);
    } 
 
    public void testEqualsObject() throws ParseException { 
        String rule = "< a < b < c < d < e";
        RuleBasedCollator coll = new RuleBasedCollator(rule);
 
        assertEquals(Collator.TERTIARY, coll.getStrength());
        assertEquals(Collator.NO_DECOMPOSITION, coll.getDecomposition());
        RuleBasedCollator other = new RuleBasedCollator(rule);
        assertTrue(coll.equals(other));
 
        coll.setStrength(Collator.PRIMARY);
        assertFalse(coll.equals(other));
 
        coll.setStrength(Collator.TERTIARY);
        coll.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
        other.setDecomposition(Collator.NO_DECOMPOSITION); // See comment above.
        assertFalse(coll.equals(other));
    } 
 
    public void test_Harmony_1352() throws Exception { 
        // Regression test for HARMONY-1352, that doesn't get run in the harmony test suite because 
        // of an earlier failure.