File tree Expand file tree Collapse file tree 4 files changed +51
-33
lines changed
scripts/hellocodenameone/common/src/main
java/com/codenameone/examples/hellocodenameone
kotlin/com/codenameone/examples/hellocodenameone Expand file tree Collapse file tree 4 files changed +51
-33
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3434import com .codenameone .examples .hellocodenameone .tests .graphics .TransformTranslation ;
3535import com .codenameone .examples .hellocodenameone .tests .accessibility .AccessibilityTest ;
3636
37+ import java .util .ArrayList ;
38+ import java .util .Arrays ;
39+ import java .util .List ;
40+
3741public final class Cn1ssDeviceRunner extends DeviceRunner {
38- private static final BaseTest [] TEST_CLASSES = new BaseTest [] {
42+ private static final List < BaseTest > TEST_CLASSES = new ArrayList <>( Arrays . asList (
3943 new MainScreenScreenshotTest (),
4044 new DrawLine (),
4145 new FillRect (),
@@ -66,8 +70,11 @@ public final class Cn1ssDeviceRunner extends DeviceRunner {
6670 new MediaPlaybackScreenshotTest (),
6771 new OrientationLockScreenshotTest (),
6872 new InPlaceEditViewTest (),
69- new AccessibilityTest ()
70- };
73+ new AccessibilityTest ()));
74+
75+ public static void addTest (BaseTest test ) {
76+ TEST_CLASSES .add (0 , test );
77+ }
7178
7279 public void runSuite () {
7380 CN .callSerially (() -> {
Original file line number Diff line number Diff line change 1+ package com.codenameone.examples.hellocodenameone
2+
3+ import com.codename1.system.Lifecycle
4+ import com.codename1.testing.TestReporting
5+ import com.codenameone.examples.hellocodenameone.tests.Cn1ssDeviceRunner
6+ import com.codenameone.examples.hellocodenameone.tests.Cn1ssDeviceRunnerReporter
7+ import com.codenameone.examples.hellocodenameone.tests.KotlinUiTest
8+
9+ open class HelloCodenameOne : Lifecycle () {
10+ override fun init (context : Any? ) {
11+ super .init (context)
12+ Cn1ssDeviceRunner .addTest(KotlinUiTest ())
13+ TestReporting .setInstance(Cn1ssDeviceRunnerReporter ())
14+ }
15+
16+ override fun runApp () {
17+ Thread (Runnable { Cn1ssDeviceRunner ().runSuite() }).start()
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ package com.codenameone.examples.hellocodenameone.tests
2+
3+ import com.codename1.components.Accordion
4+ import com.codename1.components.MultiButton
5+ import com.codename1.components.Switch
6+ import com.codename1.ui.Button
7+ import com.codename1.ui.layouts.BoxLayout
8+
9+ class KotlinUiTest : BaseTest () {
10+ override fun runTest (): Boolean {
11+ var kotlinForm = createForm(" Kotlin" , BoxLayout .y(), " kotlin" )
12+ kotlinForm.add(Button (" Kotlin Button" ))
13+ var on = Switch ()
14+ on.setOn()
15+ kotlinForm.add(BoxLayout .encloseX(Switch (), on))
16+ var acc = Accordion ()
17+ acc.add(MultiButton (" MultiButton Line 1" ))
18+ kotlinForm.add(acc);
19+ kotlinForm.show()
20+ return true
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments