tizen 2.3 release
[framework/api/application.git] / TC / testcase / utc_service.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18
19 #include <tet_api.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <app.h>
23
24 static void startup(void);
25 static void cleanup(void);
26
27
28 void (*tet_startup)(void) = startup;
29 void (*tet_cleanup)(void) = cleanup;
30
31 static void utc_app_control_create_positive(void);
32 static void utc_app_control_create_negative(void);
33
34 static void utc_app_control_destroy_positive(void);
35 static void utc_app_control_destroy_negative(void);
36
37 static void utc_app_control_set_operation_positive1(void);
38 static void utc_app_control_set_operation_positive2(void);
39 static void utc_app_control_set_operation_negative(void);
40
41 static void utc_app_control_get_operation_positive(void);
42 static void utc_app_control_get_operation_negative1(void);
43 static void utc_app_control_get_operation_negative2(void);
44 static void utc_app_control_get_operation_negative3(void);
45
46 static void utc_app_control_set_uri_positive1(void);
47 static void utc_app_control_set_uri_positive2(void);
48 static void utc_app_control_set_uri_negative(void);
49
50 static void utc_app_control_get_uri_positive(void);
51 static void utc_app_control_get_uri_negative1(void);
52 static void utc_app_control_get_uri_negative2(void);
53 static void utc_app_control_get_uri_negative3(void);
54
55 static void utc_app_control_set_mime_positive1(void);
56 static void utc_app_control_set_mime_positive2(void);
57 static void utc_app_control_set_mime_negative(void);
58
59 static void utc_app_control_get_mime_positive(void);
60 static void utc_app_control_get_mime_negative1(void);
61 static void utc_app_control_get_mime_negative2(void);
62 static void utc_app_control_get_mime_negative3(void);
63
64 static void utc_app_control_set_package_positive(void);
65 static void utc_app_control_set_package_negative1(void);
66 static void utc_app_control_set_package_negative2(void);
67
68 static void utc_app_control_get_package_positive(void);
69 static void utc_app_control_get_package_negative1(void);
70 static void utc_app_control_get_package_negative2(void);
71 static void utc_app_control_get_package_negative3(void);
72
73 static void utc_app_control_set_app_id_positive(void);
74 static void utc_app_control_set_app_id_negative1(void);
75 static void utc_app_control_set_app_id_negative2(void);
76
77 static void utc_app_control_get_app_id_positive(void);
78 static void utc_app_control_get_app_id_negative1(void);
79 static void utc_app_control_get_app_id_negative2(void);
80 static void utc_app_control_get_app_id_negative3(void);
81
82 static void utc_app_control_set_category_positive(void);
83 static void utc_app_control_set_category_negative1(void);
84 static void utc_app_control_set_category_negative2(void);
85
86 static void utc_app_control_get_category_positive(void);
87 static void utc_app_control_get_category_negative1(void);
88 static void utc_app_control_get_category_negative2(void);
89 static void utc_app_control_get_category_negative3(void);
90
91 static void utc_app_control_set_window_positive(void);
92 static void utc_app_control_set_window_negative1(void);
93 static void utc_app_control_set_window_negative2(void);
94
95 static void utc_app_control_get_window_positive(void);
96 static void utc_app_control_get_window_negative1(void);
97 static void utc_app_control_get_window_negative2(void);
98 static void utc_app_control_get_window_negative3(void);
99
100 static void utc_app_control_add_extra_data_positive(void);
101 static void utc_app_control_add_extra_data_negative1(void);
102 static void utc_app_control_add_extra_data_negative2(void);
103
104 static void utc_app_control_remove_extra_data_positive(void);
105 static void utc_app_control_remove_extra_data_negative1(void);
106 static void utc_app_control_remove_extra_data_negative2(void);
107 static void utc_app_control_remove_extra_data_negative3(void);
108
109 static void utc_app_control_get_extra_data_positive(void);
110 static void utc_app_control_get_extra_data_negative1(void);
111 static void utc_app_control_get_extra_data_negative2(void);
112 static void utc_app_control_get_extra_data_negative3(void);
113 static void utc_app_control_get_extra_data_negative4(void);
114
115 static void utc_app_control_foreach_extra_data_positive(void);
116 static void utc_app_control_foreach_extra_data_negative1(void);
117 static void utc_app_control_foreach_extra_data_negative2(void);
118
119 static void utc_app_control_clone_positive(void);
120 static void utc_app_control_clone_negative1(void);
121 static void utc_app_control_clone_negative2(void);
122
123 static void utc_app_control_send_launch_request_positive1(void);
124 static void utc_app_control_send_launch_request_positive2(void);
125 static void utc_app_control_send_launch_request_positive3(void);
126 static void utc_app_control_send_launch_request_negative1(void);
127 static void utc_app_control_send_launch_request_negative2(void);
128
129 static void utc_app_control_reply_to_launch_request_negative1(void);
130 static void utc_app_control_reply_to_launch_request_negative2(void);
131
132 static void utc_app_control_foreach_app_matched_positive(void);
133 static void utc_app_control_foreach_app_matched_negative1(void);
134 static void utc_app_control_foreach_app_matched_negative2(void);
135
136 static void utc_app_control_add_extra_data_array_positive(void);
137 static void utc_app_control_add_extra_data_array_negative1(void);
138 static void utc_app_control_add_extra_data_array_negative2(void);
139 static void utc_app_control_add_extra_data_array_negative3(void);
140
141 static void utc_app_control_get_extra_data_array_positive(void);
142 static void utc_app_control_get_extra_data_array_negative1(void);
143 static void utc_app_control_get_extra_data_array_negative2(void);
144 static void utc_app_control_get_extra_data_array_negative3(void);
145 static void utc_app_control_get_extra_data_array_negative4(void);
146 static void utc_app_control_get_extra_data_array_negative5(void);
147
148 static void utc_app_control_is_extra_data_array_positive(void);
149 static void utc_app_control_is_extra_data_array_negative1(void);
150 static void utc_app_control_is_extra_data_array_negative2(void);
151 static void utc_app_control_is_extra_data_array_negative3(void);
152 static void utc_app_control_is_extra_data_array_negative4(void);
153
154
155 static void utc_app_control_is_reply_requested_positive1(void);
156 static void utc_app_control_is_reply_requested_negative1(void);
157 static void utc_app_control_is_reply_requested_negative2(void);
158 static void utc_app_control_is_reply_requested_negative3(void);
159
160 static void utc_app_control_get_caller_positive1(void);
161 static void utc_app_control_get_caller_negative1(void);
162 static void utc_app_control_get_caller_negative2(void);
163 static void utc_app_control_get_caller_negative3(void);
164
165 static void utc_app_control_to_bundle_positive1(void);
166 static void utc_app_control_to_bundle_negative1(void);
167 static void utc_app_control_to_bundle_negative2(void);
168 static void utc_app_control_to_bundle_negative3(void);
169
170
171 struct tet_testlist tet_testlist[] = {
172         { utc_app_control_create_positive, 1 },
173         { utc_app_control_create_negative, 1 },
174         { utc_app_control_destroy_positive, 1 },
175         { utc_app_control_destroy_negative, 1 },
176         { utc_app_control_set_operation_positive1, 1 },
177         { utc_app_control_set_operation_positive2, 1 },
178         { utc_app_control_set_operation_negative, 1 },
179         { utc_app_control_get_operation_positive, 1 },
180         { utc_app_control_get_operation_negative1, 1 },
181         { utc_app_control_get_operation_negative2, 1 },
182         { utc_app_control_get_operation_negative3, 1 },
183         { utc_app_control_set_uri_positive1, 1 },
184         { utc_app_control_set_uri_positive2, 1 },
185         { utc_app_control_set_uri_negative, 1 },
186         { utc_app_control_get_uri_positive, 1 },
187         { utc_app_control_get_uri_negative1, 1 },
188         { utc_app_control_get_uri_negative2, 1 },
189         { utc_app_control_get_uri_negative3, 1 },
190         { utc_app_control_set_mime_positive1, 1 },
191         { utc_app_control_set_mime_positive2, 1 },
192         { utc_app_control_set_mime_negative, 1 },
193         { utc_app_control_get_mime_positive, 1 },
194         { utc_app_control_get_mime_negative1, 1 },
195         { utc_app_control_get_mime_negative2, 1 },
196         { utc_app_control_get_mime_negative3, 1 },
197         { utc_app_control_set_package_positive, 1 },
198         { utc_app_control_set_package_negative1, 1 },
199         { utc_app_control_set_package_negative2, 1 },
200         { utc_app_control_get_package_positive, 1 },
201         { utc_app_control_get_package_negative1, 1 },
202         { utc_app_control_get_package_negative2, 1 },
203         { utc_app_control_get_package_negative3, 1 },
204         { utc_app_control_set_app_id_positive, 1 },
205         { utc_app_control_set_app_id_negative1, 1 },
206         { utc_app_control_set_app_id_negative2, 1 },
207         { utc_app_control_get_app_id_positive, 1 },
208         { utc_app_control_get_app_id_negative1, 1 },
209         { utc_app_control_get_app_id_negative2, 1 },
210         { utc_app_control_get_app_id_negative3, 1 },
211         { utc_app_control_set_category_positive, 1 },
212         { utc_app_control_set_category_negative1, 1 },
213         { utc_app_control_set_category_negative2, 1 },
214         { utc_app_control_get_category_positive, 1 },
215         { utc_app_control_get_category_negative1, 1 },
216         { utc_app_control_get_category_negative2, 1 },
217         { utc_app_control_get_category_negative3, 1 },
218         { utc_app_control_set_window_positive, 1 },
219         { utc_app_control_set_window_negative1, 1 },
220         { utc_app_control_set_window_negative2, 1 },
221         { utc_app_control_get_window_positive, 1 },
222         { utc_app_control_get_window_negative1, 1 },
223         { utc_app_control_get_window_negative2, 1 },
224         { utc_app_control_get_window_negative3, 1 },
225         { utc_app_control_add_extra_data_positive, 1 },
226         { utc_app_control_add_extra_data_negative1, 1 },
227         { utc_app_control_add_extra_data_negative2, 1 },
228         { utc_app_control_remove_extra_data_positive, 1 },
229         { utc_app_control_remove_extra_data_negative1, 1 },
230         { utc_app_control_remove_extra_data_negative2, 1 },
231         { utc_app_control_remove_extra_data_negative3, 1 },
232         { utc_app_control_get_extra_data_positive, 1 },
233         { utc_app_control_get_extra_data_negative1, 1 },
234         { utc_app_control_get_extra_data_negative2, 1 },
235         { utc_app_control_get_extra_data_negative3, 1 },
236         { utc_app_control_get_extra_data_negative4, 1 },
237         { utc_app_control_foreach_extra_data_positive, 1 },
238         { utc_app_control_foreach_extra_data_negative1, 1 },
239         { utc_app_control_foreach_extra_data_negative2, 1 },
240         { utc_app_control_clone_positive, 1 },
241         { utc_app_control_clone_negative1, 1 },
242         { utc_app_control_clone_negative2, 1 },
243         { utc_app_control_send_launch_request_positive1, 1 },
244         { utc_app_control_send_launch_request_positive2, 1 },
245         { utc_app_control_send_launch_request_positive3, 1 },
246         { utc_app_control_send_launch_request_negative1, 1 },
247         { utc_app_control_send_launch_request_negative2, 1 },
248         { utc_app_control_reply_to_launch_request_negative1, 1 },
249         { utc_app_control_reply_to_launch_request_negative2, 1 },
250         { utc_app_control_foreach_app_matched_positive, 1 },
251         { utc_app_control_foreach_app_matched_negative1, 1 },
252         { utc_app_control_foreach_app_matched_negative2, 1 },
253         { utc_app_control_add_extra_data_array_positive, 1 },
254         { utc_app_control_add_extra_data_array_negative1, 1 },
255         { utc_app_control_add_extra_data_array_negative2, 1 },
256         { utc_app_control_add_extra_data_array_negative3, 1 },
257         { utc_app_control_get_extra_data_array_positive, 1 },
258         { utc_app_control_get_extra_data_array_negative1, 1 },
259         { utc_app_control_get_extra_data_array_negative2, 1 },
260         { utc_app_control_get_extra_data_array_negative3, 1 },
261         { utc_app_control_get_extra_data_array_negative4, 1 },
262         { utc_app_control_get_extra_data_array_negative5, 1 },
263         { utc_app_control_is_extra_data_array_positive, 1 },
264         { utc_app_control_is_extra_data_array_negative1, 1 },
265         { utc_app_control_is_extra_data_array_negative2, 1 },
266         { utc_app_control_is_extra_data_array_negative3, 1 },
267         { utc_app_control_is_extra_data_array_negative4, 1 },
268         { utc_app_control_is_reply_requested_positive1, 1 },
269         { utc_app_control_is_reply_requested_negative1, 1 },
270         { utc_app_control_is_reply_requested_negative2, 1 },
271         { utc_app_control_is_reply_requested_negative3, 1 },
272         { utc_app_control_get_caller_positive1, 1 },
273         { utc_app_control_get_caller_negative1, 1 },
274         { utc_app_control_get_caller_negative2, 1 },
275         { utc_app_control_get_caller_negative3, 1 },
276         { utc_app_control_to_bundle_positive1, 1 },
277         { utc_app_control_to_bundle_negative1, 1 },
278         { utc_app_control_to_bundle_negative2, 1 },
279         { utc_app_control_to_bundle_negative3, 1 },
280         { NULL, 0 },
281 };
282
283 static void startup(void)
284 {
285         /* start of TC */
286 }
287
288 static void cleanup(void)
289 {
290         /* end of TC */
291 }
292
293
294 static void utc_app_control_create_positive(void)
295 {
296         const char *API_NAME = __FUNCTION__;
297         int ret = SERVICE_ERROR_NONE;
298
299         app_control_h app_control;
300
301         ret = app_control_create(&app_control);
302
303         dts_message(API_NAME, "ret(%d)", ret);
304
305         if(ret == SERVICE_ERROR_NONE)
306         {
307                 dts_pass(API_NAME, "passed");
308         }
309         else
310         {
311                 dts_fail(API_NAME, "failed");
312         }
313 }
314
315 static void utc_app_control_create_negative(void)
316 {
317         const char *API_NAME = __FUNCTION__;
318         int ret = SERVICE_ERROR_NONE;
319
320         ret = app_control_create(NULL);
321
322         dts_message(API_NAME, "ret(%d)", ret);
323
324         if(ret != SERVICE_ERROR_NONE)
325         {
326                 dts_pass(API_NAME, "passed");
327         }
328         else
329         {
330                 dts_fail(API_NAME, "failed");
331         }
332 }
333
334
335 static void utc_app_control_destroy_positive(void)
336 {
337         const char *API_NAME = __FUNCTION__;
338         int ret = SERVICE_ERROR_NONE;
339
340         app_control_h app_control;
341
342         app_control_create(&app_control);
343
344         ret = app_control_destroy(app_control);
345
346         dts_message(API_NAME, "ret(%d)", ret);
347
348         if(ret == SERVICE_ERROR_NONE)
349         {
350                 dts_pass(API_NAME, "passed");
351         }
352         else
353         {
354                 dts_fail(API_NAME, "failed");
355         }
356 }
357
358
359 static void utc_app_control_destroy_negative(void)
360 {
361         const char *API_NAME = __FUNCTION__;
362         int ret = SERVICE_ERROR_NONE;
363
364         ret = app_control_destroy(NULL);
365
366         dts_message(API_NAME, "ret(%d)", ret);
367
368         if(ret != SERVICE_ERROR_NONE)
369         {
370                 dts_pass(API_NAME, "passed");
371         }
372         else
373         {
374                 dts_fail(API_NAME, "failed");
375         }
376 }
377
378
379 static void utc_app_control_set_operation_positive1(void)
380 {
381         const char *API_NAME = __FUNCTION__;
382         int ret = SERVICE_ERROR_NONE;
383
384         const char *input_value = "INPUT_VALUE";
385
386         app_control_h app_control;
387
388         app_control_create(&app_control);
389
390         ret = app_control_set_operation(app_control, input_value);
391
392         dts_message(API_NAME, "ret(%d)", ret);
393
394         if(ret == SERVICE_ERROR_NONE)
395         {
396                 dts_pass(API_NAME, "passed");
397         }
398         else
399         {
400                 dts_fail(API_NAME, "failed");
401         }
402
403         app_control_destroy(app_control);
404
405 }
406
407 static void utc_app_control_set_operation_positive2(void)
408 {
409         const char *API_NAME = __FUNCTION__;
410         int ret = SERVICE_ERROR_NONE;
411
412         app_control_h app_control;
413
414         app_control_create(&app_control);
415
416         ret = app_control_set_operation(app_control, NULL);
417
418         if(ret == SERVICE_ERROR_NONE)
419         {
420                 dts_pass(API_NAME, "passed");
421         }
422         else
423         {
424                 dts_fail(API_NAME, "failed");
425         }
426
427         app_control_destroy(app_control);
428 }
429
430 static void utc_app_control_set_operation_negative(void)
431 {
432         const char *API_NAME = __FUNCTION__;
433         int ret = SERVICE_ERROR_NONE;
434         const char *input_value = "INPUT_VALUE";
435
436         ret = app_control_set_operation(NULL, input_value);
437
438         if(ret != SERVICE_ERROR_NONE)
439         {
440                 dts_pass(API_NAME, "passed");
441         }
442         else
443         {
444                 dts_fail(API_NAME, "failed");
445         }
446 }
447
448
449
450 static void utc_app_control_get_operation_positive(void)
451 {
452         const char *API_NAME = __FUNCTION__;
453         int ret = SERVICE_ERROR_NONE;
454         const char *input_value = "INPUT_VALUE";
455         char *output_value;
456
457         app_control_h app_control;
458
459         app_control_create(&app_control);
460
461         app_control_set_operation(app_control, input_value);
462
463         ret = app_control_get_operation(app_control, &output_value);
464
465         if(ret == SERVICE_ERROR_NONE)
466         {
467                 if(!strcmp(input_value, output_value))
468                 {
469                         dts_pass(API_NAME, "passed");
470                 }
471                 else
472                 {
473                         dts_fail(API_NAME, "failed");
474                 }
475         }
476         else
477         {
478                 dts_fail(API_NAME, "failed");
479         }
480
481         app_control_destroy(app_control);
482
483 }
484
485 static void utc_app_control_get_operation_negative1(void)
486 {
487         const char *API_NAME = __FUNCTION__;
488         int ret = SERVICE_ERROR_NONE;
489         char *output_value;
490
491         ret = app_control_get_operation(NULL, &output_value);
492
493         if(ret != SERVICE_ERROR_NONE)
494         {
495                 dts_pass(API_NAME, "passed");
496         }
497         else
498         {
499                 dts_fail(API_NAME, "failed");
500         }
501 }
502
503 static void utc_app_control_get_operation_negative2(void)
504 {
505         const char *API_NAME = __FUNCTION__;
506         int ret = SERVICE_ERROR_NONE;
507
508         app_control_h app_control;
509
510         app_control_create(&app_control);
511
512         ret = app_control_get_operation(app_control, NULL);
513
514         if(ret != SERVICE_ERROR_NONE)
515         {
516                 dts_pass(API_NAME, "passed");
517         }
518         else
519         {
520                 dts_fail(API_NAME, "failed");
521         }
522
523         app_control_destroy(app_control);
524 }
525
526 static void utc_app_control_get_operation_negative3(void)
527 {
528         const char *API_NAME = __FUNCTION__;
529         int ret = SERVICE_ERROR_NONE;
530         char *output_value;
531
532         app_control_h app_control;
533
534         app_control_create(&app_control);
535
536         ret = app_control_get_operation(app_control, &output_value);
537
538         if(ret == SERVICE_ERROR_NONE && output_value == NULL)
539         {
540                 dts_pass(API_NAME, "passed");
541         }
542         else
543         {
544                 dts_fail(API_NAME, "failed");
545         }
546
547         app_control_destroy(app_control);
548 }
549
550 static void utc_app_control_set_uri_positive1(void)
551 {
552         const char *API_NAME = __FUNCTION__;
553         int ret = SERVICE_ERROR_NONE;
554         const char *input_value = "INPUT_VALUE";
555
556         app_control_h app_control;
557
558         app_control_create(&app_control);
559
560         ret = app_control_set_uri(app_control, input_value);
561
562         if(ret == SERVICE_ERROR_NONE)
563         {
564                 dts_pass(API_NAME, "passed");
565         }
566         else
567         {
568                 dts_fail(API_NAME, "failed");
569         }
570
571         app_control_destroy(app_control);
572
573 }
574
575 static void utc_app_control_set_uri_positive2(void)
576 {
577         const char *API_NAME = __FUNCTION__;
578         int ret = SERVICE_ERROR_NONE;
579
580         app_control_h app_control;
581
582         app_control_create(&app_control);
583
584         ret = app_control_set_uri(app_control, NULL);
585
586         if(ret == SERVICE_ERROR_NONE)
587         {
588                 dts_pass(API_NAME, "passed");
589         }
590         else
591         {
592                 dts_fail(API_NAME, "failed");
593         }
594
595         app_control_destroy(app_control);
596
597 }
598
599 static void utc_app_control_set_uri_negative(void)
600 {
601         const char *API_NAME = __FUNCTION__;
602         int ret = SERVICE_ERROR_NONE;
603         const char *input_value = "INPUT_VALUE";
604
605         ret = app_control_get_uri(NULL, input_value);
606
607         if(ret != SERVICE_ERROR_NONE)
608         {
609                 dts_pass(API_NAME, "passed");
610         }
611         else
612         {
613                 dts_fail(API_NAME, "failed");
614         }
615 }
616
617 static void utc_app_control_get_uri_positive(void)
618 {
619         const char *API_NAME = __FUNCTION__;
620         int ret = SERVICE_ERROR_NONE;
621         const char *input_value = "INPUT_VALUE";
622         char *output_value;
623
624         app_control_h app_control;
625
626         app_control_create(&app_control);
627
628         app_control_set_uri(app_control, input_value);
629
630         app_control_get_uri(app_control, &output_value);
631
632         if(ret == SERVICE_ERROR_NONE)
633         {
634                 if(!strcmp(input_value, output_value))
635                 {
636                         dts_pass(API_NAME, "passed");
637                 }
638                 else
639                 {
640                         dts_fail(API_NAME, "failed");
641                 }
642         }
643         else
644         {
645                 dts_fail(API_NAME, "failed");
646         }
647
648         app_control_destroy(app_control);
649
650 }
651
652 static void utc_app_control_get_uri_negative1(void)
653 {
654         const char *API_NAME = __FUNCTION__;
655         int ret = SERVICE_ERROR_NONE;
656         char *output_value;
657
658         app_control_h app_control;
659
660         app_control_create(&app_control);
661
662         ret = app_control_get_uri(app_control, &output_value);
663
664         if(ret == SERVICE_ERROR_NONE && output_value == NULL)
665         {
666                 dts_pass(API_NAME, "passed");
667         }
668         else
669         {
670                 dts_fail(API_NAME, "failed");
671         }
672
673         app_control_destroy(app_control);
674
675 }
676
677 static void utc_app_control_get_uri_negative2(void)
678 {
679         const char *API_NAME = __FUNCTION__;
680         int ret = SERVICE_ERROR_NONE;
681         char *output_value;
682
683         ret = app_control_get_uri(NULL, &output_value);
684
685         if(ret != SERVICE_ERROR_NONE)
686         {
687                 dts_pass(API_NAME, "passed");
688         }
689         else
690         {
691                 dts_fail(API_NAME, "failed");
692         }
693
694 }
695
696 static void utc_app_control_get_uri_negative3(void)
697 {
698         const char *API_NAME = __FUNCTION__;
699         int ret = SERVICE_ERROR_NONE;
700
701         app_control_h app_control;
702
703         app_control_create(&app_control);
704
705         ret = app_control_get_uri(app_control, NULL);
706
707         if(ret != SERVICE_ERROR_NONE)
708         {
709                 dts_pass(API_NAME, "passed");
710         }
711         else
712         {
713                 dts_fail(API_NAME, "failed");
714         }
715
716         app_control_destroy(app_control);
717
718 }
719
720 static void utc_app_control_set_mime_positive1(void)
721 {
722         const char *API_NAME = __FUNCTION__;
723         int ret = SERVICE_ERROR_NONE;
724         const char *input_value = "INPUT_VALUE";
725
726         app_control_h app_control;
727
728         app_control_create(&app_control);
729
730         ret = app_control_set_mime(app_control, input_value);
731
732         if(ret == SERVICE_ERROR_NONE)
733         {
734                 dts_pass(API_NAME, "passed");
735         }
736         else
737         {
738                 dts_fail(API_NAME, "failed");
739         }
740
741         app_control_destroy(app_control);
742 }
743
744 static void utc_app_control_set_mime_positive2(void)
745 {
746         const char *API_NAME = __FUNCTION__;
747         int ret = SERVICE_ERROR_NONE;
748
749         app_control_h app_control;
750
751         app_control_create(&app_control);
752
753         ret = app_control_set_mime(app_control, NULL);
754
755         if(ret == SERVICE_ERROR_NONE)
756         {
757                 dts_pass(API_NAME, "passed");
758         }
759         else
760         {
761                 dts_fail(API_NAME, "failed");
762         }
763
764         app_control_destroy(app_control);
765 }
766
767
768 static void utc_app_control_set_mime_negative(void)
769 {
770         const char *API_NAME = __FUNCTION__;
771         int ret = SERVICE_ERROR_NONE;
772         const char *input_value = "INPUT_VALUE";
773
774         ret = app_control_set_mime(NULL, input_value);
775
776         if(ret != SERVICE_ERROR_NONE)
777         {
778                 dts_pass(API_NAME, "passed");
779         }
780         else
781         {
782                 dts_fail(API_NAME, "failed");
783         }
784 }
785
786 static void utc_app_control_get_mime_positive(void)
787 {
788         const char *API_NAME = __FUNCTION__;
789         int ret = SERVICE_ERROR_NONE;
790         const char *input_value = "INPUT_VALUE";
791         char *output_value;
792
793         app_control_h app_control;
794
795         app_control_create(&app_control);
796
797         app_control_set_mime(app_control, input_value);
798
799         ret = app_control_get_mime(app_control, &output_value);
800
801         if(ret == SERVICE_ERROR_NONE)
802         {
803                 if(!strcmp(input_value, output_value))
804                 {
805                         dts_pass(API_NAME, "passed");
806                 }
807                 else
808                 {
809                         dts_fail(API_NAME, "failed");
810                 }
811         }
812         else
813         {
814                 dts_fail(API_NAME, "failed");
815         }
816
817         app_control_destroy(app_control);
818 }
819
820 static void utc_app_control_get_mime_negative1(void)
821 {
822         const char *API_NAME = __FUNCTION__;
823         int ret = SERVICE_ERROR_NONE;
824         char *output_value;
825
826         app_control_h app_control;
827
828         app_control_create(&app_control);
829
830         ret = app_control_get_mime(app_control, &output_value);
831
832         if(ret == SERVICE_ERROR_NONE && output_value == NULL)
833         {
834                 dts_pass(API_NAME, "passed");
835         }
836         else
837         {
838                 dts_fail(API_NAME, "failed");
839         }
840
841         app_control_destroy(app_control);
842 }
843
844 static void utc_app_control_get_mime_negative2(void)
845 {
846         const char *API_NAME = __FUNCTION__;
847         int ret = SERVICE_ERROR_NONE;
848         char *output_value;
849
850         ret = app_control_get_mime(NULL, &output_value);
851
852         if(ret != SERVICE_ERROR_NONE)
853         {
854                 dts_pass(API_NAME, "passed");
855         }
856         else
857         {
858                 dts_fail(API_NAME, "failed");
859         }
860 }
861
862 static void utc_app_control_get_mime_negative3(void)
863 {
864         const char *API_NAME = __FUNCTION__;
865         int ret = SERVICE_ERROR_NONE;
866
867         app_control_h app_control;
868
869         app_control_create(&app_control);
870
871         ret = app_control_get_mime(app_control, NULL);
872
873         if(ret != SERVICE_ERROR_NONE)
874         {
875                 dts_pass(API_NAME, "passed");
876         }
877         else
878         {
879                 dts_fail(API_NAME, "failed");
880         }
881
882         app_control_destroy(app_control);
883 }
884
885 static void utc_app_control_set_package_positive(void)
886 {
887         const char *API_NAME = __FUNCTION__;
888         int ret = SERVICE_ERROR_NONE;
889         const char *input_value = "INPUT_VALUE";
890
891         app_control_h app_control;
892
893         app_control_create(&app_control);
894
895         ret = app_control_set_package(app_control, input_value);
896
897         if(ret == SERVICE_ERROR_NONE)
898         {
899                 dts_pass(API_NAME, "passed");
900         }
901         else
902         {
903                 dts_fail(API_NAME, "failed");
904         }
905
906         app_control_destroy(app_control);
907 }
908
909 static void utc_app_control_set_package_negative1(void)
910 {
911         const char *API_NAME = __FUNCTION__;
912         int ret = SERVICE_ERROR_NONE;
913         const char *input_value = "INPUT_VALUE";
914
915         ret = app_control_set_package(NULL, input_value);
916
917         if(ret != SERVICE_ERROR_NONE)
918         {
919                 dts_pass(API_NAME, "passed");
920         }
921         else
922         {
923                 dts_fail(API_NAME, "failed");
924         }
925 }
926
927 static void utc_app_control_set_package_negative2(void)
928 {
929         const char *API_NAME = __FUNCTION__;
930         int ret = SERVICE_ERROR_NONE;
931
932         ret = app_control_set_package(NULL, NULL);
933
934         if(ret != SERVICE_ERROR_NONE)
935         {
936                 dts_pass(API_NAME, "passed");
937         }
938         else
939         {
940                 dts_fail(API_NAME, "failed");
941         }
942 }
943
944 static void utc_app_control_get_package_positive(void)
945 {
946         const char *API_NAME = __FUNCTION__;
947         int ret = SERVICE_ERROR_NONE;
948         const char *input_value = "INPUT_VALUE";
949         char *output_value;
950
951         app_control_h app_control;
952
953         app_control_create(&app_control);
954
955         app_control_set_package(app_control, input_value);
956
957         ret = app_control_get_package(app_control, &output_value);
958
959         if(ret == SERVICE_ERROR_NONE)
960         {
961                 if(!strcmp(input_value, output_value))
962                 {
963                         dts_pass(API_NAME, "passed");
964                 }
965                 else
966                 {
967                         dts_fail(API_NAME, "failed");
968                 }
969         }
970         else
971         {
972                 dts_fail(API_NAME, "failed");
973         }
974
975         app_control_destroy(app_control);
976 }
977
978 static void utc_app_control_get_package_negative1(void)
979 {
980         const char *API_NAME = __FUNCTION__;
981         int ret = SERVICE_ERROR_NONE;
982         char *output_value;
983
984         app_control_h app_control;
985
986         app_control_create(&app_control);
987
988         ret = app_control_get_package(app_control, &output_value);
989
990         if(ret == SERVICE_ERROR_NONE && output_value == NULL)
991         {
992                 dts_pass(API_NAME, "passed");
993         }
994         else
995         {
996                 dts_fail(API_NAME, "failed");
997         }
998
999         app_control_destroy(app_control);
1000 }
1001
1002 static void utc_app_control_get_package_negative2(void)
1003 {
1004         const char *API_NAME = __FUNCTION__;
1005         int ret = SERVICE_ERROR_NONE;
1006         char *output_value;
1007
1008         ret = app_control_get_package(NULL, &output_value);
1009
1010         if(ret != SERVICE_ERROR_NONE)
1011         {
1012                 dts_pass(API_NAME, "passed");
1013         }
1014         else
1015         {
1016                 dts_fail(API_NAME, "failed");
1017         }
1018 }
1019
1020 static void utc_app_control_get_package_negative3(void)
1021 {
1022         const char *API_NAME = __FUNCTION__;
1023         int ret = SERVICE_ERROR_NONE;
1024
1025         app_control_h app_control;
1026
1027         app_control_create(&app_control);
1028
1029         ret = app_control_get_package(app_control, NULL);
1030
1031         if(ret != SERVICE_ERROR_NONE)
1032         {
1033                 dts_pass(API_NAME, "passed");
1034         }
1035         else
1036         {
1037                 dts_fail(API_NAME, "failed");
1038         }
1039
1040         app_control_destroy(app_control);
1041 }
1042
1043 static void utc_app_control_set_app_id_positive(void)
1044 {
1045         const char *API_NAME = __FUNCTION__;
1046         int ret = SERVICE_ERROR_NONE;
1047         const char *input_value = "INPUT_VALUE";
1048
1049         app_control_h app_control;
1050
1051         app_control_create(&app_control);
1052
1053         ret = app_control_set_app_id(app_control, input_value);
1054
1055         if(ret == SERVICE_ERROR_NONE)
1056         {
1057                 dts_pass(API_NAME, "passed");
1058         }
1059         else
1060         {
1061                 dts_fail(API_NAME, "failed");
1062         }
1063
1064         app_control_destroy(app_control);
1065 }
1066
1067 static void utc_app_control_set_app_id_negative1(void)
1068 {
1069         const char *API_NAME = __FUNCTION__;
1070         int ret = SERVICE_ERROR_NONE;
1071
1072         ret = app_control_set_app_id(NULL, NULL);
1073
1074         if(ret != SERVICE_ERROR_NONE)
1075         {
1076                 dts_pass(API_NAME, "passed");
1077         }
1078         else
1079         {
1080                 dts_fail(API_NAME, "failed");
1081         }
1082 }
1083
1084 static void utc_app_control_set_app_id_negative2(void)
1085 {
1086         const char *API_NAME = __FUNCTION__;
1087         int ret = SERVICE_ERROR_NONE;
1088         const char *input_value = "INPUT_VALUE";
1089
1090         ret = app_control_set_app_id(NULL, input_value);
1091
1092         if(ret != SERVICE_ERROR_NONE)
1093         {
1094                 dts_pass(API_NAME, "passed");
1095         }
1096         else
1097         {
1098                 dts_fail(API_NAME, "failed");
1099         }
1100 }
1101
1102 static void utc_app_control_get_app_id_positive(void)
1103 {
1104         const char *API_NAME = __FUNCTION__;
1105         int ret = SERVICE_ERROR_NONE;
1106         const char *input_value = "INPUT_VALUE";
1107         char *output_value;
1108
1109         app_control_h app_control;
1110
1111         app_control_create(&app_control);
1112
1113         app_control_set_app_id(app_control, input_value);
1114
1115         ret = app_control_get_app_id(app_control, &output_value);
1116
1117         if(ret == SERVICE_ERROR_NONE)
1118         {
1119                 if(!strcmp(input_value, output_value))
1120                 {
1121                         dts_pass(API_NAME, "passed");
1122                 }
1123                 else
1124                 {
1125                         dts_fail(API_NAME, "failed");
1126                 }
1127         }
1128         else
1129         {
1130                 dts_fail(API_NAME, "failed");
1131         }
1132
1133         app_control_destroy(app_control);
1134 }
1135
1136 static void utc_app_control_get_app_id_negative1(void)
1137 {
1138         const char *API_NAME = __FUNCTION__;
1139         int ret = SERVICE_ERROR_NONE;
1140         char *output_value;
1141
1142         app_control_h app_control;
1143
1144         app_control_create(&app_control);
1145
1146         ret = app_control_get_app_id(app_control, &output_value);
1147
1148         if(ret == SERVICE_ERROR_NONE && output_value == NULL)
1149         {
1150                 dts_pass(API_NAME, "passed");
1151         }
1152         else
1153         {
1154                 dts_fail(API_NAME, "failed");
1155         }
1156
1157         app_control_destroy(app_control);
1158 }
1159
1160 static void utc_app_control_get_app_id_negative2(void)
1161 {
1162         const char *API_NAME = __FUNCTION__;
1163         int ret = SERVICE_ERROR_NONE;
1164         char *output_value;
1165
1166         ret = app_control_get_app_id(NULL, &output_value);
1167
1168         if(ret != SERVICE_ERROR_NONE)
1169         {
1170                 dts_pass(API_NAME, "passed");
1171         }
1172         else
1173         {
1174                 dts_fail(API_NAME, "failed");
1175         }
1176 }
1177
1178 static void utc_app_control_get_app_id_negative3(void)
1179 {
1180         const char *API_NAME = __FUNCTION__;
1181         int ret = SERVICE_ERROR_NONE;
1182
1183         app_control_h app_control;
1184
1185         app_control_create(&app_control);
1186
1187         ret = app_control_get_app_id(app_control, NULL);
1188
1189         if(ret != SERVICE_ERROR_NONE)
1190         {
1191                 dts_pass(API_NAME, "passed");
1192         }
1193         else
1194         {
1195                 dts_fail(API_NAME, "failed");
1196         }
1197
1198         app_control_destroy(app_control);
1199 }
1200
1201 static void utc_app_control_set_category_positive(void)
1202 {
1203         const char *API_NAME = __FUNCTION__;
1204         int ret = SERVICE_ERROR_NONE;
1205         const char *input_value = "INPUT_VALUE";
1206
1207         app_control_h app_control;
1208
1209         app_control_create(&app_control);
1210
1211         ret = app_control_set_category(app_control, input_value);
1212
1213         if(ret == SERVICE_ERROR_NONE)
1214         {
1215                 dts_pass(API_NAME, "passed");
1216         }
1217         else
1218         {
1219                 dts_fail(API_NAME, "failed");
1220         }
1221
1222         app_control_destroy(app_control);
1223 }
1224
1225 static void utc_app_control_set_category_negative1(void)
1226 {
1227         const char *API_NAME = __FUNCTION__;
1228         int ret = SERVICE_ERROR_NONE;
1229
1230         ret = app_control_set_category(NULL, NULL);
1231
1232         if(ret != SERVICE_ERROR_NONE)
1233         {
1234                 dts_pass(API_NAME, "passed");
1235         }
1236         else
1237         {
1238                 dts_fail(API_NAME, "failed");
1239         }
1240 }
1241
1242 static void utc_app_control_set_category_negative2(void)
1243 {
1244         const char *API_NAME = __FUNCTION__;
1245         int ret = SERVICE_ERROR_NONE;
1246         const char *input_value = "INPUT_VALUE";
1247
1248         ret = app_control_set_category(NULL, input_value);
1249
1250         if(ret != SERVICE_ERROR_NONE)
1251         {
1252                 dts_pass(API_NAME, "passed");
1253         }
1254         else
1255         {
1256                 dts_fail(API_NAME, "failed");
1257         }
1258 }
1259
1260 static void utc_app_control_get_category_positive(void)
1261 {
1262         const char *API_NAME = __FUNCTION__;
1263         int ret = SERVICE_ERROR_NONE;
1264         const char *input_value = "INPUT_VALUE";
1265         char *output_value;
1266
1267         app_control_h app_control;
1268
1269         app_control_create(&app_control);
1270
1271         app_control_set_category(app_control, input_value);
1272
1273         ret = app_control_get_category(app_control, &output_value);
1274
1275         if(ret == SERVICE_ERROR_NONE)
1276         {
1277                 if(!strcmp(input_value, output_value))
1278                 {
1279                         dts_pass(API_NAME, "passed");
1280                 }
1281                 else
1282                 {
1283                         dts_fail(API_NAME, "failed");
1284                 }
1285         }
1286         else
1287         {
1288                 dts_fail(API_NAME, "failed");
1289         }
1290
1291         app_control_destroy(app_control);
1292 }
1293
1294 static void utc_app_control_get_category_negative1(void)
1295 {
1296         const char *API_NAME = __FUNCTION__;
1297         int ret = SERVICE_ERROR_NONE;
1298         char *output_value;
1299
1300         app_control_h app_control;
1301
1302         app_control_create(&app_control);
1303
1304         ret = app_control_get_category(app_control, &output_value);
1305
1306         if(ret == SERVICE_ERROR_NONE && output_value == NULL)
1307         {
1308                 dts_pass(API_NAME, "passed");
1309         }
1310         else
1311         {
1312                 dts_fail(API_NAME, "failed");
1313         }
1314
1315         app_control_destroy(app_control);
1316 }
1317
1318 static void utc_app_control_get_category_negative2(void)
1319 {
1320         const char *API_NAME = __FUNCTION__;
1321         int ret = SERVICE_ERROR_NONE;
1322         char *output_value;
1323
1324         ret = app_control_get_category(NULL, &output_value);
1325
1326         if(ret != SERVICE_ERROR_NONE)
1327         {
1328                 dts_pass(API_NAME, "passed");
1329         }
1330         else
1331         {
1332                 dts_fail(API_NAME, "failed");
1333         }
1334 }
1335
1336 static void utc_app_control_get_category_negative3(void)
1337 {
1338         const char *API_NAME = __FUNCTION__;
1339         int ret = SERVICE_ERROR_NONE;
1340
1341         app_control_h app_control;
1342
1343         app_control_create(&app_control);
1344
1345         ret = app_control_get_category(app_control, NULL);
1346
1347         if(ret != SERVICE_ERROR_NONE)
1348         {
1349                 dts_pass(API_NAME, "passed");
1350         }
1351         else
1352         {
1353                 dts_fail(API_NAME, "failed");
1354         }
1355
1356         app_control_destroy(app_control);
1357 }
1358
1359 static void utc_app_control_set_window_positive(void)
1360 {
1361         const char *API_NAME = __FUNCTION__;
1362         int ret = SERVICE_ERROR_NONE;
1363         unsigned int wid = 5;
1364         app_control_h app_control;
1365
1366         app_control_create(&app_control);
1367
1368         ret = app_control_set_window(app_control, wid);
1369
1370         if(ret == SERVICE_ERROR_NONE)
1371         {
1372                 dts_pass(API_NAME, "passed");
1373         }
1374         else
1375         {
1376                 dts_fail(API_NAME, "failed");
1377         }
1378
1379         app_control_destroy(app_control);
1380 }
1381
1382 static void utc_app_control_set_window_negative1(void)
1383 {
1384         const char *API_NAME = __FUNCTION__;
1385         int ret = SERVICE_ERROR_NONE;
1386
1387         ret = app_control_set_window(NULL, -1);
1388
1389         if(ret != SERVICE_ERROR_NONE)
1390         {
1391                 dts_pass(API_NAME, "passed");
1392         }
1393         else
1394         {
1395                 dts_fail(API_NAME, "failed");
1396         }
1397 }
1398
1399 static void utc_app_control_set_window_negative2(void)
1400 {
1401         const char *API_NAME = __FUNCTION__;
1402         int ret = SERVICE_ERROR_NONE;
1403         unsigned int wid = 5;
1404
1405         ret = app_control_set_window(NULL, wid);
1406
1407         if(ret != SERVICE_ERROR_NONE)
1408         {
1409                 dts_pass(API_NAME, "passed");
1410         }
1411         else
1412         {
1413                 dts_fail(API_NAME, "failed");
1414         }
1415 }
1416
1417 static void utc_app_control_get_window_positive(void)
1418 {
1419         const char *API_NAME = __FUNCTION__;
1420         int ret = SERVICE_ERROR_NONE;
1421         unsigned int wid = 5;
1422         int output_value = 0;
1423
1424         app_control_h app_control;
1425
1426         app_control_create(&app_control);
1427
1428         app_control_set_window(app_control, wid);
1429
1430         ret = app_control_get_window(app_control, &output_value);
1431
1432         if(ret == SERVICE_ERROR_NONE)
1433         {
1434                 if(wid == output_value)
1435                 {
1436                         dts_pass(API_NAME, "passed");
1437                 }
1438                 else
1439                 {
1440                         dts_fail(API_NAME, "failed");
1441                 }
1442         }
1443         else
1444         {
1445                 dts_fail(API_NAME, "failed");
1446         }
1447
1448         app_control_destroy(app_control);
1449 }
1450
1451 static void utc_app_control_get_window_negative1(void)
1452 {
1453         const char *API_NAME = __FUNCTION__;
1454         int ret = SERVICE_ERROR_NONE;
1455         int output_value = 0;
1456
1457         app_control_h app_control;
1458
1459         app_control_create(&app_control);
1460
1461         ret = app_control_get_window(app_control, &output_value);
1462
1463         if(ret == SERVICE_ERROR_NONE)
1464         {
1465                 dts_pass(API_NAME, "passed");
1466         }
1467         else
1468         {
1469                 dts_fail(API_NAME, "failed");
1470         }
1471 }
1472
1473 static void utc_app_control_get_window_negative2(void)
1474 {
1475         const char *API_NAME = __FUNCTION__;
1476         int ret = SERVICE_ERROR_NONE;
1477         int output_value = 0;
1478
1479         ret = app_control_get_window(NULL, &output_value);
1480
1481         if(ret != SERVICE_ERROR_NONE)
1482         {
1483                 dts_pass(API_NAME, "passed");
1484         }
1485         else
1486         {
1487                 dts_fail(API_NAME, "failed");
1488         }
1489 }
1490
1491 static void utc_app_control_get_window_negative3(void)
1492 {
1493         const char *API_NAME = __FUNCTION__;
1494         int ret = SERVICE_ERROR_NONE;
1495
1496         app_control_h app_control;
1497
1498         app_control_create(&app_control);
1499
1500         ret = app_control_get_window(app_control, NULL);
1501
1502         if(ret != SERVICE_ERROR_NONE)
1503         {
1504                 dts_pass(API_NAME, "passed");
1505         }
1506         else
1507         {
1508                 dts_fail(API_NAME, "failed");
1509         }
1510
1511         app_control_destroy(app_control);
1512 }
1513
1514 static void utc_app_control_add_extra_data_positive(void)
1515 {
1516         const char *API_NAME = __FUNCTION__;
1517         int ret = SERVICE_ERROR_NONE;
1518         char *key = "EXTRA_KEY";
1519         char *value = "EXTRA_VALUE";
1520
1521         app_control_h app_control;
1522
1523         app_control_create(&app_control);
1524
1525         ret = app_control_add_extra_data(app_control, key, value);
1526
1527         if(ret == SERVICE_ERROR_NONE)
1528         {
1529                 dts_pass(API_NAME, "passed");
1530         }
1531         else
1532         {
1533                 dts_fail(API_NAME, "failed");
1534         }
1535
1536         app_control_destroy(app_control);
1537 }
1538
1539 static void utc_app_control_add_extra_data_negative1(void)
1540 {
1541         const char *API_NAME = __FUNCTION__;
1542         int passed = 0;
1543         int ret = SERVICE_ERROR_NONE;
1544         char *key = "EXTRA_KEY";
1545         char *value = "EXTRA_VALUE";
1546
1547         app_control_h app_control;
1548
1549         app_control_create(&app_control);
1550
1551
1552         // key : unll
1553         ret = app_control_add_extra_data(app_control, NULL, value);
1554
1555         if(ret != SERVICE_ERROR_NONE)
1556         {
1557                 passed++;
1558         }
1559
1560         // key : zero-length
1561         ret = app_control_add_extra_data(app_control, "", value);
1562
1563         if(ret != SERVICE_ERROR_NONE)
1564         {
1565                 passed++;
1566         }
1567
1568         // value : null
1569         ret = app_control_add_extra_data(app_control, key, NULL);
1570
1571         if(ret != SERVICE_ERROR_NONE)
1572         {
1573                 passed++;
1574         }
1575
1576         // value : zero-length
1577         ret = app_control_add_extra_data(app_control, key, "");
1578
1579         if(ret != SERVICE_ERROR_NONE)
1580         {
1581                 passed++;
1582         }
1583
1584         if(passed == 4)
1585         {
1586                 dts_pass(API_NAME, "passed");
1587         }
1588         else
1589         {
1590                 dts_fail(API_NAME, "failed");
1591         }
1592
1593         app_control_destroy(app_control);
1594 }
1595
1596 static void utc_app_control_add_extra_data_negative2(void)
1597 {
1598         const char *API_NAME = __FUNCTION__;
1599         int ret = SERVICE_ERROR_NONE;
1600         char *key = "EXTRA_KEY";
1601         char *value = "EXTRA_VALUE";
1602
1603         ret = app_control_add_extra_data(NULL, key, value);
1604
1605         if(ret != SERVICE_ERROR_NONE)
1606         {
1607                 dts_pass(API_NAME, "passed");
1608         }
1609         else
1610         {
1611                 dts_fail(API_NAME, "failed");
1612         }
1613 }
1614
1615 static void utc_app_control_remove_extra_data_positive(void)
1616 {
1617         const char *API_NAME = __FUNCTION__;
1618         int ret = SERVICE_ERROR_NONE;
1619         char *key = "EXTRA_KEY";
1620         char *value = "EXTRA_VALUE";
1621
1622         app_control_h app_control;
1623
1624         app_control_create(&app_control);
1625
1626         app_control_add_extra_data(app_control, key, value);
1627
1628         ret = app_control_remove_extra_data(app_control, key);
1629
1630         if(ret == SERVICE_ERROR_NONE)
1631         {
1632                 dts_pass(API_NAME, "passed");
1633         }
1634         else
1635         {
1636                 dts_fail(API_NAME, "failed");
1637         }
1638
1639         app_control_destroy(app_control);
1640 }
1641
1642 static void utc_app_control_remove_extra_data_negative1(void)
1643 {
1644         const char *API_NAME = __FUNCTION__;
1645         int ret = SERVICE_ERROR_NONE;
1646         char *key = "EXTRA_KEY";
1647
1648         app_control_h app_control;
1649
1650         app_control_create(&app_control);
1651
1652         ret = app_control_remove_extra_data(app_control, key);
1653
1654         if(ret != SERVICE_ERROR_NONE)
1655         {
1656                 dts_pass(API_NAME, "passed");
1657         }
1658         else
1659         {
1660                 dts_fail(API_NAME, "failed");
1661         }
1662
1663         app_control_destroy(app_control);
1664 }
1665
1666 static void utc_app_control_remove_extra_data_negative2(void)
1667 {
1668         const char *API_NAME = __FUNCTION__;
1669         int ret = SERVICE_ERROR_NONE;
1670         char *key = "EXTRA_KEY";
1671
1672         ret = app_control_remove_extra_data(NULL, key);
1673
1674         if(ret != SERVICE_ERROR_NONE)
1675         {
1676                 dts_pass(API_NAME, "passed");
1677         }
1678         else
1679         {
1680                 dts_fail(API_NAME, "failed");
1681         }
1682 }
1683
1684 static void utc_app_control_remove_extra_data_negative3(void)
1685 {
1686         const char *API_NAME = __FUNCTION__;
1687         int ret = SERVICE_ERROR_NONE;
1688
1689         app_control_h app_control;
1690
1691         app_control_create(&app_control);
1692
1693         ret = app_control_remove_extra_data(app_control, NULL);
1694
1695         if(ret != SERVICE_ERROR_NONE)
1696         {
1697                 dts_pass(API_NAME, "passed");
1698         }
1699         else
1700         {
1701                 dts_fail(API_NAME, "failed");
1702         }
1703
1704         app_control_destroy(app_control);
1705 }
1706
1707 static void utc_app_control_get_extra_data_positive(void)
1708 {
1709         const char *API_NAME = __FUNCTION__;
1710         int ret = SERVICE_ERROR_NONE;
1711         char *key = "EXTRA_KEY";
1712         char *value = "EXTRA_VALUE";
1713         char *ret_value;
1714
1715         app_control_h app_control;
1716
1717         app_control_create(&app_control);
1718
1719         app_control_add_extra_data(app_control, key, value);
1720
1721         ret = app_control_get_extra_data(app_control, key, &ret_value);
1722
1723         if(ret == SERVICE_ERROR_NONE && !strcmp(ret_value, value))
1724         {
1725                 dts_pass(API_NAME, "passed");
1726         }
1727         else
1728         {
1729                 dts_fail(API_NAME, "failed");
1730         }
1731
1732         app_control_destroy(app_control);
1733 }
1734
1735 static void utc_app_control_get_extra_data_negative1(void)
1736 {
1737         const char *API_NAME = __FUNCTION__;
1738         int ret = SERVICE_ERROR_NONE;
1739         char *key = "EXTRA_KEY";
1740         char *ret_value;
1741
1742         app_control_h app_control;
1743
1744         app_control_create(&app_control);
1745
1746         ret = app_control_get_extra_data(app_control, key, &ret_value);
1747
1748         if(ret != SERVICE_ERROR_NONE)
1749         {
1750                 dts_pass(API_NAME, "passed");
1751         }
1752         else
1753         {
1754                 dts_fail(API_NAME, "failed");
1755         }
1756
1757         app_control_destroy(app_control);
1758 }
1759
1760 static void utc_app_control_get_extra_data_negative2(void)
1761 {
1762         const char *API_NAME = __FUNCTION__;
1763         int ret = SERVICE_ERROR_NONE;
1764         char *key = "EXTRA_KEY";
1765         char *ret_value;
1766
1767         ret = app_control_get_extra_data(NULL, key, &ret_value);
1768
1769         if(ret != SERVICE_ERROR_NONE)
1770         {
1771                 dts_pass(API_NAME, "passed");
1772         }
1773         else
1774         {
1775                 dts_fail(API_NAME, "failed");
1776         }
1777
1778 }
1779
1780 static void utc_app_control_get_extra_data_negative3(void)
1781 {
1782         const char *API_NAME = __FUNCTION__;
1783         int ret = SERVICE_ERROR_NONE;
1784
1785         char *ret_value;
1786
1787         app_control_h app_control;
1788
1789         app_control_create(&app_control);
1790
1791         ret = app_control_get_extra_data(app_control, NULL, &ret_value);
1792
1793         if(ret != SERVICE_ERROR_NONE)
1794         {
1795                 dts_pass(API_NAME, "passed");
1796         }
1797         else
1798         {
1799                 dts_fail(API_NAME, "failed");
1800         }
1801
1802         app_control_destroy(app_control);
1803 }
1804
1805 static void utc_app_control_get_extra_data_negative4(void)
1806 {
1807         const char *API_NAME = __FUNCTION__;
1808         int ret = SERVICE_ERROR_NONE;
1809         char *key = "EXTRA_KEY";
1810
1811         app_control_h app_control;
1812
1813         app_control_create(&app_control);
1814
1815         ret = app_control_get_extra_data(app_control, key, NULL);
1816
1817         if(ret != SERVICE_ERROR_NONE)
1818         {
1819                 dts_pass(API_NAME, "passed");
1820         }
1821         else
1822         {
1823                 dts_fail(API_NAME, "failed");
1824         }
1825
1826         app_control_destroy(app_control);
1827 }
1828
1829 #define NUM_EXTRA_DATA 32
1830
1831 bool app_control_extra_data(app_control_h app_control, const char *key, void *user_data)
1832 {
1833         bool *passed = (bool*)user_data;
1834         char *value;
1835
1836         app_control_get_extra_data(app_control, key, &value);
1837
1838         if (!strcmp(key, value))
1839         {
1840                 int index = atoi(key);
1841                 passed[index] = true;
1842         }
1843
1844         return true;
1845 }
1846
1847 static void utc_app_control_foreach_extra_data_positive(void)
1848 {
1849         const char *API_NAME = __FUNCTION__;
1850         int ret = SERVICE_ERROR_NONE;
1851         int i;
1852         bool passed[NUM_EXTRA_DATA] = {0, };
1853         int num_passed = 0;
1854         char buf[32] = {0, };
1855
1856         app_control_h app_control;
1857
1858         app_control_create(&app_control);
1859
1860         for (i=0; i<NUM_EXTRA_DATA; i++)
1861         {
1862                 snprintf(buf, sizeof(buf), "%d", i);
1863                 app_control_add_extra_data(app_control, buf, buf);
1864         }
1865
1866         ret = app_control_foreach_extra_data(app_control, app_control_extra_data, &passed);
1867
1868         for (i=0; i<NUM_EXTRA_DATA; i++)
1869         {
1870                 if (passed[i] == true)
1871                 {
1872                         num_passed++;
1873                 }
1874         }
1875
1876         if(ret == SERVICE_ERROR_NONE && num_passed == NUM_EXTRA_DATA)
1877         {
1878                 dts_pass(API_NAME, "passed");
1879         }
1880         else
1881         {
1882                 dts_fail(API_NAME, "failed");
1883         }
1884
1885         app_control_destroy(app_control);
1886 }
1887
1888 static void utc_app_control_foreach_extra_data_negative1(void)
1889 {
1890         const char *API_NAME = __FUNCTION__;
1891         int ret = SERVICE_ERROR_NONE;
1892
1893         app_control_h app_control;
1894
1895         app_control_create(&app_control);
1896
1897         ret = app_control_foreach_extra_data(app_control, NULL, NULL);
1898
1899         if(ret != SERVICE_ERROR_NONE)
1900         {
1901                 dts_pass(API_NAME, "passed");
1902         }
1903         else
1904         {
1905                 dts_fail(API_NAME, "failed");
1906         }
1907
1908         app_control_destroy(app_control);
1909 }
1910
1911 static void utc_app_control_foreach_extra_data_negative2(void)
1912 {
1913         const char *API_NAME = __FUNCTION__;
1914         int ret = SERVICE_ERROR_NONE;
1915
1916         ret = app_control_foreach_extra_data(NULL, app_control_extra_data, NULL);
1917
1918         if(ret != SERVICE_ERROR_NONE)
1919         {
1920                 dts_pass(API_NAME, "passed");
1921         }
1922         else
1923         {
1924                 dts_fail(API_NAME, "failed");
1925         }
1926 }
1927
1928 static void utc_app_control_clone_positive(void)
1929 {
1930         const char *API_NAME = __FUNCTION__;
1931         int ret = SERVICE_ERROR_NONE;
1932
1933         char *operation = "OPERATION_VALUE";
1934         char *operation_clone;
1935
1936         char *uri = "URI_VALUE";
1937         char *uri_clone;
1938
1939         char *mime = "MIME_VALUE";
1940         char *mime_clone;
1941
1942         char *package = "PACKAGE_VALUE";
1943         char *package_clone;
1944
1945         char *extra_key = "EXTRA_KEY";
1946
1947         char *extra_value = "EXTRA_VALUE";
1948         char *extra_value_clone;
1949
1950         app_control_h app_control;
1951         app_control_h app_control_cloned;
1952
1953         app_control_create(&app_control);
1954         app_control_set_operation(app_control, operation);
1955         app_control_set_uri(app_control, uri);
1956         app_control_set_mime(app_control, mime);
1957         app_control_set_package(app_control, package);
1958         app_control_add_extra_data(app_control, extra_key, extra_value);
1959
1960         ret = app_control_clone(&app_control_cloned, app_control);
1961
1962         app_control_get_operation(app_control_cloned, &operation_clone);
1963         app_control_get_uri(app_control_cloned, &uri_clone);
1964         app_control_get_mime(app_control_cloned, &mime_clone);
1965         app_control_get_package(app_control_cloned, &package_clone);
1966         app_control_get_extra_data(app_control_cloned, extra_key, &extra_value_clone);
1967
1968
1969         if(ret == SERVICE_ERROR_NONE
1970                 && !strcmp(operation, operation_clone)
1971                 && !strcmp(uri, uri_clone)
1972                 && !strcmp(mime, mime_clone)
1973                 && !strcmp(package, package_clone)
1974                 && !strcmp(extra_value, extra_value_clone))
1975         {
1976                 dts_pass(API_NAME, "passed");
1977         }
1978         else
1979         {
1980                 dts_fail(API_NAME, "failed");
1981         }
1982
1983         app_control_destroy(app_control);
1984         app_control_destroy(app_control_cloned);
1985 }
1986
1987 static void utc_app_control_clone_negative1(void)
1988 {
1989         const char *API_NAME = __FUNCTION__;
1990         int ret = SERVICE_ERROR_NONE;
1991
1992         app_control_h app_control_cloned;
1993
1994         ret = app_control_clone(&app_control_cloned, NULL);
1995
1996         if(ret != SERVICE_ERROR_NONE)
1997         {
1998                 dts_pass(API_NAME, "passed");
1999         }
2000         else
2001         {
2002                 dts_fail(API_NAME, "failed");
2003         }
2004 }
2005
2006 static void utc_app_control_clone_negative2(void)
2007 {
2008         const char *API_NAME = __FUNCTION__;
2009         int ret = SERVICE_ERROR_NONE;
2010
2011         app_control_h app_control;
2012
2013         app_control_create(&app_control);
2014
2015         ret = app_control_clone(NULL, app_control);
2016
2017         if(ret != SERVICE_ERROR_NONE)
2018         {
2019                 dts_pass(API_NAME, "passed");
2020         }
2021         else
2022         {
2023                 dts_fail(API_NAME, "failed");
2024         }
2025 }
2026
2027
2028 void dts_app_control_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
2029 {
2030
2031 }
2032
2033 static void utc_app_control_send_launch_request_positive1(void)
2034 {
2035         const char *API_NAME = __FUNCTION__;
2036         int ret = SERVICE_ERROR_NONE;
2037
2038         app_control_h app_control;
2039
2040         app_control_create(&app_control);
2041
2042         app_control_set_operation(app_control, SERVICE_OPERATION_DEFAULT);
2043
2044         app_control_set_package(app_control, "org.tizen.calculator");
2045
2046         // explicit launch without reply callback
2047         ret = app_control_send_launch_request(app_control, NULL, NULL);
2048
2049         if(ret == SERVICE_ERROR_NONE)
2050         {
2051                 dts_pass(API_NAME, "passed");
2052         }
2053         else
2054         {
2055                 dts_fail(API_NAME, "failed");
2056         }
2057
2058         app_control_destroy(app_control);
2059
2060 }
2061
2062 static void utc_app_control_send_launch_request_positive2(void)
2063 {
2064         const char *API_NAME = __FUNCTION__;
2065         int ret = SERVICE_ERROR_NONE;
2066
2067         app_control_h app_control;
2068
2069         app_control_create(&app_control);
2070
2071         app_control_set_operation(app_control, SERVICE_OPERATION_DEFAULT);
2072
2073         app_control_set_package(app_control, "org.tizen.calculator");
2074
2075         // explicit launch with reply callback
2076         ret = app_control_send_launch_request(app_control, dts_app_control_reply_cb, NULL);
2077
2078         if(ret == SERVICE_ERROR_NONE)
2079         {
2080                 dts_pass(API_NAME, "passed");
2081         }
2082         else
2083         {
2084                 dts_fail(API_NAME, "failed");
2085         }
2086
2087         app_control_destroy(app_control);
2088 }
2089
2090 static void utc_app_control_send_launch_request_positive3(void)
2091 {
2092         const char *API_NAME = __FUNCTION__;
2093         int ret = SERVICE_ERROR_NONE;
2094
2095         app_control_h app_control;
2096
2097         app_control_create(&app_control);
2098
2099         app_control_set_operation(app_control, SERVICE_OPERATION_VIEW);
2100
2101         app_control_set_mime(app_control, "type/custom");
2102
2103         ret = app_control_send_launch_request(app_control, dts_app_control_reply_cb, NULL);
2104
2105         if(ret == SERVICE_ERROR_APP_NOT_FOUND)
2106         {
2107                 dts_pass(API_NAME, "passed");
2108         }
2109         else
2110         {
2111                 dts_fail(API_NAME, "failed");
2112         }
2113
2114         app_control_destroy(app_control);
2115 }
2116
2117 static void utc_app_control_send_launch_request_negative1(void)
2118 {
2119         const char *API_NAME = __FUNCTION__;
2120         int ret = SERVICE_ERROR_NONE;
2121
2122         ret = app_control_send_launch_request(NULL, NULL, NULL);
2123
2124         if(ret != SERVICE_ERROR_NONE)
2125         {
2126                 dts_pass(API_NAME, "passed");
2127         }
2128         else
2129         {
2130                 dts_fail(API_NAME, "failed");
2131         }
2132 }
2133
2134 static void utc_app_control_send_launch_request_negative2(void)
2135 {
2136         const char *API_NAME = __FUNCTION__;
2137         int ret = SERVICE_ERROR_NONE;
2138
2139         app_control_h app_control;
2140
2141         app_control_create(&app_control);
2142
2143         app_control_set_operation(app_control, SERVICE_OPERATION_DEFAULT);
2144
2145         ret = app_control_send_launch_request(app_control, NULL, NULL);
2146
2147         if(ret == SERVICE_ERROR_APP_NOT_FOUND)
2148         {
2149                 dts_pass(API_NAME, "passed");
2150         }
2151         else
2152         {
2153                 dts_fail(API_NAME, "failed");
2154         }
2155
2156         app_control_destroy(app_control);
2157 }
2158
2159 static void utc_app_control_reply_to_launch_request_negative1(void)
2160 {
2161         const char *API_NAME = __FUNCTION__;
2162         int ret = SERVICE_ERROR_NONE;
2163
2164         app_control_h request;
2165
2166         app_control_create(&request);
2167
2168         ret = app_control_reply_to_launch_request(NULL, request, SERVICE_RESULT_CANCELED);
2169
2170         if(ret != SERVICE_ERROR_NONE)
2171         {
2172                 dts_pass(API_NAME, "passed");
2173         }
2174         else
2175         {
2176                 dts_fail(API_NAME, "failed");
2177         }
2178 }
2179
2180 static void utc_app_control_reply_to_launch_request_negative2(void)
2181 {
2182         const char *API_NAME = __FUNCTION__;
2183         int ret = SERVICE_ERROR_NONE;
2184
2185         app_control_h app_control;
2186
2187         app_control_create(&app_control);
2188
2189         ret = app_control_reply_to_launch_request(app_control, NULL, SERVICE_RESULT_CANCELED);
2190
2191         if(ret != SERVICE_ERROR_NONE)
2192         {
2193                 dts_pass(API_NAME, "passed");
2194         }
2195         else
2196         {
2197                 dts_fail(API_NAME, "failed");
2198         }
2199
2200         app_control_destroy(app_control);
2201 }
2202
2203 bool dts_app_control_app_matched_cb(app_control_h app_control, const char *package, void *user_data)
2204 {
2205         return true;
2206 }
2207
2208 static void utc_app_control_foreach_app_matched_positive(void)
2209 {
2210         const char *API_NAME = __FUNCTION__;
2211         int ret = SERVICE_ERROR_NONE;
2212
2213         app_control_h app_control;
2214
2215         app_control_create(&app_control);
2216
2217         app_control_set_operation(app_control, SERVICE_OPERATION_VIEW);
2218
2219         ret = app_control_foreach_app_matched(app_control, dts_app_control_app_matched_cb, NULL);
2220
2221         if(ret == SERVICE_ERROR_NONE)
2222         {
2223                 dts_pass(API_NAME, "passed");
2224         }
2225         else
2226         {
2227                 dts_fail(API_NAME, "failed");
2228         }
2229
2230         app_control_destroy(app_control);
2231 }
2232
2233 static void utc_app_control_foreach_app_matched_negative1(void)
2234 {
2235         const char *API_NAME = __FUNCTION__;
2236         int ret = SERVICE_ERROR_NONE;
2237
2238         ret = app_control_foreach_app_matched(NULL, dts_app_control_app_matched_cb, NULL);
2239
2240         if(ret != SERVICE_ERROR_NONE)
2241         {
2242                 dts_pass(API_NAME, "passed");
2243         }
2244         else
2245         {
2246                 dts_fail(API_NAME, "failed");
2247         }
2248 }
2249
2250 static void utc_app_control_foreach_app_matched_negative2(void)
2251 {
2252         const char *API_NAME = __FUNCTION__;
2253         int ret = SERVICE_ERROR_NONE;
2254
2255         app_control_h app_control;
2256
2257         app_control_create(&app_control);
2258
2259         ret = app_control_foreach_app_matched(app_control, NULL, NULL);
2260
2261         if(ret != SERVICE_ERROR_NONE)
2262         {
2263                 dts_pass(API_NAME, "passed");
2264         }
2265         else
2266         {
2267                 dts_fail(API_NAME, "failed");
2268         }
2269
2270         app_control_destroy(app_control);
2271 }
2272
2273 static void utc_app_control_add_extra_data_array_positive(void)
2274 {
2275         const char *API_NAME = __FUNCTION__;
2276         int ret = SERVICE_ERROR_NONE;
2277
2278         const char *array_key = "array_key";
2279         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2280         int array_length = 4;
2281
2282         app_control_h app_control;
2283
2284         app_control_create(&app_control);
2285
2286         ret = app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2287
2288         if(ret == SERVICE_ERROR_NONE)
2289         {
2290                 dts_pass(API_NAME, "passed");
2291         }
2292         else
2293         {
2294                 dts_fail(API_NAME, "failed");
2295         }
2296
2297         app_control_destroy(app_control);
2298 }
2299
2300 static void utc_app_control_add_extra_data_array_negative1(void)
2301 {
2302         const char *API_NAME = __FUNCTION__;
2303         int ret = SERVICE_ERROR_NONE;
2304
2305         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2306
2307         app_control_h app_control;
2308
2309         app_control_create(&app_control);
2310
2311         ret = app_control_add_extra_data_array(app_control, NULL, array_value, 4);
2312
2313         if(ret != SERVICE_ERROR_NONE)
2314         {
2315                 dts_pass(API_NAME, "passed");
2316         }
2317         else
2318         {
2319                 dts_fail(API_NAME, "failed");
2320         }
2321
2322         app_control_destroy(app_control);
2323 }
2324
2325
2326 static void utc_app_control_add_extra_data_array_negative2(void)
2327 {
2328         const char *API_NAME = __FUNCTION__;
2329         int ret = SERVICE_ERROR_NONE;
2330
2331         const char *array_key = "array_key";
2332
2333         app_control_h app_control;
2334
2335         app_control_create(&app_control);
2336
2337         ret = app_control_add_extra_data_array(app_control, array_key, NULL, 4);
2338
2339         if(ret != SERVICE_ERROR_NONE)
2340         {
2341                 dts_pass(API_NAME, "passed");
2342         }
2343         else
2344         {
2345                 dts_fail(API_NAME, "failed");
2346         }
2347
2348         app_control_destroy(app_control);
2349 }
2350
2351 static void utc_app_control_add_extra_data_array_negative3(void)
2352 {
2353         const char *API_NAME = __FUNCTION__;
2354         int ret = SERVICE_ERROR_NONE;
2355
2356         const char *array_key = "array_key";
2357         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2358
2359         app_control_h app_control;
2360
2361         app_control_create(&app_control);
2362
2363         ret = app_control_add_extra_data_array(app_control, array_key, array_value, -1);
2364
2365         if(ret != SERVICE_ERROR_NONE)
2366         {
2367                 dts_pass(API_NAME, "passed");
2368         }
2369         else
2370         {
2371                 dts_fail(API_NAME, "failed");
2372         }
2373
2374         app_control_destroy(app_control);
2375 }
2376
2377 static void utc_app_control_get_extra_data_array_positive(void)
2378 {
2379         const char *API_NAME = __FUNCTION__;
2380         int ret = SERVICE_ERROR_NONE;
2381
2382         const char *array_key = "array_key";
2383         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2384         int array_length = 4;
2385
2386         char** array_value_out;
2387         int array_length_out;
2388
2389         app_control_h app_control;
2390
2391         app_control_create(&app_control);
2392
2393         app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2394
2395         ret = app_control_get_extra_data_array(app_control, array_key, &array_value_out, &array_length_out);
2396
2397         if(ret == SERVICE_ERROR_NONE && array_length_out == array_length)
2398         {
2399                 dts_pass(API_NAME, "passed");
2400         }
2401         else
2402         {
2403                 dts_fail(API_NAME, "failed");
2404         }
2405
2406         app_control_destroy(app_control);
2407 }
2408
2409 static void utc_app_control_get_extra_data_array_negative1(void)
2410 {
2411         const char *API_NAME = __FUNCTION__;
2412         int ret = SERVICE_ERROR_NONE;
2413
2414         const char *array_key = "array_key";
2415         char** array_value_out;
2416         int array_length_out;
2417
2418         app_control_h app_control;
2419
2420         app_control_create(&app_control);
2421
2422         ret = app_control_get_extra_data_array(app_control, array_key, &array_value_out, &array_length_out);
2423
2424         if(ret != SERVICE_ERROR_NONE)
2425         {
2426                 dts_pass(API_NAME, "passed");
2427         }
2428         else
2429         {
2430                 dts_fail(API_NAME, "failed");
2431         }
2432
2433         app_control_destroy(app_control);
2434 }
2435
2436 static void utc_app_control_get_extra_data_array_negative2(void)
2437 {
2438         const char *API_NAME = __FUNCTION__;
2439         int ret = SERVICE_ERROR_NONE;
2440
2441         const char *array_key = "array_key";
2442         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2443         int array_length = 4;
2444         char** array_value_out;
2445         int array_length_out;
2446
2447         app_control_h app_control;
2448
2449         app_control_create(&app_control);
2450
2451         app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2452
2453         ret = app_control_get_extra_data_array(NULL, array_key, &array_value_out, &array_length_out);
2454
2455         if(ret != SERVICE_ERROR_NONE)
2456         {
2457                 dts_pass(API_NAME, "passed");
2458         }
2459         else
2460         {
2461                 dts_fail(API_NAME, "failed");
2462         }
2463
2464         app_control_destroy(app_control);
2465 }
2466
2467 static void utc_app_control_get_extra_data_array_negative3(void)
2468 {
2469         const char *API_NAME = __FUNCTION__;
2470         int ret = SERVICE_ERROR_NONE;
2471
2472         const char *array_key = "array_key";
2473         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2474         int array_length = 4;
2475         char** array_value_out;
2476         int array_length_out;
2477
2478         app_control_h app_control;
2479
2480         app_control_create(&app_control);
2481
2482         app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2483
2484         ret = app_control_get_extra_data_array(app_control, NULL, &array_value_out, &array_length_out);
2485
2486         if(ret != SERVICE_ERROR_NONE)
2487         {
2488                 dts_pass(API_NAME, "passed");
2489         }
2490         else
2491         {
2492                 dts_fail(API_NAME, "failed");
2493         }
2494
2495         app_control_destroy(app_control);
2496 }
2497
2498 static void utc_app_control_get_extra_data_array_negative4(void)
2499 {
2500         const char *API_NAME = __FUNCTION__;
2501         int ret = SERVICE_ERROR_NONE;
2502
2503         const char *array_key = "array_key";
2504         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2505         int array_length = 4;
2506         int array_length_out;
2507
2508         app_control_h app_control;
2509
2510         app_control_create(&app_control);
2511
2512         app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2513
2514         ret = app_control_get_extra_data_array(app_control, array_key, NULL, &array_length_out);
2515
2516         if(ret != SERVICE_ERROR_NONE)
2517         {
2518                 dts_pass(API_NAME, "passed");
2519         }
2520         else
2521         {
2522                 dts_fail(API_NAME, "failed");
2523         }
2524
2525         app_control_destroy(app_control);
2526 }
2527
2528 static void utc_app_control_get_extra_data_array_negative5(void)
2529 {
2530         const char *API_NAME = __FUNCTION__;
2531         int ret = SERVICE_ERROR_NONE;
2532
2533         const char *array_key = "array_key";
2534         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2535         int array_length = 4;
2536         char** array_value_out;
2537
2538         app_control_h app_control;
2539
2540         app_control_create(&app_control);
2541
2542         app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2543
2544         ret = app_control_get_extra_data_array(app_control, array_key, &array_value_out, NULL);
2545
2546         if(ret != SERVICE_ERROR_NONE)
2547         {
2548                 dts_pass(API_NAME, "passed");
2549         }
2550         else
2551         {
2552                 dts_fail(API_NAME, "failed");
2553         }
2554
2555 }
2556
2557 static void utc_app_control_is_extra_data_array_positive(void)
2558 {
2559         const char *API_NAME = __FUNCTION__;
2560         int ret = SERVICE_ERROR_NONE;
2561
2562         const char *array_key = "array_key";
2563         const char* array_value[] = {"array_value1", "array_value2", "array_value3", "array_value4"};
2564         int array_length = 4;
2565         bool is_array;
2566
2567         app_control_h app_control;
2568
2569         app_control_create(&app_control);
2570
2571         app_control_add_extra_data_array(app_control, array_key, array_value, array_length);
2572
2573         ret = app_control_is_extra_data_array(app_control, array_key, &is_array);
2574
2575         if(ret == SERVICE_ERROR_NONE && is_array == true)
2576         {
2577                 dts_pass(API_NAME, "passed");
2578         }
2579         else
2580         {
2581                 dts_fail(API_NAME, "failed");
2582         }
2583
2584         app_control_destroy(app_control);
2585 }
2586
2587 static void utc_app_control_is_extra_data_array_negative1(void)
2588 {
2589         const char *API_NAME = __FUNCTION__;
2590         int ret = SERVICE_ERROR_NONE;
2591
2592         const char *key = "key";
2593
2594         bool is_array;
2595
2596         app_control_h app_control;
2597
2598         app_control_create(&app_control);
2599
2600         ret = app_control_is_extra_data_array(app_control, key, &is_array);
2601
2602         if(ret == SERVICE_ERROR_NONE && is_array == false)
2603         {
2604                 dts_pass(API_NAME, "passed");
2605         }
2606         else
2607         {
2608                 dts_fail(API_NAME, "failed");
2609         }
2610
2611         app_control_destroy(app_control);
2612 }
2613
2614 static void utc_app_control_is_extra_data_array_negative2(void)
2615 {
2616         const char *API_NAME = __FUNCTION__;
2617         int ret = SERVICE_ERROR_NONE;
2618
2619         const char *key = "key";
2620
2621         bool is_array;
2622
2623         app_control_h app_control;
2624
2625         app_control_create(&app_control);
2626
2627         ret = app_control_is_extra_data_array(NULL, key, &is_array);
2628
2629         if(ret != SERVICE_ERROR_NONE)
2630         {
2631                 dts_pass(API_NAME, "passed");
2632         }
2633         else
2634         {
2635                 dts_fail(API_NAME, "failed");
2636         }
2637
2638         app_control_destroy(app_control);
2639 }
2640
2641 static void utc_app_control_is_extra_data_array_negative3(void)
2642 {
2643         const char *API_NAME = __FUNCTION__;
2644         int ret = SERVICE_ERROR_NONE;
2645
2646         bool is_array;
2647
2648         app_control_h app_control;
2649
2650         app_control_create(&app_control);
2651
2652         ret = app_control_is_extra_data_array(app_control, NULL, &is_array);
2653
2654         if(ret != SERVICE_ERROR_NONE)
2655         {
2656                 dts_pass(API_NAME, "passed");
2657         }
2658         else
2659         {
2660                 dts_fail(API_NAME, "failed");
2661         }
2662
2663         app_control_destroy(app_control);
2664 }
2665
2666 static void utc_app_control_is_extra_data_array_negative4(void)
2667 {
2668         const char *API_NAME = __FUNCTION__;
2669         int ret = SERVICE_ERROR_NONE;
2670
2671         const char *key = "key";
2672
2673         app_control_h app_control;
2674
2675         app_control_create(&app_control);
2676
2677         ret = app_control_is_extra_data_array(app_control, key, NULL);
2678
2679         if(ret != SERVICE_ERROR_NONE)
2680         {
2681                 dts_pass(API_NAME, "passed");
2682         }
2683         else
2684         {
2685                 dts_fail(API_NAME, "failed");
2686         }
2687
2688         app_control_destroy(app_control);
2689 }
2690
2691
2692 static void utc_app_control_is_reply_requested_positive1(void)
2693 {
2694         const char *API_NAME = __FUNCTION__;
2695         int ret = SERVICE_ERROR_NONE;
2696
2697         app_control_h app_control;
2698         bool requested;
2699
2700         app_control_create(&app_control);
2701
2702         ret = app_control_is_reply_requested(app_control, &requested);
2703
2704         if(ret != SERVICE_ERROR_NONE)
2705         {
2706                 dts_pass(API_NAME, "passed");
2707         }
2708         else
2709         {
2710                 dts_fail(API_NAME, "failed");
2711         }
2712
2713         app_control_destroy(app_control);
2714 }
2715
2716
2717 static void utc_app_control_is_reply_requested_negative1(void)
2718 {
2719         const char *API_NAME = __FUNCTION__;
2720         int ret = SERVICE_ERROR_NONE;
2721
2722         app_control_h app_control;
2723
2724         app_control_create(&app_control);
2725
2726         ret = app_control_is_reply_requested(app_control, NULL);
2727
2728         if(ret != SERVICE_ERROR_NONE)
2729         {
2730                 dts_pass(API_NAME, "passed");
2731         }
2732         else
2733         {
2734                 dts_fail(API_NAME, "failed");
2735         }
2736
2737         app_control_destroy(app_control);
2738 }
2739
2740
2741 static void utc_app_control_is_reply_requested_negative2(void)
2742 {
2743         const char *API_NAME = __FUNCTION__;
2744         int ret = SERVICE_ERROR_NONE;
2745
2746         bool requsted = false;
2747
2748         ret = app_control_is_reply_requested(NULL, &requsted);
2749
2750         if(ret != SERVICE_ERROR_NONE)
2751         {
2752                 dts_pass(API_NAME, "passed");
2753         }
2754         else
2755         {
2756                 dts_fail(API_NAME, "failed");
2757         }
2758 }
2759
2760 static void utc_app_control_is_reply_requested_negative3(void)
2761 {
2762         const char *API_NAME = __FUNCTION__;
2763         int ret = SERVICE_ERROR_NONE;
2764
2765         ret = app_control_is_reply_requested(NULL, NULL);
2766
2767         if(ret != SERVICE_ERROR_NONE)
2768         {
2769                 dts_pass(API_NAME, "passed");
2770         }
2771         else
2772         {
2773                 dts_fail(API_NAME, "failed");
2774         }
2775 }
2776
2777
2778 static void utc_app_control_get_caller_positive1(void)
2779 {
2780         const char *API_NAME = __FUNCTION__;
2781         int ret = SERVICE_ERROR_NONE;
2782
2783         app_control_h app_control;
2784         char *caller;
2785
2786         app_control_create(&app_control);
2787
2788         ret = app_control_get_caller(app_control, &caller);
2789
2790         if(ret != SERVICE_ERROR_NONE)
2791         {
2792                 dts_pass(API_NAME, "passed");
2793         }
2794         else
2795         {
2796                 dts_fail(API_NAME, "failed");
2797         }
2798
2799         app_control_destroy(app_control);
2800 }
2801
2802
2803 static void utc_app_control_get_caller_negative1(void)
2804 {
2805         const char *API_NAME = __FUNCTION__;
2806         int ret = SERVICE_ERROR_NONE;
2807
2808         app_control_h app_control;
2809
2810         app_control_create(&app_control);
2811
2812         ret = app_control_get_caller(app_control, NULL);
2813
2814         if(ret != SERVICE_ERROR_NONE)
2815         {
2816                 dts_pass(API_NAME, "passed");
2817         }
2818         else
2819         {
2820                 dts_fail(API_NAME, "failed");
2821         }
2822
2823         app_control_destroy(app_control);
2824 }
2825
2826
2827 static void utc_app_control_get_caller_negative2(void)
2828 {
2829         const char *API_NAME = __FUNCTION__;
2830         int ret = SERVICE_ERROR_NONE;
2831
2832         char *caller = NULL;
2833
2834         ret = app_control_get_caller(NULL, &caller);
2835
2836         if(ret != SERVICE_ERROR_NONE)
2837         {
2838                 dts_pass(API_NAME, "passed");
2839         }
2840         else
2841         {
2842                 dts_fail(API_NAME, "failed");
2843         }
2844 }
2845
2846 static void utc_app_control_get_caller_negative3(void)
2847 {
2848         const char *API_NAME = __FUNCTION__;
2849         int ret = SERVICE_ERROR_NONE;
2850
2851         ret = app_control_get_caller(NULL, NULL);
2852
2853         if(ret != SERVICE_ERROR_NONE)
2854         {
2855                 dts_pass(API_NAME, "passed");
2856         }
2857         else
2858         {
2859                 dts_fail(API_NAME, "failed");
2860         }
2861 }
2862
2863 static void utc_app_control_to_bundle_positive1(void)
2864 {
2865         const char *API_NAME = __FUNCTION__;
2866         int ret = SERVICE_ERROR_NONE;
2867         app_control_h app_control;
2868         bundle *data;
2869         const char *input_value = "INPUT_VALUE";
2870
2871         app_control_create(&app_control);
2872
2873         ret = app_control_set_package(app_control, input_value);
2874
2875         ret = app_control_to_bundle(app_control, &data);
2876
2877         if(ret == SERVICE_ERROR_NONE)
2878         {
2879                 dts_pass(API_NAME, "passed");
2880         }
2881         else
2882         {
2883                 dts_fail(API_NAME, "failed");
2884         }
2885
2886         app_control_destroy(app_control);
2887 }
2888
2889
2890 static void utc_app_control_to_bundle_negative1(void)
2891 {
2892         const char *API_NAME = __FUNCTION__;
2893         int ret = SERVICE_ERROR_NONE;
2894
2895         app_control_h app_control;
2896
2897         app_control_create(&app_control);
2898
2899         ret = app_control_to_bundle(app_control, NULL);
2900
2901         if(ret != SERVICE_ERROR_NONE)
2902         {
2903                 dts_pass(API_NAME, "passed");
2904         }
2905         else
2906         {
2907                 dts_fail(API_NAME, "failed");
2908         }
2909
2910         app_control_destroy(app_control);
2911 }
2912
2913
2914 static void utc_app_control_to_bundle_negative2(void)
2915 {
2916         const char *API_NAME = __FUNCTION__;
2917         int ret = SERVICE_ERROR_NONE;
2918
2919         bundle *data = NULL;
2920
2921         ret = app_control_to_bundle(NULL, &data);
2922
2923         if(ret != SERVICE_ERROR_NONE)
2924         {
2925                 dts_pass(API_NAME, "passed");
2926         }
2927         else
2928         {
2929                 dts_fail(API_NAME, "failed");
2930         }
2931 }
2932
2933 static void utc_app_control_to_bundle_negative3(void)
2934 {
2935         const char *API_NAME = __FUNCTION__;
2936         int ret = SERVICE_ERROR_NONE;
2937
2938         ret = app_control_to_bundle(NULL, NULL);
2939
2940         if(ret != SERVICE_ERROR_NONE)
2941         {
2942                 dts_pass(API_NAME, "passed");
2943         }
2944         else
2945         {
2946                 dts_fail(API_NAME, "failed");
2947         }
2948 }