01: package abbot;
02:
03: import junit.extensions.abbot.*;
04:
05: /** Check version settings. */
06: public class PlatformTest extends ComponentTestFixture {
07:
08: public void testVersionParsing() {
09: String[] versions = { "1.2", "1.2.0_01", "1.3", "1.3.1_06",
10: "1.4.0_02", "1.4.1_01", };
11: int[] values = { 0x1200, 0x1201, 0x1300, 0x1316, 0x1402, 0x1411 };
12: for (int i = 0; i < versions.length; i++) {
13: int version = Platform.parse(versions[i]);
14: assertEquals("Wrong version from '" + versions[i] + "'",
15: Integer.toHexString(values[i]), Integer
16: .toHexString(version));
17: }
18: assertTrue("Wrong version "
19: + Integer.toHexString(Platform.JAVA_VERSION),
20: Platform.JAVA_VERSION > Platform.JAVA_1_1);
21: }
22:
23: public PlatformTest(String name) {
24: super (name);
25: }
26:
27: public static void main(String[] args) {
28: TestHelper.runTests(args, PlatformTest.class);
29: }
30: }
|