Disable TestHasApps.
[SquirrelJME.git] / modules / midp-lcdui / src / test / java / lcdui / list / BaseList.java
blob80d3765ac7f300ade65002585becb3dbb5475add
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package lcdui.list;
12 import javax.microedition.lcdui.Choice;
13 import javax.microedition.lcdui.Display;
14 import javax.microedition.lcdui.List;
15 import lcdui.BaseDisplay;
17 /**
18 * Base class for testing LCDUI {@link List}.
20 * @since 2020/11/01
22 public abstract class BaseList
23 extends BaseDisplay
25 /**
26 * Tests on the given list.
28 * @param __display The display being tested.
29 * @param __list The list to test on.
30 * @param __type The type of list used.
31 * @param __typeName The type name of the list.
32 * @throws Throwable On any exception.
33 * @since 2020/11/01
35 protected abstract void test(Display __display, List __list, int __type,
36 String __typeName)
37 throws Throwable;
39 /**
40 * {@inheritDoc}
41 * @since 2020/11/11
43 @Override
44 public void test(Display __display, String __param)
45 throws Throwable
47 // Which type of list is used?
48 int listType;
49 switch (__param)
51 case "EXCLUSIVE":
52 listType = Choice.EXCLUSIVE;
53 break;
55 case "IMPLICIT":
56 listType = Choice.IMPLICIT;
57 break;
59 case "MULTIPLE":
60 listType = Choice.MULTIPLE;
61 break;
63 default:
64 throw new IllegalArgumentException(__param);
67 // Setup and test list
68 List list = new List("List " + __param, listType);
70 __display.setCurrent(list);
72 this.test(__display, list, listType, __param);