All Downloads are FREE. Search and download functionalities are using the official Maven repository.

test.ca.odell.glazedlists.FreezableListTest Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
/* Glazed Lists                                                 (c) 2003-2006 */
/* http://publicobject.com/glazedlists/                      publicobject.com,*/
/*                                                     O'Dell Engineering Ltd.*/
package ca.odell.glazedlists;

import ca.odell.glazedlists.impl.testing.ListConsistencyListener;
import ca.odell.glazedlists.impl.testing.GlazedListsTests;
import junit.framework.TestCase;

/**
 * Validate that FreezableList freezes and thaws as expected.
 *
 * @author Jesse Wilson
 */
public class FreezableListTest extends TestCase {

    public void testFreezableList() {
        EventList source = new BasicEventList();
        FreezableList freezable = new FreezableList(source);
        ListConsistencyListener.install(freezable);

        source.addAll(GlazedListsTests.stringToList("ROUGHRIDERS"));
        assertEquals(GlazedListsTests.stringToList("ROUGHRIDERS"), freezable);

        freezable.freeze();
        source.removeAll(GlazedListsTests.stringToList("R"));
        assertEquals(GlazedListsTests.stringToList("OUGHIDES"), source);
        assertEquals(GlazedListsTests.stringToList("ROUGHRIDERS"), freezable);

        freezable.thaw();
        source.removeAll(GlazedListsTests.stringToList("R"));
        assertEquals(GlazedListsTests.stringToList("OUGHIDES"), freezable);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy