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 | module EmergencyLoggingTest { | |
9 | ||
10 | modulepar integer tsp_looplimit:=20; | |
11 | ||
12 | import from Titan_LogTestDefinitions all; | |
13 | //import from TitanLoggerControl all; | |
14 | ||
15 | const charstring c_legacy_logger_plugin := "LegacyLogger" | |
16 | ||
17 | testcase tc_user_EL() runs on MTCType { | |
18 | //var Severities vl_sevOrig:=get_file_mask(c_legacy_logger_plugin); | |
19 | //set_file_mask(c_legacy_logger_plugin, {VERDICTOP_SETVERDICT,USER_UNQUALIFIED}); | |
20 | var integer a, b; | |
21 | log("Before the loop"); | |
22 | action(">>>>ACTION in ",%testcaseId,", before the loop<<<<<"); | |
23 | for(var integer i:=0; i<tsp_looplimit;i:=i+1) { | |
24 | log( %testcaseId," loop ", i); | |
25 | } | |
26 | action(">>>>ACTION in ",%testcaseId,", after the loop<<<<<"); | |
27 | setverdict(pass); | |
28 | log("This line is reached last"); | |
29 | a:=b; //DTE, unbound value on the right side | |
30 | log("This line never reached 1."); | |
31 | setverdict(pass); | |
32 | } | |
33 | ||
34 | testcase tc_user() runs on MTCType { | |
35 | log("Before the loop"); | |
36 | action(">>>>ACTION in ",%testcaseId,", before the loop<<<<<"); | |
37 | for(var integer i:=0; i<tsp_looplimit;i:=i+1) { | |
38 | log( %testcaseId," loop ", i); | |
39 | } | |
40 | action(">>>>ACTION in ",%testcaseId,", after the loop<<<<<"); | |
41 | setverdict(pass); | |
42 | log("This line reached last"); | |
43 | } | |
44 | ||
45 | //Expected output: | |
46 | //TESTCASE_START EmergencyLoggingTest.ttcn:25 Test case tc_second started. | |
47 | //PARALLEL_PTC EmergencyLoggingTest.ttcn:25 Initializing variables, timers and ports of component type Titan_LogTestDefinitions.MTCType inside testcase tc_second. | |
48 | //PORTEVENT_STATE EmergencyLoggingTest.ttcn:25 Port internal_port was started. | |
49 | //PORTEVENT_STATE EmergencyLoggingTest.ttcn:25 Port external_port was started. | |
50 | //PARALLEL_PTC EmergencyLoggingTest.ttcn:25 Component type Titan_LogTestDefinitions.MTCType was initialized. | |
51 | //PARALLEL_UNQUALIFIED EmergencyLoggingTest.ttcn:27 Creating new PTC with component type Titan_LogTestDefinitions.MTCType. | |
52 | //PARALLEL_PTC EmergencyLoggingTest.ttcn:27 PTC was created. Component reference: 3, alive: no, type: Titan_LogTestDefinitions.MTCType. | |
53 | //PARALLEL_UNQUALIFIED EmergencyLoggingTest.ttcn:28 Creating new PTC with component type Titan_LogTestDefinitions.MTCType. | |
54 | //PARALLEL_PTC EmergencyLoggingTest.ttcn:28 PTC was created. Component reference: 4, alive: no, type: Titan_LogTestDefinitions.MTCType. | |
55 | //USER_UNQUALIFIED EmergencyLoggingTest.ttcn:29 Before the DTE | |
56 | ||
57 | testcase tc_PTC_create_EL() runs on MTCType { | |
58 | var MTCType vc_1, vc_2; | |
59 | vc_1:= MTCType.create; | |
60 | vc_2:= MTCType.create; | |
61 | var integer a,b; | |
62 | log("Last line before the DTE"); | |
63 | a:=b; //DTE | |
64 | log("This line is reached last 2."); | |
65 | } | |
66 | ||
67 | testcase tc_PTC_create() runs on MTCType { | |
68 | var MTCType vc_1, vc_2; | |
69 | vc_1:= MTCType.create; | |
70 | vc_2:= MTCType.create; | |
71 | var integer a,b; | |
72 | log("This line is reached last in ", %testcaseId); | |
73 | } | |
74 | ||
75 | function f_plugin_behaviour(in charstring pl_msg) runs on MTCType { | |
76 | log("Hello, login from", pl_msg); | |
77 | var integer a,b; | |
78 | a:=b; //DTE | |
79 | } | |
80 | ||
81 | testcase tc_plugins() runs on MTCType { | |
82 | var MTCType vc_1, vc_2; | |
83 | vc_1:= MTCType.create("Comp1"); | |
84 | vc_2:= MTCType.create("Comp2"); | |
85 | vc_1.start(f_plugin_behaviour("This is Comp1")); | |
86 | vc_2.start(f_plugin_behaviour("This is Comp2")); | |
87 | vc_1.done; | |
88 | vc_2.done; | |
89 | } | |
90 | ||
91 | control { | |
92 | timer t:=1000.0; t.start; | |
93 | var float vl_finish:=0.0; | |
94 | var float vl_start:=t.read; | |
95 | action("Start:",vl_start, " s"); | |
96 | for(var integer i:=0;i<5;i:=i+1) { | |
97 | action("Outer loop follows with index ", i); | |
98 | execute(tc_user()); | |
99 | action("Outer loop finished with index ", i); | |
100 | } | |
101 | execute(tc_PTC_create_EL()); //Trigger/geneerate emergency log | |
102 | vl_finish:=t.read; | |
103 | action("Finish:", vl_finish); | |
104 | action("Elapsed time:", vl_finish-vl_start, " s"); | |
105 | }//control | |
106 | ||
107 | }//eof module |