|
1
|
|
package abbot.tester;
|
|
2
|
|
|
|
3
|
|
import java.awt.Rectangle;
|
|
4
|
|
|
|
5
|
|
import javax.swing.*;
|
|
6
|
|
import java.util.*;
|
|
7
|
|
|
|
8
|
|
import junit.extensions.abbot.*;
|
|
9
|
|
import abbot.Log;
|
|
10
|
|
|
|
11
|
|
|
|
12
|
|
|
|
13
|
|
public class JSpinnerTesterTest extends ComponentTestFixture {
|
|
14
|
|
|
|
15
|
1
|
public void testIncrement() {
|
|
16
|
1
|
showFrame(numeric);
|
|
17
|
1
|
tester.actionIncrement(numeric);
|
|
18
|
1
|
assertEquals("Wrong value", new Integer(1), numeric.getValue());
|
|
19
|
|
}
|
|
20
|
|
|
|
21
|
1
|
public void testDecrement() {
|
|
22
|
1
|
showFrame(numeric);
|
|
23
|
1
|
tester.actionDecrement(numeric);
|
|
24
|
1
|
assertEquals("Wrong value", new Integer(-1), numeric.getValue());
|
|
25
|
|
}
|
|
26
|
|
|
|
27
|
1
|
public void testSetValue() {
|
|
28
|
1
|
int VALUE = 199;
|
|
29
|
1
|
showFrame(numeric);
|
|
30
|
1
|
tester.actionSetValue(numeric, String.valueOf(VALUE));
|
|
31
|
1
|
assertEquals("Wrong value", new Integer(VALUE), numeric.getValue());
|
|
32
|
|
}
|
|
33
|
|
|
|
34
|
|
|
|
35
|
3
|
public JSpinnerTesterTest(String name) {
|
|
36
|
3
|
super(name);
|
|
37
|
|
}
|
|
38
|
|
|
|
39
|
|
private JSpinnerTester tester;
|
|
40
|
|
private JSpinner numeric;
|
|
41
|
3
|
protected void setUp() {
|
|
42
|
3
|
tester = (JSpinnerTester)ComponentTester.getTester(JSpinner.class);
|
|
43
|
3
|
numeric = new JSpinner();
|
|
44
|
3
|
numeric.setValue(new Integer(0));
|
|
45
|
|
}
|
|
46
|
|
|
|
47
|
0
|
public static void main(String[] args) {
|
|
48
|
0
|
RepeatHelper.runTests(args, JSpinnerTesterTest.class);
|
|
49
|
|
}
|
|
50
|
|
}
|
|
51
|
|
|