2 *******************************************************************************
\r
3 * Copyright (C) 2001-2004, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 package com.ibm.icu.dev.test.sample;
\r
9 import java.util.ListResourceBundle;
\r
12 * This is sample data for ModuleTestSample, which is an illustration
\r
13 * of a subclass of ModuleTest. This data is in a format which
\r
14 * is understood by ResourceModule, which for simplicity expects
\r
15 * all data, including numeric and boolean data, to be represented
\r
18 public class ModuleTestSampleData extends ListResourceBundle {
\r
19 public Object[][] getContents() {
\r
23 Object[][] contents = {
\r
24 { "Info", new Object[][] {
\r
25 { "Description", "This is a sample test module that illustrates ModuleTest " +
\r
26 "and uses data formatted for ResourceModule." },
\r
27 { "Headers", new String[] {
\r
28 "aStringArray", "anIntArray", "aBooleanArray"
\r
33 { "TestData", new Object[][] {
\r
34 { "Test01", new Object[][] {
\r
35 { "Info", new Object[][] {
\r
36 { "Description", "A typical test using both settings and cases." },
\r
37 { "Long_Description", "It does not defined its own headers, but instead " +
\r
38 "uses the default headers defined for the module. " +
\r
39 "There are two sets of settings and three cases." },
\r
41 { "Settings", new Object[] {
\r
43 {{ "aString", "this is a string" },
\r
45 { "aBoolean", "false" }},
\r
47 {{ "aString", "this is another string" },
\r
48 { "aBoolean", "true" }}
\r
50 { "Cases", new Object[] {
\r
52 new String[] { "one", "two", "three" },
\r
53 new String[] { "24", "48", "72" },
\r
54 new String[] { "true", "false", "true" }
\r
57 new String[] { "four", "five", "six" },
\r
58 new String[] { "-1", "-5", "-10" },
\r
59 new String[] { "true", "false", "false" }
\r
62 new String[] { "bagel", "peanuts", "carrot" },
\r
63 new String[] { "0", "00001", "10101" },
\r
64 new String[] { "false", "false", "False" }
\r
69 { "Test02", new Object[][] {
\r
70 { "Info", new Object[][] {
\r
71 { "Description", "A typical test that uses cases but not settings." },
\r
72 { "Long_Description", "It defines its own headers." },
\r
73 { "Headers", new String[] {
\r
74 "aString", "anInt", "aBoolean"
\r
77 { "Cases", new Object[] {
\r
78 new Object[] { "Superstring", "42", "true" },
\r
79 new Object[] { "Underdog", "12", "false" },
\r
80 new Object[] { "ScoobyDoo", "7", "TrUe" }
\r
84 { "Test03", new Object[][] {
\r
85 { "Info", new Object[][] {
\r
86 { "Description", "A typical test that uses just the info, no cases or settings." },
\r
87 { "Extra", "This is some extra information." }
\r
92 // Test04 should cause an exception to be thrown since ModuleTestSample does not
\r
93 // specify that it is ok for it to have no data.
\r
96 // Test05 should just log this fact, since ModuleTestSample indicates that it is
\r
97 // ok for Test05 to have no data in its override of validateMethod.
\r
99 { "Test06", new Object[][] {
\r
100 { "Info", new Object[][] {
\r
101 { "Description", "A test that has bad data." },
\r
102 { "Long_Description", "This illustrates how a data error will automatically " +
\r
103 "terminate the settings and cases loop." },
\r
104 { "Headers", new String[] {
\r
108 { "Cases", new Object[] {
\r
109 new Object[] { "Good", "23" },
\r
110 new Object[] { "Good", "-123" },
\r
111 new Object[] { "Bad", "Whoops" },
\r
112 new Object[] { "Not Executed", "35" },
\r
116 { "Test07", new Object[][] {
\r
117 { "Info", new Object[][] {
\r
118 { "Description", "A test that fails with a certain combination of settings and case." },
\r
119 { "Long_Description", "This illustrates how a test error will automatically " +
\r
120 "terminate the settings and cases loop. Settings data is values, the case " +
\r
121 "data is factors. The third factor is not a factor of the second value. " +
\r
122 "The test will log an error, which will automatically stop the loop." },
\r
123 { "Headers", new String[] {
\r
127 { "Settings" , new Object[] {
\r
128 new Object[][] {{ "Value", "210" }},
\r
129 new Object[][] {{ "Value", "420" }},
\r
130 new Object[][] {{ "Value", "42" }},
\r
131 new Object[][] {{ "Value", "Not reached." }}
\r
133 { "Cases", new Object[] {
\r
134 new Object[] { "2" },
\r
135 new Object[] { "3" },
\r
136 new Object[] { "5" },
\r
137 new Object[] { "7" },
\r
141 { "Test08", new Object[][] {
\r
142 { "Info", new Object[][] {
\r
143 { "Description", "A test with data missing from a test case." },
\r
144 { "Headers", new String[] {
\r
145 "One", "Two", "Three"
\r
148 { "Cases", new Object[] {
\r
149 new Object[] { "1", "2", "3" },
\r
150 new Object[] { "4", "5" }, // too short
\r
151 new Object[] { "6", "7", "8" },
\r
155 { "Test09", new Object[][] {
\r
156 { "Info", new Object[][] {
\r
157 { "Description", "A test with data stored as int arrays instead of strings" },
\r
158 { "Headers", new String[] {
\r
159 "Radix", "Power", "Value"
\r
162 { "Cases", new Object[] {
\r
163 new Object[] { "2", new int[] { 1, 2, 3 }, new int[] { 2, 4, 8 }},
\r
164 new Object[] { "3", new int[] { 3, 4, 5 }, new int[] { 27, 81, 243 }},
\r
165 new Object[] { "2", new int[] { 0, 8, 16, 24 }, new int[] { 1, 256, 65536, 65536 * 256 }},
\r