Sync with 5.4.0
[deliverable/titan.core.git] / titan_executor_api / TITAN_Executor_API_test / src / org / eclipse / titan / executorapi / test / Test1Observer.java
CommitLineData
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 ******************************************************************************/
8package org.eclipse.titan.executorapi.test;
9
10import java.util.List;
11
12import org.eclipse.titan.executor.jni.McStateEnum;
13import org.eclipse.titan.executorapi.JniExecutor;
14import org.eclipse.titan.executorapi.exception.JniExecutorException;
15import org.eclipse.titan.executorapi.test.JniExecutorAsyncHappyTest.ExecutionMethod;
16import org.eclipse.titan.executorapi.test.JniExecutorAsyncHappyTest.McRoute;
17import 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 */
25class 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}
This page took 0.028852 seconds and 5 git commands to generate.