Commit | Line | Data |
---|---|---|
970ed795 | 1 | /****************************************************************************** |
3abe9331 | 2 | * Copyright (c) 2000-2015 Ericsson Telecom AB |
970ed795 EL |
3 | * All rights reserved. This program and the accompanying materials |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | ******************************************************************************/ | |
8 | package org.eclipse.titan.executorapi.test; | |
9 | ||
10 | import java.util.List; | |
11 | ||
12 | import org.eclipse.titan.executor.jni.McStateEnum; | |
13 | import org.eclipse.titan.executorapi.JniExecutor; | |
14 | import org.eclipse.titan.executorapi.exception.JniExecutorException; | |
15 | import org.eclipse.titan.executorapi.test.JniExecutorAsyncHappyTest.ExecutionMethod; | |
16 | import org.eclipse.titan.executorapi.test.JniExecutorAsyncHappyTest.McRoute; | |
17 | import org.eclipse.titan.executorapi.util.Log; | |
18 | ||
19 | /** | |
20 | * observer | |
21 | * async | |
22 | * route 1: MC_LISTENING -> startHostControllers() -> MC_HC_CONNECTED -> configure() ->(MC_CONFIGURING) -> MC_ACTIVE | |
23 | * testcase by name | |
24 | */ | |
25 | class Test1Observer extends TestObserverBase { | |
26 | ||
27 | public Test1Observer( final JniExecutor aJe, final String aModule, final List<String> aTestcases ) { | |
28 | super( aJe, McRoute.ROUTE_1, ExecutionMethod.TEST_CASE ); | |
29 | setModule(aModule); | |
30 | setTestcases(aTestcases); | |
31 | } | |
32 | ||
33 | @Override | |
34 | public void statusChanged2( final McStateEnum aNewState ) throws JniExecutorException { | |
35 | Log.fi(aNewState); | |
36 | switch (aNewState) { | |
37 | case MC_HC_CONNECTED: | |
38 | mJe.configure(); | |
39 | break; | |
40 | case MC_ACTIVE: | |
41 | if ( mTestcases.size() > 0 ) { | |
42 | mJe.createMTC(); | |
43 | } | |
44 | else { | |
45 | mJe.shutdownSession(); | |
46 | } | |
47 | break; | |
48 | case MC_READY: | |
49 | if ( mTestcases.size() > 0 ) { | |
50 | mJe.executeTestcase( mModule, mTestcases.remove( 0 ) ); | |
51 | } | |
52 | else { | |
53 | mJe.exitMTC(); | |
54 | } | |
55 | break; | |
56 | default: | |
57 | break; | |
58 | } | |
59 | Log.fo(); | |
60 | } | |
61 | } |