Package org.apache.sling.servlets.resolver.helper

Examples of org.apache.sling.servlets.resolver.helper.WeightedResource.compareTo()


        WeightedResource lr1 = new WeightedResource(0, null, 1, WeightedResource.WEIGHT_NONE);
        WeightedResource lr2 = new WeightedResource(1, null, 0, WeightedResource.WEIGHT_NONE);
       
        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
   
View Full Code Here


        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
   
    public void testCompareToPrefix() {
        WeightedResource lr1 = new WeightedResource(0, null, 2, WeightedResource.WEIGHT_PREFIX);
        WeightedResource lr2 = new WeightedResource(1, null, 2, WeightedResource.WEIGHT_NONE);
View Full Code Here

        WeightedResource lr1 = new WeightedResource(0, null, 2, WeightedResource.WEIGHT_PREFIX);
        WeightedResource lr2 = new WeightedResource(1, null, 2, WeightedResource.WEIGHT_NONE);
       
        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
   
View Full Code Here

        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
   
    public void testCompareToExtension() {
        WeightedResource lr1 = new WeightedResource(0, null, 2, WeightedResource.WEIGHT_EXTENSION);
        WeightedResource lr2 = new WeightedResource(1, null, 2, WeightedResource.WEIGHT_NONE);
View Full Code Here

        WeightedResource lr1 = new WeightedResource(0, null, 2, WeightedResource.WEIGHT_EXTENSION);
        WeightedResource lr2 = new WeightedResource(1, null, 2, WeightedResource.WEIGHT_NONE);
       
        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
View Full Code Here

        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
    public void testCompareToOrdinal() {
        WeightedResource lr1 = new WeightedResource(0, null, 0, WeightedResource.WEIGHT_NONE);
        WeightedResource lr2 = new WeightedResource(1, null, 0, WeightedResource.WEIGHT_NONE);
View Full Code Here

        WeightedResource lr1 = new WeightedResource(0, null, 0, WeightedResource.WEIGHT_NONE);
        WeightedResource lr2 = new WeightedResource(1, null, 0, WeightedResource.WEIGHT_NONE);
       
        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
}
View Full Code Here

        // expect the same objects to compare equal
        assertEquals(0, lr1.compareTo(lr1));
        assertEquals(0, lr2.compareTo(lr2));
       
        assertTrue(lr1.compareTo(lr2) < 0);
        assertTrue(lr2.compareTo(lr1) > 0);
    }
}
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.