public class getUndoableEditListeners
implements Testlet
{
public void test(TestHarness harness)
{
UndoableEditSupport ues;
TestListener t1, t2;
UndoableEditListener[] l;
ues = new UndoableEditSupport();
t1 = new TestListener();
t2 = new TestListener();
// Check #1.
l = ues.getUndoableEditListeners();
harness.check((l != null) && (l.length == 0));
// Check #2.
ues.addUndoableEditListener(t1);
l = ues.getUndoableEditListeners();
harness.check((l != null) && (l.length == 1) && (l[0] == t1));
// Check #3.
ues.addUndoableEditListener(t2);
l = ues.getUndoableEditListeners();
harness.check(l != null && l.length == 2
&& l[0] == t1 && l[1] == t2);
// Check #4.
ues.removeUndoableEditListener(t1);
l = ues.getUndoableEditListeners();
harness.check(l != null && l.length == 1
&& l[0] == t2);
}