test.ca.odell.glazedlists.FreezableListTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glazedlists_java15 Show documentation
Show all versions of glazedlists_java15 Show documentation
Event-driven lists for dynamically filtered and sorted tables
/* 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