Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
module UEAppInterfaceAPI_Functions {
// LibHttp
import from LibItsHttp_TypesAndValues all;
import from LibItsHttp_Functions all;
import from LibItsHttp_Templates all;
import from LibItsHttp_JsonTemplates all;
import from LibItsHttp_TestSystem all;
// LibMec/UEAppInterfaceAPI
import from UEAppInterfaceAPI_Templates all;
import from UEAppInterfaceAPI_Pixits all;
// LibMec
import from LibMec_Pics all;
import from LibMec_Pixits all;
group create_ue {
function f_create_ue_app_ctx() runs on HttpComponent system HttpTestAdapter return integer {
// Local variables
var HeaderLines v_headers;
var HttpMessage v_response;
var integer v_result := -1;
// Send createion request
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_UE_APP_CTX_URI,
v_headers,
m_http_message_body_json(
m_body_json_app_context(
m_app_context(
PX_CONTEXT_ID,
PX_ASSOCIATE_UE_APP_ID,
m_required_app_info(
PX_APP_NAME,
PX_APP_PROVIDER,
PX_REFERENCE_URL
)))))));
// Wait for the response
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_201_created(
mw_http_message_body_json(
mw_body_json_app_context(
mw_app_context(
-,
-,
mw_required_app_info(
PX_APP_NAME
))))))) -> value v_response {
tc_ac.stop;
v_result := 0;
log("*** " & testcasename() & ": INFO: IUT successfully responds with a AppContext ***");
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
}
} // End of 'alt' statement
return v_result;
} // End of function f_create_ue_app_ctx
} // End of group create_ue
group delete_ue {
function f_delete_ue_app_ctx() runs on HttpComponent system HttpTestAdapter return integer {
// Local variables
var HeaderLines v_headers;
var integer v_result := -1;
// Send createion request
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_UE_APP_CTX_URI,
v_headers
)));
// Wait for the response
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_204_no_content
)) {
tc_ac.stop;
v_result := 0;
log("*** " & testcasename() & ": INFO: IUT successfully responds with a AppContext ***");
}
[] tc_ac.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
}
} // End of 'alt' statement
return v_result;
} // End of function f_delete_ue_app_ctx
} // End of group delete_ue
} // End of module UEAppInterfaceAPI_Functions