public void testComparator() { setupSet(); Comparator c = set.comparator(); assertTrue("natural order, so comparator should be null", c == null); }
public Set makeFullSet() { TreeSet set = new TreeSet(); set.addAll(Arrays.asList(getFullElements())); return UnmodifiableSortedSet.decorate(set); }
protected void setupSet() { set = (UnmodifiableSortedSet) makeFullSet(); array = new ArrayList(); array.add(new Integer(1)); }
/** * Verify that base set and subsets are not modifiable */ public void testUnmodifiable() { setupSet(); verifyUnmodifiable(set); verifyUnmodifiable(set.headSet(new Integer(1))); verifyUnmodifiable(set.tailSet(new Integer(1))); verifyUnmodifiable(set.subSet(new Integer(1), new Integer(3))); }
try { set.add("value"); fail("Expecting UnsupportedOperationException."); } catch (UnsupportedOperationException e) { fail("Expecting UnsupportedOperationException."); } catch (UnsupportedOperationException e) { fail("Expecting UnsupportedOperationException."); } catch (UnsupportedOperationException e) { fail("Expecting UnsupportedOperationException."); } catch (UnsupportedOperationException e) { fail("Expecting UnsupportedOperationException."); } catch (UnsupportedOperationException e) { fail("Expecting UnsupportedOperationException."); } catch (UnsupportedOperationException e) {
public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(TestCompositeSet.suite()); suite.addTest(TestListOrderedSet.suite()); suite.addTest(TestListOrderedSet2.suite()); suite.addTest(TestMapBackedSet.suite()); suite.addTest(TestMapBackedSet2.suite()); suite.addTest(TestPredicatedSet.suite()); suite.addTest(TestPredicatedSortedSet.suite()); suite.addTest(TestSynchronizedSet.suite()); suite.addTest(TestSynchronizedSortedSet.suite()); suite.addTest(TestTransformedSet.suite()); suite.addTest(TestTransformedSortedSet.suite()); suite.addTest(TestTypedSet.suite()); suite.addTest(TestTypedSortedSet.suite()); suite.addTest(TestUnmodifiableSet.suite()); suite.addTest(TestUnmodifiableSortedSet.suite()); return suite; }