|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "CRemoteInterface.h" |
|
21 |
|
22 // Test constant values |
|
23 const char KRemoteHost[] = { "10.16.163.13:666" }; |
|
24 const char KServiceName[] = { "TestService" }; |
|
25 |
|
26 int main() |
|
27 { |
|
28 // Some basic unit tests which call the test service via the UCC |
|
29 CRemoteInterface rif( KRemoteHost ); |
|
30 |
|
31 // Start the service |
|
32 rif.SetupStartService( KServiceName ); |
|
33 int ret = rif.Send(); |
|
34 if( ret ) |
|
35 { |
|
36 printf( "*** FAILED ***" ); |
|
37 return ret; |
|
38 } |
|
39 |
|
40 // TestCallOne |
|
41 printf( "Sending TestCallOne\n" ); |
|
42 rif.SetupCall( KServiceName, "TestCallOne" ); |
|
43 rif.AddParam( "PARAM1", "HELLO" ); |
|
44 rif.AddParam( "PARAM2", "WORLD" ); |
|
45 ret = rif.Send(); |
|
46 if( ret ) |
|
47 { |
|
48 printf( "*** FAILED ***" ); |
|
49 return ret; |
|
50 } |
|
51 |
|
52 // TestCallTwo |
|
53 printf( "Sending TestCallTwo\n" ); |
|
54 rif.SetupCall( KServiceName, "TestCallTwo" ); |
|
55 rif.AddParam( "PARAM1", "HELLO" ); |
|
56 rif.AddParam( "PARAM2", "WORLD" ); |
|
57 rif.AddParam( "PARAM3", "AGAIN" ); |
|
58 ret = rif.Send(); |
|
59 if( ret ) |
|
60 { |
|
61 printf( "*** FAILED ***" ); |
|
62 return ret; |
|
63 } |
|
64 |
|
65 // TestCallThree |
|
66 printf( "Sending TestCallThree\n" ); |
|
67 rif.SetupCall( KServiceName, "TestCallThree" ); |
|
68 rif.AddParam( "PARAM1", "PARAM1" ); |
|
69 rif.AddParam( "PARAM2", "PARAM2" ); |
|
70 rif.AddParam( "PARAM3", "PARAM3" ); |
|
71 rif.AddParam( "PARAM4", "PARAM4" ); |
|
72 rif.AddParam( "PARAM5", "PARAM5" ); |
|
73 rif.AddParam( "PARAM6", "PARAM6" ); |
|
74 rif.AddParam( "PARAM7", "PARAM7" ); |
|
75 rif.AddParam( "PARAM8", "PARAM8" ); |
|
76 rif.AddParam( "PARAM9", "PARAM9" ); |
|
77 rif.AddParam( "PARAM10", "PARAM10" ); |
|
78 ret = rif.Send(); |
|
79 if( ret ) |
|
80 { |
|
81 printf( "*** FAILED ***" ); |
|
82 return ret; |
|
83 } |
|
84 |
|
85 // Stop the service |
|
86 rif.SetupStopService( KServiceName ); |
|
87 ret = rif.Send(); |
|
88 if( ret ) |
|
89 { |
|
90 printf( "*** FAILED ***" ); |
|
91 return ret; |
|
92 } |
|
93 |
|
94 return 0; |
|
95 } |