98328c23aaae0c15b2a0b994aac8675ce2a54717
[deliverable/titan.core.git] / titan_executor_api / TITAN_Executor_API_test / src / org / eclipse / titan / executorapi / test / Test1Observer.java
1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
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 * Contributors:
9 * Balasko, Jeno
10 * Lovassy, Arpad
11 *
12 ******************************************************************************/
13 package org.eclipse.titan.executorapi.test;
14
15 import java.util.List;
16
17 import org.eclipse.titan.executor.jni.McStateEnum;
18 import org.eclipse.titan.executorapi.JniExecutor;
19 import org.eclipse.titan.executorapi.exception.JniExecutorException;
20 import org.eclipse.titan.executorapi.test.JniExecutorAsyncHappyTest.ExecutionMethod;
21 import org.eclipse.titan.executorapi.test.JniExecutorAsyncHappyTest.McRoute;
22 import org.eclipse.titan.executorapi.util.Log;
23
24 /**
25 * observer
26 * async
27 * route 1: MC_LISTENING -> startHostControllers() -> MC_HC_CONNECTED -> configure() ->(MC_CONFIGURING) -> MC_ACTIVE
28 * testcase by name
29 */
30 class Test1Observer extends TestObserverBase {
31
32 public Test1Observer( final JniExecutor aJe, final String aModule, final List<String> aTestcases ) {
33 super( aJe, McRoute.ROUTE_1, ExecutionMethod.TEST_CASE );
34 setModule(aModule);
35 setTestcases(aTestcases);
36 }
37
38 @Override
39 public void statusChanged2( final McStateEnum aNewState ) throws JniExecutorException {
40 Log.fi(aNewState);
41 switch (aNewState) {
42 case MC_HC_CONNECTED:
43 mJe.configure();
44 break;
45 case MC_ACTIVE:
46 if ( mTestcases.size() > 0 ) {
47 mJe.createMTC();
48 }
49 else {
50 mJe.shutdownSession();
51 }
52 break;
53 case MC_READY:
54 if ( mTestcases.size() > 0 ) {
55 mJe.executeTestcase( mModule, mTestcases.remove( 0 ) );
56 }
57 else {
58 mJe.exitMTC();
59 }
60 break;
61 default:
62 break;
63 }
64 Log.fo();
65 }
66 }
This page took 0.045433 seconds and 5 git commands to generate.