SeparatorList problems

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SeparatorList problems

hbrands
Administrator
Hi,

here are two tests that fail:

    public void testUpdateProblem3() {
        EventList<String> source = new BasicEventList<String>();
        SeparatorList<String> separatorList = new SeparatorList<String>(source, String.CASE_INSENSITIVE_ORDER, 1, Integer.MAX_VALUE);
        ListConsistencyListener<String> listConsistencyListener = ListConsistencyListener.install(separatorList);
        listConsistencyListener.setPreviousElementTracked(false);
        source.addAll(0, GlazedListsTests.stringToList("AACCC"));
        assertSeparatorEquals(separatorList.get(0), 2, "A");
        assertSeparatorEquals(separatorList.get(3), 3, "C");
        source.set(2, "A");
        assertSeparatorEquals(separatorList.get(0), 3, "A");
        assertSeparatorEquals(separatorList.get(4), 2, "C");
    }

    public void testUpdateProblem4() {
        EventList<String> source = new BasicEventList<String>();
        SeparatorList<String> separatorList = new SeparatorList<String>(source, String.CASE_INSENSITIVE_ORDER, 1, Integer.MAX_VALUE);
        ListConsistencyListener<String> listConsistencyListener = ListConsistencyListener.install(separatorList);
        listConsistencyListener.setPreviousElementTracked(false);
        source.addAll(0, GlazedListsTests.stringToList("AAACC"));
        assertSeparatorEquals(separatorList.get(0), 3, "A");
        assertSeparatorEquals(separatorList.get(4), 2, "C");
        source.set(2, "C");
        assertSeparatorEquals(separatorList.get(0), 2, "A");
        assertSeparatorEquals(separatorList.get(3), 3, "C");
    }

These simulate a list update without position change in the list.
But the changed element should be regrouped, which does not happen.

WDYT?

Thanks,
Holger