|
1
|
|
package abbot;
|
|
2
|
|
|
|
3
|
|
import java.awt.*;
|
|
4
|
|
import java.awt.event.*;
|
|
5
|
|
import java.awt.Robot;
|
|
6
|
|
import javax.swing.*;
|
|
7
|
|
|
|
8
|
|
import junit.framework.*;
|
|
9
|
|
import junit.extensions.abbot.*;
|
|
10
|
|
import junit.extensions.abbot.Timer;
|
|
11
|
|
import abbot.util.*;
|
|
12
|
|
|
|
13
|
|
|
|
14
|
|
public class PlatformTest extends ComponentTestFixture {
|
|
15
|
|
|
|
16
|
1
|
public void testVersionParsing() {
|
|
17
|
1
|
String[] versions = {
|
|
18
|
|
"1.2",
|
|
19
|
|
"1.2.0_01",
|
|
20
|
|
"1.3",
|
|
21
|
|
"1.3.1_06",
|
|
22
|
|
"1.4.0_02",
|
|
23
|
|
"1.4.1_01",
|
|
24
|
|
};
|
|
25
|
1
|
int[] values = { 0x1200, 0x1201, 0x1300, 0x1316, 0x1402, 0x1411 };
|
|
26
|
1
|
for (int i=0;i < versions.length;i++) {
|
|
27
|
6
|
int version = Platform.parse(versions[i]);
|
|
28
|
6
|
assertEquals("Wrong version from '" + versions[i] + "'",
|
|
29
|
|
Integer.toHexString(values[i]),
|
|
30
|
|
Integer.toHexString(version));
|
|
31
|
|
}
|
|
32
|
1
|
assertTrue("Wrong version "
|
|
33
|
|
+ Integer.toHexString(Platform.JAVA_VERSION),
|
|
34
|
|
Platform.JAVA_VERSION > Platform.JAVA_1_1);
|
|
35
|
|
}
|
|
36
|
|
|
|
37
|
|
|
|
38
|
1
|
public PlatformTest(String name) {
|
|
39
|
1
|
super(name);
|
|
40
|
|
}
|
|
41
|
|
|
|
42
|
0
|
public static void main(String[] args) {
|
|
43
|
0
|
TestHelper.runTests(args, PlatformTest.class);
|
|
44
|
|
}
|
|
45
|
|
}
|
|
46
|
|
|