1 /*******************************************************************************
2  * Copyright (c) 2000, 2017 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.tests.junit;
15 
16 import static org.junit.Assert.assertEquals;
17 import static org.junit.Assert.assertFalse;
18 import static org.junit.Assert.assertTrue;
19 import static org.junit.Assert.fail;
20 
21 import org.eclipse.swt.SWT;
22 import org.eclipse.swt.events.SelectionEvent;
23 import org.eclipse.swt.events.SelectionListener;
24 import org.eclipse.swt.widgets.Slider;
25 import org.junit.Before;
26 import org.junit.Test;
27 
28 /**
29  * Automated Test Suite for class org.eclipse.swt.widgets.Slider
30  *
31  * @see org.eclipse.swt.widgets.Slider
32  */
33 public class Test_org_eclipse_swt_widgets_Slider extends Test_org_eclipse_swt_widgets_Control {
34 
35 @Override
36 @Before
setUp()37 public void setUp() {
38 	super.setUp();
39 	slider = new Slider(shell, 0);
40 	setWidget(slider);
41 }
42 
valueString(int[] intArray)43 protected String valueString(int[] intArray) {
44 	return " ("+intArray[1]+","+intArray[2]+","+intArray[3]+","+intArray[4]+")";
45 }
46 
47 @Override
48 @Test
test_ConstructorLorg_eclipse_swt_widgets_CompositeI()49 public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() {
50 	try {
51 		slider = new Slider(null, 0);
52 		fail("No exception thrown for parent == null");
53 	}
54 	catch (IllegalArgumentException e) {
55 	}
56 
57 	int[] cases = {0, SWT.HORIZONTAL, SWT.VERTICAL};
58 	for (int style : cases)
59 		slider = new Slider(shell, style);
60 }
61 
62 @Test
test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener()63 public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() {
64 	listenerCalled = false;
65 	boolean exceptionThrown = false;
66 	SelectionListener listener = new SelectionListener() {
67 		@Override
68 		public void widgetSelected(SelectionEvent event) {
69 			listenerCalled = true;
70 		}
71 		@Override
72 		public void widgetDefaultSelected(SelectionEvent event) {
73 		}
74 	};
75 	try {
76 		slider.addSelectionListener(null);
77 	}
78 	catch (IllegalArgumentException e) {
79 		exceptionThrown = true;
80 	}
81 	assertTrue("Expected exception not thrown", exceptionThrown);
82 	exceptionThrown = false;
83 	slider.addSelectionListener(listener);
84 	slider.setSelection(0);
85 	assertFalse(":a:", listenerCalled);
86 	slider.removeSelectionListener(listener);
87 	try {
88 		slider.removeSelectionListener(null);
89 	}
90 	catch (IllegalArgumentException e) {
91 		exceptionThrown = true;
92 	}
93 	assertTrue("Expected exception not thrown", exceptionThrown);
94 }
95 
96 @Test
test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_events_SelectionListener()97 public void test_addSelectionListenerWidgetSelectedAdapterLorg_eclipse_swt_events_SelectionListener() {
98 	listenerCalled = false;
99 	SelectionListener listener = SelectionListener.widgetSelectedAdapter(e -> listenerCalled = true);
100 
101 	slider.addSelectionListener(listener);
102 	slider.setSelection(0);
103 	assertFalse(":a:", listenerCalled);
104 	slider.removeSelectionListener(listener);
105 }
106 
107 @Override
108 @Test
test_computeSizeIIZ()109 public void test_computeSizeIIZ() {
110 	// super class method sufficient test
111 }
112 
113 @Test
test_getIncrement()114 public void test_getIncrement() {
115 	int[] cases = {1, 10, 10000};
116 	for (int i=0; i<cases.length; i++)
117 	{
118 		slider.setIncrement(cases[i]);
119 		assertTrue("case: " + String.valueOf(i), slider.getIncrement()==cases[i]);
120 	}
121 }
122 
123 @Test
test_getMaximum()124 public void test_getMaximum() {
125 	slider.setMaximum(2000);
126 	assertTrue(":a:", slider.getMaximum() == 2000);
127 	slider.setMaximum(20);
128 	assertTrue(":b:", slider.getMaximum() == 20);
129 	slider.setMaximum(-1);
130 	assertTrue(":c:", slider.getMaximum() == 20);
131 	slider.setMaximum(0);
132 	assertTrue(":d:", slider.getMaximum() == 20);
133 	slider.setMaximum(10);
134 	assertTrue(":d:", slider.getMaximum() == 10);
135 }
136 
137 @Test
test_getMinimum()138 public void test_getMinimum() {
139 	slider.setMinimum(5);
140 	assertTrue(":a:", slider.getMinimum() == 5);
141 	slider.setMinimum(20);
142 	assertTrue(":b:", slider.getMinimum() == 20);
143 	slider.setMinimum(-1);
144 	assertTrue(":c:", slider.getMinimum() == 20);
145 	slider.setMinimum(0);
146 	assertTrue(":d:", slider.getMinimum() == 0);
147 	slider.setMinimum(10);
148 	assertTrue(":d:", slider.getMinimum() == 10);
149 }
150 
151 @Test
test_getPageIncrement()152 public void test_getPageIncrement() {
153 	int[] cases = {1, 10, 10000};
154 	for (int i=0; i<cases.length; i++)
155 	{
156 		slider.setPageIncrement(cases[i]);
157 		assertTrue("case: " + String.valueOf(i), slider.getPageIncrement()==cases[i]);
158 	}
159 }
160 
161 @Test
test_getSelection()162 public void test_getSelection() {
163 	slider.setSelection(10);
164 	assertTrue(":a:", slider.getSelection()== 10);
165 
166 }
167 
168 @Override
169 @Test
test_setEnabledZ()170 public void test_setEnabledZ() {
171 	slider.setEnabled(true);
172 	assertTrue(slider.getEnabled());
173 	slider.setEnabled(false);
174 	assertEquals(slider.getEnabled(), false);
175 }
176 
177 @Test
test_setMaximumI()178 public void test_setMaximumI() {
179 
180 	int [][] testValues = getSetMaximumValues();
181 
182 	for (int[] intArray : testValues) {
183 		setDefaults();
184 		slider.setMaximum(intArray[0]);
185 		String valueString = valueString(intArray);
186 		report("setMax "+intArray[0]+ valueString, intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
187 	}
188 }
189 
190 @Test
test_setMinimumI()191 public void test_setMinimumI() {
192 
193 	int [][] testValues = getSetMinimumValues();
194 
195 	for (int[] intArray : testValues) {
196 		setDefaults();
197 		slider.setMinimum(intArray[0]);
198 		String valueString = valueString(intArray);
199 		report("setMin "+intArray[0]+valueString, intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
200 	}
201 }
202 
203 @Test
test_setPageIncrementI()204 public void test_setPageIncrementI() {
205 	slider.setPageIncrement(3);
206 	assertTrue(":a:", slider.getPageIncrement()== 3);
207 }
208 
209 @Test
test_setSelectionI()210 public void test_setSelectionI() {
211 	int [][] testValues = getSetSelectionValues();
212 	for (int[] intArray : testValues) {
213 		setDefaults();
214 		slider.setSelection(intArray[0]);
215 		String valueString = valueString(intArray);
216 		report("setSel "+intArray[0]+valueString,intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
217 	}
218 }
219 
220 @Test
test_setThumbI()221 public void test_setThumbI() {
222 
223 	int [][] testValues = getSetThumbValues();
224 
225 	for (int[] intArray : testValues) {
226 		setDefaults();
227 		slider.setThumb(intArray[0]);
228 		String valueString = valueString(intArray);
229 		report("setThmb "+intArray[0]+valueString,intArray[0], intArray[1], intArray[2], intArray[3], intArray[4]);
230 	}
231 }
232 
233 @Test
test_setValuesIIIIII()234 public void test_setValuesIIIIII() {
235 	slider.setValues(10, 10, 50, 2, 5, 10);
236 	assertTrue(":a:", slider.getSelection() == 10);
237 	assertTrue(":b:", slider.getMinimum() == 10);
238 	assertTrue(":c:", slider.getMaximum() == 50);
239 	assertTrue(":d:", slider.getThumb() == 2);
240 	assertTrue(":e:", slider.getIncrement() == 5);
241 	assertTrue(":f:", slider.getPageIncrement() == 10);
242 }
243 
244 
245 /* custom */
246 @Override
247 @Test
test_setFontLorg_eclipse_swt_graphics_Font()248 public void test_setFontLorg_eclipse_swt_graphics_Font() {
249 	// overridden from Control because it does not make sense
250 	// to set the font of a Slider.
251 }
252 
253 Slider slider;
254 
255 // this method must be private or protected so the auto-gen tool keeps it
report(String call, int set, int minExpected, int maxExpected, int selectionExpected, int thumbExpected)256 private void report(String call, int set, int minExpected, int maxExpected, int selectionExpected, int thumbExpected) {
257 	// Uncomment these lines and comment out call to check() if you want the test to report all errors without
258 	// stopping.
259 //	if (slider.getMinimum() != minExpected) {
260 //		System.out.println(call + " : Minimum Expected: " + minExpected + "  Actual: " + slider.getMinimum());
261 //	}
262 //	if (slider.getMaximum() != maxExpected){
263 //		System.out.println(call + " : Maximum Expected: " + maxExpected + "  Actual: " + slider.getMaximum());
264 //	}
265 //	if (slider.getSelection() != selectionExpected) {
266 //		System.out.println(call + " : Selection Expected: " + selectionExpected + "  Actual: " + slider.getSelection());
267 //	}
268 //	if (slider.getThumb() != thumbExpected) {
269 //		System.out.println(call + " : Thumb Expected: " + thumbExpected + "  Actual: " + slider.getThumb());
270 //	}
271 	check(call, minExpected, maxExpected, selectionExpected, thumbExpected);
272 }
273 // this method must be private or protected so the auto-gen tool keeps it
check(String call, int minExpected, int maxExpected, int selectionExpected, int thumbExpected)274 private void check(String call, int minExpected, int maxExpected, int selectionExpected, int thumbExpected) {
275 	assertEquals(call+" max ", maxExpected, slider.getMaximum());
276 	assertEquals(call+" min ", minExpected, slider.getMinimum());
277 	assertEquals(call+" sel ", selectionExpected, slider.getSelection());
278 	assertEquals(call+" thmb ", thumbExpected, slider.getThumb());
279 }
280 // this method must be private or protected so the auto-gen tool keeps it
getSetThumbValues()281 private int[][] getSetThumbValues() {
282 return new int[][] {
283 {-15, 10, 100, 50, 10},
284 {-14, 10, 100, 50, 10},
285 {-13, 10, 100, 50, 10},
286 {-12, 10, 100, 50, 10},
287 {-11, 10, 100, 50, 10},
288 {-10, 10, 100, 50, 10},
289 {-9, 10, 100, 50, 10},
290 {-8, 10, 100, 50, 10},
291 {-7, 10, 100, 50, 10},
292 {-6, 10, 100, 50, 10},
293 {-5, 10, 100, 50, 10},
294 {-4, 10, 100, 50, 10},
295 {-3, 10, 100, 50, 10},
296 {-2, 10, 100, 50, 10},
297 {-1, 10, 100, 50, 10},
298 {0, 10, 100, 50, 10},
299 {1, 10, 100, 50, 1},
300 {2, 10, 100, 50, 2},
301 {3, 10, 100, 50, 3},
302 {4, 10, 100, 50, 4},
303 {5, 10, 100, 50, 5},
304 {6, 10, 100, 50, 6},
305 {7, 10, 100, 50, 7},
306 {8, 10, 100, 50, 8},
307 {9, 10, 100, 50, 9},
308 {10, 10, 100, 50, 10},
309 {11, 10, 100, 50, 11},
310 {12, 10, 100, 50, 12},
311 {13, 10, 100, 50, 13},
312 {14, 10, 100, 50, 14},
313 {15, 10, 100, 50, 15},
314 {16, 10, 100, 50, 16},
315 {17, 10, 100, 50, 17},
316 {18, 10, 100, 50, 18},
317 {19, 10, 100, 50, 19},
318 {20, 10, 100, 50, 20},
319 {21, 10, 100, 50, 21},
320 {22, 10, 100, 50, 22},
321 {23, 10, 100, 50, 23},
322 {24, 10, 100, 50, 24},
323 {25, 10, 100, 50, 25},
324 {26, 10, 100, 50, 26},
325 {27, 10, 100, 50, 27},
326 {28, 10, 100, 50, 28},
327 {29, 10, 100, 50, 29},
328 {30, 10, 100, 50, 30},
329 {31, 10, 100, 50, 31},
330 {32, 10, 100, 50, 32},
331 {33, 10, 100, 50, 33},
332 {34, 10, 100, 50, 34},
333 {35, 10, 100, 50, 35},
334 {36, 10, 100, 50, 36},
335 {37, 10, 100, 50, 37},
336 {38, 10, 100, 50, 38},
337 {39, 10, 100, 50, 39},
338 {40, 10, 100, 50, 40},
339 {41, 10, 100, 50, 41},
340 {42, 10, 100, 50, 42},
341 {43, 10, 100, 50, 43},
342 {44, 10, 100, 50, 44},
343 {45, 10, 100, 50, 45},
344 {46, 10, 100, 50, 46},
345 {47, 10, 100, 50, 47},
346 {48, 10, 100, 50, 48},
347 {49, 10, 100, 50, 49},
348 {50, 10, 100, 50, 50},
349 {51, 10, 100, 49, 51},
350 {52, 10, 100, 48, 52},
351 {53, 10, 100, 47, 53},
352 {54, 10, 100, 46, 54},
353 {55, 10, 100, 45, 55},
354 {56, 10, 100, 44, 56},
355 {57, 10, 100, 43, 57},
356 {58, 10, 100, 42, 58},
357 {59, 10, 100, 41, 59},
358 {60, 10, 100, 40, 60},
359 {61, 10, 100, 39, 61},
360 {62, 10, 100, 38, 62},
361 {63, 10, 100, 37, 63},
362 {64, 10, 100, 36, 64},
363 {65, 10, 100, 35, 65},
364 {66, 10, 100, 34, 66},
365 {67, 10, 100, 33, 67},
366 {68, 10, 100, 32, 68},
367 {69, 10, 100, 31, 69},
368 {70, 10, 100, 30, 70},
369 {71, 10, 100, 29, 71},
370 {72, 10, 100, 28, 72},
371 {73, 10, 100, 27, 73},
372 {74, 10, 100, 26, 74},
373 {75, 10, 100, 25, 75},
374 {76, 10, 100, 24, 76},
375 {77, 10, 100, 23, 77},
376 {78, 10, 100, 22, 78},
377 {79, 10, 100, 21, 79},
378 {80, 10, 100, 20, 80},
379 {81, 10, 100, 19, 81},
380 {82, 10, 100, 18, 82},
381 {83, 10, 100, 17, 83},
382 {84, 10, 100, 16, 84},
383 {85, 10, 100, 15, 85},
384 {86, 10, 100, 14, 86},
385 {87, 10, 100, 13, 87},
386 {88, 10, 100, 12, 88},
387 {89, 10, 100, 11, 89},
388 {90, 10, 100, 10, 90},
389 {91, 10, 100, 10, 90},
390 {92, 10, 100, 10, 90},
391 {93, 10, 100, 10, 90},
392 {94, 10, 100, 10, 90},
393 {95, 10, 100, 10, 90},
394 {96, 10, 100, 10, 90},
395 {97, 10, 100, 10, 90},
396 {98, 10, 100, 10, 90},
397 {99, 10, 100, 10, 90},
398 {100, 10, 100, 10, 90},
399 {101, 10, 100, 10, 90},
400 {102, 10, 100, 10, 90},
401 {103, 10, 100, 10, 90},
402 {104, 10, 100, 10, 90},
403 {105, 10, 100, 10, 90},
404 {106, 10, 100, 10, 90},
405 {107, 10, 100, 10, 90},
406 {108, 10, 100, 10, 90},
407 {109, 10, 100, 10, 90},
408 {110, 10, 100, 10, 90},
409 {111, 10, 100, 10, 90},
410 {112, 10, 100, 10, 90},
411 {113, 10, 100, 10, 90},
412 {114, 10, 100, 10, 90},
413 {115, 10, 100, 10, 90},
414 {116, 10, 100, 10, 90},
415 {117, 10, 100, 10, 90},
416 {118, 10, 100, 10, 90},
417 {119, 10, 100, 10, 90},
418 {120, 10, 100, 10, 90},
419 {121, 10, 100, 10, 90},
420 {122, 10, 100, 10, 90},
421 {123, 10, 100, 10, 90},
422 {124, 10, 100, 10, 90},
423 };
424 }
425 // this method must be private or protected so the auto-gen tool keeps it
getSetMinimumValues()426 private int[][] getSetMinimumValues() {
427 return new int[][] {
428 {-15, 10, 100, 50, 10},
429 {-14, 10, 100, 50, 10},
430 {-13, 10, 100, 50, 10},
431 {-12, 10, 100, 50, 10},
432 {-11, 10, 100, 50, 10},
433 {-10, 10, 100, 50, 10},
434 {-9, 10, 100, 50, 10},
435 {-8, 10, 100, 50, 10},
436 {-7, 10, 100, 50, 10},
437 {-6, 10, 100, 50, 10},
438 {-5, 10, 100, 50, 10},
439 {-4, 10, 100, 50, 10},
440 {-3, 10, 100, 50, 10},
441 {-2, 10, 100, 50, 10},
442 {-1, 10, 100, 50, 10},
443 {0, 0, 100, 50, 10},
444 {1, 1, 100, 50, 10},
445 {2, 2, 100, 50, 10},
446 {3, 3, 100, 50, 10},
447 {4, 4, 100, 50, 10},
448 {5, 5, 100, 50, 10},
449 {6, 6, 100, 50, 10},
450 {7, 7, 100, 50, 10},
451 {8, 8, 100, 50, 10},
452 {9, 9, 100, 50, 10},
453 {10, 10, 100, 50, 10},
454 {11, 11, 100, 50, 10},
455 {12, 12, 100, 50, 10},
456 {13, 13, 100, 50, 10},
457 {14, 14, 100, 50, 10},
458 {15, 15, 100, 50, 10},
459 {16, 16, 100, 50, 10},
460 {17, 17, 100, 50, 10},
461 {18, 18, 100, 50, 10},
462 {19, 19, 100, 50, 10},
463 {20, 20, 100, 50, 10},
464 {21, 21, 100, 50, 10},
465 {22, 22, 100, 50, 10},
466 {23, 23, 100, 50, 10},
467 {24, 24, 100, 50, 10},
468 {25, 25, 100, 50, 10},
469 {26, 26, 100, 50, 10},
470 {27, 27, 100, 50, 10},
471 {28, 28, 100, 50, 10},
472 {29, 29, 100, 50, 10},
473 {30, 30, 100, 50, 10},
474 {31, 31, 100, 50, 10},
475 {32, 32, 100, 50, 10},
476 {33, 33, 100, 50, 10},
477 {34, 34, 100, 50, 10},
478 {35, 35, 100, 50, 10},
479 {36, 36, 100, 50, 10},
480 {37, 37, 100, 50, 10},
481 {38, 38, 100, 50, 10},
482 {39, 39, 100, 50, 10},
483 {40, 40, 100, 50, 10},
484 {41, 41, 100, 50, 10},
485 {42, 42, 100, 50, 10},
486 {43, 43, 100, 50, 10},
487 {44, 44, 100, 50, 10},
488 {45, 45, 100, 50, 10},
489 {46, 46, 100, 50, 10},
490 {47, 47, 100, 50, 10},
491 {48, 48, 100, 50, 10},
492 {49, 49, 100, 50, 10},
493 {50, 50, 100, 50, 10},
494 {51, 51, 100, 51, 10},
495 {52, 52, 100, 52, 10},
496 {53, 53, 100, 53, 10},
497 {54, 54, 100, 54, 10},
498 {55, 55, 100, 55, 10},
499 {56, 56, 100, 56, 10},
500 {57, 57, 100, 57, 10},
501 {58, 58, 100, 58, 10},
502 {59, 59, 100, 59, 10},
503 {60, 60, 100, 60, 10},
504 {61, 61, 100, 61, 10},
505 {62, 62, 100, 62, 10},
506 {63, 63, 100, 63, 10},
507 {64, 64, 100, 64, 10},
508 {65, 65, 100, 65, 10},
509 {66, 66, 100, 66, 10},
510 {67, 67, 100, 67, 10},
511 {68, 68, 100, 68, 10},
512 {69, 69, 100, 69, 10},
513 {70, 70, 100, 70, 10},
514 {71, 71, 100, 71, 10},
515 {72, 72, 100, 72, 10},
516 {73, 73, 100, 73, 10},
517 {74, 74, 100, 74, 10},
518 {75, 75, 100, 75, 10},
519 {76, 76, 100, 76, 10},
520 {77, 77, 100, 77, 10},
521 {78, 78, 100, 78, 10},
522 {79, 79, 100, 79, 10},
523 {80, 80, 100, 80, 10},
524 {81, 81, 100, 81, 10},
525 {82, 82, 100, 82, 10},
526 {83, 83, 100, 83, 10},
527 {84, 84, 100, 84, 10},
528 {85, 85, 100, 85, 10},
529 {86, 86, 100, 86, 10},
530 {87, 87, 100, 87, 10},
531 {88, 88, 100, 88, 10},
532 {89, 89, 100, 89, 10},
533 {90, 90, 100, 90, 10},
534 {91, 91, 100, 91, 9},
535 {92, 92, 100, 92, 8},
536 {93, 93, 100, 93, 7},
537 {94, 94, 100, 94, 6},
538 {95, 95, 100, 95, 5},
539 {96, 96, 100, 96, 4},
540 {97, 97, 100, 97, 3},
541 {98, 98, 100, 98, 2},
542 {99, 99, 100, 99, 1},
543 {100, 10, 100, 50, 10},
544 {101, 10, 100, 50, 10},
545 {102, 10, 100, 50, 10},
546 {103, 10, 100, 50, 10},
547 {104, 10, 100, 50, 10},
548 {105, 10, 100, 50, 10},
549 {106, 10, 100, 50, 10},
550 {107, 10, 100, 50, 10},
551 {108, 10, 100, 50, 10},
552 {109, 10, 100, 50, 10},
553 {110, 10, 100, 50, 10},
554 {111, 10, 100, 50, 10},
555 {112, 10, 100, 50, 10},
556 {113, 10, 100, 50, 10},
557 {114, 10, 100, 50, 10},
558 {115, 10, 100, 50, 10},
559 {116, 10, 100, 50, 10},
560 {117, 10, 100, 50, 10},
561 {118, 10, 100, 50, 10},
562 {119, 10, 100, 50, 10},
563 {120, 10, 100, 50, 10},
564 {121, 10, 100, 50, 10},
565 {122, 10, 100, 50, 10},
566 {123, 10, 100, 50, 10},
567 {124, 10, 100, 50, 10},
568 };
569 }
570 // this method must be private or protected so the auto-gen tool keeps it
getSetMaximumValues()571 private int[][] getSetMaximumValues() {
572 return new int[][] {
573 {-15, 10, 100, 50, 10},
574 {-14, 10, 100, 50, 10},
575 {-13, 10, 100, 50, 10},
576 {-12, 10, 100, 50, 10},
577 {-11, 10, 100, 50, 10},
578 {-10, 10, 100, 50, 10},
579 {-9, 10, 100, 50, 10},
580 {-8, 10, 100, 50, 10},
581 {-7, 10, 100, 50, 10},
582 {-6, 10, 100, 50, 10},
583 {-5, 10, 100, 50, 10},
584 {-4, 10, 100, 50, 10},
585 {-3, 10, 100, 50, 10},
586 {-2, 10, 100, 50, 10},
587 {-1, 10, 100, 50, 10},
588 {0, 10, 100, 50, 10},
589 {1, 10, 100, 50, 10},
590 {2, 10, 100, 50, 10},
591 {3, 10, 100, 50, 10},
592 {4, 10, 100, 50, 10},
593 {5, 10, 100, 50, 10},
594 {6, 10, 100, 50, 10},
595 {7, 10, 100, 50, 10},
596 {8, 10, 100, 50, 10},
597 {9, 10, 100, 50, 10},
598 {10, 10, 100, 50, 10},
599 {11, 10, 11, 10, 1},
600 {12, 10, 12, 10, 2},
601 {13, 10, 13, 10, 3},
602 {14, 10, 14, 10, 4},
603 {15, 10, 15, 10, 5},
604 {16, 10, 16, 10, 6},
605 {17, 10, 17, 10, 7},
606 {18, 10, 18, 10, 8},
607 {19, 10, 19, 10, 9},
608 {20, 10, 20, 10, 10},
609 {21, 10, 21, 11, 10},
610 {22, 10, 22, 12, 10},
611 {23, 10, 23, 13, 10},
612 {24, 10, 24, 14, 10},
613 {25, 10, 25, 15, 10},
614 {26, 10, 26, 16, 10},
615 {27, 10, 27, 17, 10},
616 {28, 10, 28, 18, 10},
617 {29, 10, 29, 19, 10},
618 {30, 10, 30, 20, 10},
619 {31, 10, 31, 21, 10},
620 {32, 10, 32, 22, 10},
621 {33, 10, 33, 23, 10},
622 {34, 10, 34, 24, 10},
623 {35, 10, 35, 25, 10},
624 {36, 10, 36, 26, 10},
625 {37, 10, 37, 27, 10},
626 {38, 10, 38, 28, 10},
627 {39, 10, 39, 29, 10},
628 {40, 10, 40, 30, 10},
629 {41, 10, 41, 31, 10},
630 {42, 10, 42, 32, 10},
631 {43, 10, 43, 33, 10},
632 {44, 10, 44, 34, 10},
633 {45, 10, 45, 35, 10},
634 {46, 10, 46, 36, 10},
635 {47, 10, 47, 37, 10},
636 {48, 10, 48, 38, 10},
637 {49, 10, 49, 39, 10},
638 {50, 10, 50, 40, 10},
639 {51, 10, 51, 41, 10},
640 {52, 10, 52, 42, 10},
641 {53, 10, 53, 43, 10},
642 {54, 10, 54, 44, 10},
643 {55, 10, 55, 45, 10},
644 {56, 10, 56, 46, 10},
645 {57, 10, 57, 47, 10},
646 {58, 10, 58, 48, 10},
647 {59, 10, 59, 49, 10},
648 {60, 10, 60, 50, 10},
649 {61, 10, 61, 50, 10},
650 {62, 10, 62, 50, 10},
651 {63, 10, 63, 50, 10},
652 {64, 10, 64, 50, 10},
653 {65, 10, 65, 50, 10},
654 {66, 10, 66, 50, 10},
655 {67, 10, 67, 50, 10},
656 {68, 10, 68, 50, 10},
657 {69, 10, 69, 50, 10},
658 {70, 10, 70, 50, 10},
659 {71, 10, 71, 50, 10},
660 {72, 10, 72, 50, 10},
661 {73, 10, 73, 50, 10},
662 {74, 10, 74, 50, 10},
663 {75, 10, 75, 50, 10},
664 {76, 10, 76, 50, 10},
665 {77, 10, 77, 50, 10},
666 {78, 10, 78, 50, 10},
667 {79, 10, 79, 50, 10},
668 {80, 10, 80, 50, 10},
669 {81, 10, 81, 50, 10},
670 {82, 10, 82, 50, 10},
671 {83, 10, 83, 50, 10},
672 {84, 10, 84, 50, 10},
673 {85, 10, 85, 50, 10},
674 {86, 10, 86, 50, 10},
675 {87, 10, 87, 50, 10},
676 {88, 10, 88, 50, 10},
677 {89, 10, 89, 50, 10},
678 {90, 10, 90, 50, 10},
679 {91, 10, 91, 50, 10},
680 {92, 10, 92, 50, 10},
681 {93, 10, 93, 50, 10},
682 {94, 10, 94, 50, 10},
683 {95, 10, 95, 50, 10},
684 {96, 10, 96, 50, 10},
685 {97, 10, 97, 50, 10},
686 {98, 10, 98, 50, 10},
687 {99, 10, 99, 50, 10},
688 {100, 10, 100, 50, 10},
689 {101, 10, 101, 50, 10},
690 {102, 10, 102, 50, 10},
691 {103, 10, 103, 50, 10},
692 {104, 10, 104, 50, 10},
693 {105, 10, 105, 50, 10},
694 {106, 10, 106, 50, 10},
695 {107, 10, 107, 50, 10},
696 {108, 10, 108, 50, 10},
697 {109, 10, 109, 50, 10},
698 {110, 10, 110, 50, 10},
699 {111, 10, 111, 50, 10},
700 {112, 10, 112, 50, 10},
701 {113, 10, 113, 50, 10},
702 {114, 10, 114, 50, 10},
703 {115, 10, 115, 50, 10},
704 {116, 10, 116, 50, 10},
705 {117, 10, 117, 50, 10},
706 {118, 10, 118, 50, 10},
707 {119, 10, 119, 50, 10},
708 {120, 10, 120, 50, 10},
709 {121, 10, 121, 50, 10},
710 {122, 10, 122, 50, 10},
711 {123, 10, 123, 50, 10},
712 {124, 10, 124, 50, 10},
713 };
714 }
715 // this method must be private or protected so the auto-gen tool keeps it
setDefaults()716 private void setDefaults() {
717 
718 	slider.setMaximum(100);
719 	slider.setMinimum(10);
720 	slider.setThumb(10);
721 	slider.setSelection(50);
722 
723 }
724 // this method must be private or protected so the auto-gen tool keeps it
getSetSelectionValues()725 private int[][] getSetSelectionValues() {
726 return new int[][] {
727 {-15, 10, 100, 10, 10},
728 {-14, 10, 100, 10, 10},
729 {-13, 10, 100, 10, 10},
730 {-12, 10, 100, 10, 10},
731 {-11, 10, 100, 10, 10},
732 {-10, 10, 100, 10, 10},
733 {-9, 10, 100, 10, 10},
734 {-8, 10, 100, 10, 10},
735 {-7, 10, 100, 10, 10},
736 {-6, 10, 100, 10, 10},
737 {-5, 10, 100, 10, 10},
738 {-4, 10, 100, 10, 10},
739 {-3, 10, 100, 10, 10},
740 {-2, 10, 100, 10, 10},
741 {-1, 10, 100, 10, 10},
742 {0, 10, 100, 10, 10},
743 {1, 10, 100, 10, 10},
744 {2, 10, 100, 10, 10},
745 {3, 10, 100, 10, 10},
746 {4, 10, 100, 10, 10},
747 {5, 10, 100, 10, 10},
748 {6, 10, 100, 10, 10},
749 {7, 10, 100, 10, 10},
750 {8, 10, 100, 10, 10},
751 {9, 10, 100, 10, 10},
752 {10, 10, 100, 10, 10},
753 {11, 10, 100, 11, 10},
754 {12, 10, 100, 12, 10},
755 {13, 10, 100, 13, 10},
756 {14, 10, 100, 14, 10},
757 {15, 10, 100, 15, 10},
758 {16, 10, 100, 16, 10},
759 {17, 10, 100, 17, 10},
760 {18, 10, 100, 18, 10},
761 {19, 10, 100, 19, 10},
762 {20, 10, 100, 20, 10},
763 {21, 10, 100, 21, 10},
764 {22, 10, 100, 22, 10},
765 {23, 10, 100, 23, 10},
766 {24, 10, 100, 24, 10},
767 {25, 10, 100, 25, 10},
768 {26, 10, 100, 26, 10},
769 {27, 10, 100, 27, 10},
770 {28, 10, 100, 28, 10},
771 {29, 10, 100, 29, 10},
772 {30, 10, 100, 30, 10},
773 {31, 10, 100, 31, 10},
774 {32, 10, 100, 32, 10},
775 {33, 10, 100, 33, 10},
776 {34, 10, 100, 34, 10},
777 {35, 10, 100, 35, 10},
778 {36, 10, 100, 36, 10},
779 {37, 10, 100, 37, 10},
780 {38, 10, 100, 38, 10},
781 {39, 10, 100, 39, 10},
782 {40, 10, 100, 40, 10},
783 {41, 10, 100, 41, 10},
784 {42, 10, 100, 42, 10},
785 {43, 10, 100, 43, 10},
786 {44, 10, 100, 44, 10},
787 {45, 10, 100, 45, 10},
788 {46, 10, 100, 46, 10},
789 {47, 10, 100, 47, 10},
790 {48, 10, 100, 48, 10},
791 {49, 10, 100, 49, 10},
792 {50, 10, 100, 50, 10},
793 {51, 10, 100, 51, 10},
794 {52, 10, 100, 52, 10},
795 {53, 10, 100, 53, 10},
796 {54, 10, 100, 54, 10},
797 {55, 10, 100, 55, 10},
798 {56, 10, 100, 56, 10},
799 {57, 10, 100, 57, 10},
800 {58, 10, 100, 58, 10},
801 {59, 10, 100, 59, 10},
802 {60, 10, 100, 60, 10},
803 {61, 10, 100, 61, 10},
804 {62, 10, 100, 62, 10},
805 {63, 10, 100, 63, 10},
806 {64, 10, 100, 64, 10},
807 {65, 10, 100, 65, 10},
808 {66, 10, 100, 66, 10},
809 {67, 10, 100, 67, 10},
810 {68, 10, 100, 68, 10},
811 {69, 10, 100, 69, 10},
812 {70, 10, 100, 70, 10},
813 {71, 10, 100, 71, 10},
814 {72, 10, 100, 72, 10},
815 {73, 10, 100, 73, 10},
816 {74, 10, 100, 74, 10},
817 {75, 10, 100, 75, 10},
818 {76, 10, 100, 76, 10},
819 {77, 10, 100, 77, 10},
820 {78, 10, 100, 78, 10},
821 {79, 10, 100, 79, 10},
822 {80, 10, 100, 80, 10},
823 {81, 10, 100, 81, 10},
824 {82, 10, 100, 82, 10},
825 {83, 10, 100, 83, 10},
826 {84, 10, 100, 84, 10},
827 {85, 10, 100, 85, 10},
828 {86, 10, 100, 86, 10},
829 {87, 10, 100, 87, 10},
830 {88, 10, 100, 88, 10},
831 {89, 10, 100, 89, 10},
832 {90, 10, 100, 90, 10},
833 {91, 10, 100, 90, 10},
834 {92, 10, 100, 90, 10},
835 {93, 10, 100, 90, 10},
836 {94, 10, 100, 90, 10},
837 {95, 10, 100, 90, 10},
838 {96, 10, 100, 90, 10},
839 {97, 10, 100, 90, 10},
840 {98, 10, 100, 90, 10},
841 {99, 10, 100, 90, 10},
842 {100, 10, 100, 90, 10},
843 {101, 10, 100, 90, 10},
844 {102, 10, 100, 90, 10},
845 {103, 10, 100, 90, 10},
846 {104, 10, 100, 90, 10},
847 {105, 10, 100, 90, 10},
848 {106, 10, 100, 90, 10},
849 {107, 10, 100, 90, 10},
850 {108, 10, 100, 90, 10},
851 {109, 10, 100, 90, 10},
852 {110, 10, 100, 90, 10},
853 {111, 10, 100, 90, 10},
854 {112, 10, 100, 90, 10},
855 {113, 10, 100, 90, 10},
856 {114, 10, 100, 90, 10},
857 {115, 10, 100, 90, 10},
858 {116, 10, 100, 90, 10},
859 {117, 10, 100, 90, 10},
860 {118, 10, 100, 90, 10},
861 {119, 10, 100, 90, 10},
862 {120, 10, 100, 90, 10},
863 {121, 10, 100, 90, 10},
864 {122, 10, 100, 90, 10},
865 {123, 10, 100, 90, 10},
866 {124, 10, 100, 90, 10},
867 };
868 }
869 
870 @Test
test_consistency_ArrowSelection()871 public void test_consistency_ArrowSelection() {
872 	consistencyPrePackShell();
873 	consistencyEvent(slider.getSize().x-10, 5, 1, 0, ConsistencyUtility.MOUSE_CLICK);
874 }
875 
876 @Test
test_consistency_KeySelection()877 public void test_consistency_KeySelection () {
878 	consistencyEvent(0, SWT.ARROW_RIGHT, 0, 0, ConsistencyUtility.KEY_PRESS);
879 }
880 
881 @Test
test_consistency_ThumbSelection()882 public void test_consistency_ThumbSelection () {
883 	consistencyEvent(25, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
884 }
885 
886 @Test
test_consistency_TroughSelection()887 public void test_consistency_TroughSelection () {
888 	consistencyEvent(45, 10, 1, 0, ConsistencyUtility.MOUSE_CLICK);
889 }
890 
891 @Test
test_consistency_MenuDetect()892 public void test_consistency_MenuDetect () {
893 	consistencyEvent(27, 5, 3, 0, ConsistencyUtility.MOUSE_CLICK);
894 }
895 
896 @Test
test_consistency_DragDetect()897 public void test_consistency_DragDetect () {
898 	consistencyEvent(9, 5, 30, 10, ConsistencyUtility.MOUSE_DRAG);
899 }
900 }
901