Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

root/trunk/test/sm11/client.rb

Revision 1520, 16.4 kB (checked in by nahi, 4 years ago)

removed svn:executable

  • Property svn:eol-style set to native
  • Property svn:keywords set to author date id revision
Line 
1 # Done
2 #   /^void/  def/
3 #   /^}/  end/
4 #   /System.out.print/STDOUT.puts/g
5 #   /try { \(.*\) }/\1/
6 #   /\.set\([^(]*\)(\([^)]*\))/.\1 = \2/
7 #   /E_/e_/
8 #   /\.get\([^(]*\)()/.\1/
9 #   /(short)//
10 #
11 require 'soap/baseData'
12
13 class Sm11Caller
14   include SOAP
15
16   attr_reader :target
17
18   def initialize( target )
19     @target = target
20   end
21
22 private
23   def cons_0000()
24     _v1 = C_struct.new()
25     _v1.e_boolean = false
26     _v1.e_short = SOAPShort.new(-100)
27     _v1.e_int = SOAPInt.new(-100000)
28     _v1.e_long = SOAPLong.new(-10000000000)
29     _v1.e_float = SOAPFloat.new(0.123)
30     _v1.e_double = 0.12e3
31     _v1.e_String = "abc"
32     return(_v1)
33   end
34   def comp_0000(_v1)
35     return(true &&
36         (_v1.e_boolean()) &&
37         (_v1.e_short == -200) &&
38         (_v1.e_int == -200000) &&
39         (_v1.e_long == -20000000000) &&
40         (_v1.e_float == 1.234) &&
41         (_v1.e_double == 1.23e4) &&
42         (_v1.e_String == "def")
43     )
44   end
45   def cons_0001()
46     _v1 = C_struct.new()
47     _v1.e_boolean = false
48     _v1.e_short = SOAPShort.new(-100)
49     _v1.e_int = SOAPInt.new(-100000)
50     _v1.e_long = SOAPLong.new(-10000000000)
51     _v1.e_float = SOAPFloat.new(0.123)
52     _v1.e_double = 0.12e3
53     _v1.e_String = "abc"
54     return(_v1)
55   end
56   def cons_0003()
57     _v1 = C_struct.new()
58     _v1.e_boolean = false
59     _v1.e_short = SOAPShort.new(-100)
60     _v1.e_int = SOAPInt.new(-100000)
61     _v1.e_long = SOAPLong.new(-10000000000)
62     _v1.e_float = SOAPFloat.new(0.123)
63     _v1.e_double = 0.12e3
64     _v1.e_String = "abc"
65     return(_v1)
66   end
67   def cons_0002()
68     _v1 = F_struct.new()
69     _v1.e_c_struct = cons_0003()
70     _v1.e_c_array_e_boolean = ArrayOfboolean[false, false]
71     _v1.e_c_array_e_short = ArrayOfshort[-100, -100]
72     _v1.e_c_array_e_int = ArrayOfint[-100000, -100000]
73     _v1.e_c_array_e_long = ArrayOflong[-10000000000, -10000000000]
74     _v1.e_c_array_e_float = ArrayOffloat[0.123, 0.123]
75     _v1.e_c_array_e_double = ArrayOfdouble[0.12e3, 0.12e3]
76     _v1.e_c_array_e_String = ArrayOfstring["abc", "abc"]
77     return(_v1)
78   end
79   def comp_0002(_v1)
80     return(true &&
81         (_v1.e_boolean()) &&
82         (_v1.e_short == -200) &&
83         (_v1.e_int == -200000) &&
84         (_v1.e_long == -20000000000) &&
85         (_v1.e_float == 1.234) &&
86         (_v1.e_double == 1.23e4) &&
87         (_v1.e_String == "def")
88     )
89   end
90   def comp_0001(_v1)
91     return(true &&
92         comp_0002(_v1.e_c_struct) &&
93         (true && (_v1.e_c_array_e_boolean[0] == true) && (_v1.e_c_array_e_boolean[1] == true)) &&
94         (true && (_v1.e_c_array_e_short[0] == -200) && (_v1.e_c_array_e_short[1] == -200)) &&
95         (true && (_v1.e_c_array_e_int[0] == -200000) && (_v1.e_c_array_e_int[1] == -200000)) &&
96         (true && (_v1.e_c_array_e_long[0] == -20000000000) && (_v1.e_c_array_e_long[1] == -20000000000)) &&
97         (true && (_v1.e_c_array_e_float[0] == 1.234) && (_v1.e_c_array_e_float[1] == 1.234)) &&
98         (true && (_v1.e_c_array_e_double[0] == 1.23e4) && (_v1.e_c_array_e_double[1] == 1.23e4)) &&
99         (true && (_v1.e_c_array_e_String[0] == "def") && (_v1.e_c_array_e_String[1] == "def"))
100     )
101   end
102   def cons_0004()
103     _v1 = C_struct.new()
104     _v1.e_boolean = false
105     _v1.e_short = SOAPShort.new(-100)
106     _v1.e_int = SOAPInt.new(-100000)
107     _v1.e_long = SOAPLong.new(-10000000000)
108     _v1.e_float = SOAPFloat.new(0.123)
109     _v1.e_double = 0.12e3
110     _v1.e_String = "abc"
111     return(_v1)
112   end
113   def comp_0003(_v1)
114     return(true &&
115         (_v1.e_boolean()) &&
116         (_v1.e_short == -200) &&
117         (_v1.e_int == -200000) &&
118         (_v1.e_long == -20000000000) &&
119         (_v1.e_float == 1.234) &&
120         (_v1.e_double == 1.23e4) &&
121         (_v1.e_String == "def")
122     )
123   end
124   def cons_0006()
125     _v1 = C_struct.new()
126     _v1.e_boolean = false
127     _v1.e_short = SOAPShort.new(-100)
128     _v1.e_int = SOAPInt.new(-100000)
129     _v1.e_long = SOAPLong.new(-10000000000)
130     _v1.e_float = SOAPFloat.new(0.123)
131     _v1.e_double = 0.12e3
132     _v1.e_String = "abc"
133     return(_v1)
134   end
135   def cons_0005()
136     _v1 = F_struct.new()
137     _v1.e_c_struct = cons_0006()
138     _v1.e_c_array_e_boolean = ArrayOfboolean[false, false]
139     _v1.e_c_array_e_short = ArrayOfshort[-100, -100]
140     _v1.e_c_array_e_int = ArrayOfint[-100000, -100000]
141     _v1.e_c_array_e_long = ArrayOflong[-10000000000, -10000000000]
142     _v1.e_c_array_e_float = ArrayOffloat[0.123, 0.123]
143     _v1.e_c_array_e_double = ArrayOfdouble[0.12e3, 0.12e3]
144     _v1.e_c_array_e_String = ArrayOfstring["abc", "abc"]
145     return(_v1)
146   end
147   def comp_0004(_v1)
148     return(true &&
149         (_v1.v1()) &&
150         (_v1.v4 == -200) &&
151         (_v1.v5 == -200000) &&
152         (_v1.v6 == -20000000000) &&
153         (_v1.v7 == 1.234) &&
154         (_v1.v8 == 1.23e4) &&
155         (_v1.v9 == "def")
156     )
157   end
158   def comp_0006(_v1)
159     return(true &&
160         (_v1.e_boolean()) &&
161         (_v1.e_short == -200) &&
162         (_v1.e_int == -200000) &&
163         (_v1.e_long == -20000000000) &&
164         (_v1.e_float == 1.234) &&
165         (_v1.e_double == 1.23e4) &&
166         (_v1.e_String == "def")
167     )
168   end
169   def comp_0005(_v1)
170     return(true &&
171         comp_0006(_v1.v10) &&
172         (true && (_v1.v21[0] == true) && (_v1.v21[1] == true)) &&
173         (true && (_v1.v24[0] == -200) && (_v1.v24[1] == -200)) &&
174         (true && (_v1.v25[0] == -200000) && (_v1.v25[1] == -200000)) &&
175         (true && (_v1.v26[0] == -20000000000) && (_v1.v26[1] == -20000000000)) &&
176         (true && (_v1.v27[0] == 1.234) && (_v1.v27[1] == 1.234)) &&
177         (true && (_v1.v28[0] == 1.23e4) && (_v1.v28[1] == 1.23e4)) &&
178         (true && (_v1.v29[0] == "def") && (_v1.v29[1] == "def"))
179     )
180   end
181   def comp_0009(_v1)
182     return(true &&
183         (_v1.e_boolean()) &&
184         (_v1.e_short == -200) &&
185         (_v1.e_int == -200000) &&
186         (_v1.e_long == -20000000000) &&
187         (_v1.e_float == 1.234) &&
188         (_v1.e_double == 1.23e4) &&
189         (_v1.e_String == "def")
190     )
191   end
192   def comp_0008(_v1)
193     return(true &&
194         comp_0009(_v1.e_c_struct) &&
195         (true && (_v1.e_c_array_e_boolean[0] == true) && (_v1.e_c_array_e_boolean[1] == true)) &&
196         (true && (_v1.e_c_array_e_short[0] == -200) && (_v1.e_c_array_e_short[1] == -200)) &&
197         (true && (_v1.e_c_array_e_int[0] == -200000) && (_v1.e_c_array_e_int[1] == -200000)) &&
198         (true && (_v1.e_c_array_e_long[0] == -20000000000) && (_v1.e_c_array_e_long[1] == -20000000000)) &&
199         (true && (_v1.e_c_array_e_float[0] == 1.234) && (_v1.e_c_array_e_float[1] == 1.234)) &&
200         (true && (_v1.e_c_array_e_double[0] == 1.23e4) && (_v1.e_c_array_e_double[1] == 1.23e4)) &&
201         (true && (_v1.e_c_array_e_String[0] == "def") && (_v1.e_c_array_e_String[1] == "def"))
202     )
203   end
204   def comp_0007(_v1)
205     return(true &&
206         comp_0008(_v1.v40)
207     )
208   end
209   def comp_0011(_v1)
210     return(true &&
211         (_v1.e_boolean()) &&
212         (_v1.e_short == -200) &&
213         (_v1.e_int == -200000) &&
214         (_v1.e_long == -20000000000) &&
215         (_v1.e_float == 1.234) &&
216         (_v1.e_double == 1.23e4) &&
217         (_v1.e_String == "def")
218     )
219   end
220   def comp_0010(_v1)
221     return(true &&
222         (true && comp_0011(_v1.v50[0]) && comp_0011(_v1.v50[1]))
223     )
224   end
225
226   def call_op0()
227     STDOUT.puts("op0\n")
228     target.op0()
229   end
230   def call_op1()
231     STDOUT.puts("op1\n")
232     a1 = false
233     target.op1(a1)
234   end
235   def call_op4()
236     STDOUT.puts("op4\n")
237     a1 = SOAPShort.new(-100)
238     target.op4(a1)
239   end
240   def call_op5()
241     STDOUT.puts("op5\n")
242     a1 = -100000
243     target.op5(a1)
244   end
245   def call_op6()
246     STDOUT.puts("op6\n")
247     a1 = -10000000000
248     target.op6(a1)
249   end
250   def call_op7()
251     STDOUT.puts("op7\n")
252     a1 = SOAPFloat.new(0.123)
253     target.op7(a1)
254   end
255   def call_op8()
256     STDOUT.puts("op8\n")
257     a1 = 0.12e3
258     target.op8(a1)
259   end
260   def call_op9()
261     STDOUT.puts("op9\n")
262     a1 = "abc"
263     target.op9(a1)
264   end
265   def call_op11()
266     STDOUT.puts("op11\n")
267     _ret = target.op11()
268     raise unless _ret.is_a?( TrueClass )
269     if (!(_ret == true)); STDOUT.puts("_ret value error in op11\n"); end
270   end
271   def call_op14()
272     STDOUT.puts("op14\n")
273     _ret = target.op14()
274     raise unless _ret.is_a?( Integer )
275     if (!(_ret == -200)); STDOUT.puts("_ret value error in op14\n"); end
276   end
277   def call_op15()
278     STDOUT.puts("op15\n")
279     _ret = target.op15()
280     raise unless _ret.is_a?( Integer )
281     if (!(_ret == -200000)); STDOUT.puts("_ret value error in op15\n"); end
282   end
283   def call_op16()
284     STDOUT.puts("op16\n")
285     _ret = target.op16()
286     raise unless _ret.is_a?( Integer )
287     if (!(_ret == -20000000000)); STDOUT.puts("_ret value error in op16\n"); end
288   end
289   def call_op17()
290     STDOUT.puts("op17\n")
291     _ret = target.op17()
292     raise unless _ret.is_a?( Float )
293     if (!(_ret == 1.234)); STDOUT.puts("_ret value error in op17\n"); end
294   end
295   def call_op18()
296     STDOUT.puts("op18\n")
297     _ret = target.op18()
298     raise unless _ret.is_a?( Float )
299     if (!(_ret == 1.23e4)); STDOUT.puts("_ret value error in op18\n"); end
300   end
301   def call_op19()
302     STDOUT.puts("op19\n")
303     _ret = target.op19()
304     raise unless _ret.is_a?( String )
305     if (!(_ret == "def")); STDOUT.puts("_ret value error in op19\n"); end
306   end
307   def call_op21()
308     STDOUT.puts("op21\n")
309     a1 = false
310     _ret = target.op21(a1)
311     raise unless _ret.is_a?( TrueClass ) or _ret.is_a?( FalseClass )
312     if (!(_ret == true)); STDOUT.puts("_ret value error in op21\n"); end
313   end
314   def call_op24()
315     STDOUT.puts("op24\n")
316     a1 = SOAPShort.new(-100)
317     a2 = SOAPInt.new(-100000)
318     a3 = SOAPLong.new(-10000000000)
319     _ret = target.op24(a1,a2,a3)
320     raise unless _ret.is_a?( Integer )
321     if (!(_ret == -200)); STDOUT.puts("_ret value error in op24\n"); end
322   end
323   def call_op25()
324     STDOUT.puts("op25\n")
325     a1 = SOAPInt.new(-100000)
326     a2 = SOAPLong.new(-10000000000)
327     a3 = SOAPFloat.new(0.123)
328     _ret = target.op25(a1,a2,a3)
329     raise unless _ret.is_a?( Integer )
330     if (!(_ret == -200000)); STDOUT.puts("_ret value error in op25\n"); end
331   end
332   def call_op26()
333     STDOUT.puts("op26\n")
334     a1 = SOAPLong.new(-10000000000)
335     a2 = SOAPFloat.new(0.123)
336     a3 = 0.12e3
337     _ret = target.op26(a1,a2,a3)
338     raise unless _ret.is_a?( Integer )
339     if (!(_ret == -20000000000)); STDOUT.puts("_ret value error in op26\n"); end
340   end
341   def call_op27()
342     STDOUT.puts("op27\n")
343     a1 = SOAPFloat.new(0.123)
344     a2 = 0.12e3
345     a3 = "abc"
346     _ret = target.op27(a1,a2,a3)
347     raise unless _ret.is_a?( Float )
348     if (!(_ret == 1.234)); STDOUT.puts("_ret value error in op27\n"); end
349   end
350   def call_op28()
351     STDOUT.puts("op28\n")
352     a1 = 0.12e3
353     a2 = "abc"
354     a3 = false
355     _ret = target.op28(a1,a2,a3)
356     raise unless _ret.is_a?( Float )
357     if (!(_ret == 1.23e4)); STDOUT.puts("_ret value error in op28\n"); end
358   end
359   def call_op29()
360     STDOUT.puts("op29\n")
361     a1 = "abc"
362     a2 = false
363     _ret = target.op29(a1,a2)
364     raise unless _ret.is_a?( String )
365     if (!(_ret == "def")); STDOUT.puts("_ret value error in op29\n"); end
366   end
367   def call_op30()
368     STDOUT.puts("op30\n")
369     a1 = cons_0000()
370     _ret = target.op30(a1)
371     if (!comp_0000(_ret)); STDOUT.puts("_ret value error in op30\n"); end
372   end
373   def call_op31()
374     STDOUT.puts("op31\n")
375     a1 = ArrayOfboolean[false, false]
376     _ret = target.op31(a1)
377     if (!(true && (_ret[0] == true) && (_ret[1] == true))); STDOUT.puts("_ret value error in op31\n"); end
378   end
379   def call_op34()
380     STDOUT.puts("op34\n")
381     a1 = ArrayOfshort[-100, -100]
382     _ret = target.op34(a1)
383     if (!(true && (_ret[0] == -200) && (_ret[1] == -200))); STDOUT.puts("_ret value error in op34\n"); end
384   end
385   def call_op35()
386     STDOUT.puts("op35\n")
387     a1 = ArrayOfint[-100000, -100000]
388     _ret = target.op35(a1)
389     if (!(true && (_ret[0] == -200000) && (_ret[1] == -200000))); STDOUT.puts("_ret value error in op35\n"); end
390   end
391   def call_op36()
392     STDOUT.puts("op36\n")
393     a1 = ArrayOflong[-10000000000, -10000000000]
394     _ret = target.op36(a1)
395     if (!(true && (_ret[0] == -20000000000) && (_ret[1] == -20000000000))); STDOUT.puts("_ret value error in op36\n"); end
396   end
397   def call_op37()
398     STDOUT.puts("op37\n")
399     a1 = ArrayOffloat[0.123, 0.123]
400     _ret = target.op37(a1)
401     if (!(true && (_ret[0] == 1.234) && (_ret[1] == 1.234))); STDOUT.puts("_ret value error in op37\n"); end
402   end
403   def call_op38()
404     STDOUT.puts("op38\n")
405     a1 = ArrayOfdouble[0.12e3, 0.12e3]
406     _ret = target.op38(a1)
407     if (!(true && (_ret[0] == 1.23e4) && (_ret[1] == 1.23e4))); STDOUT.puts("_ret value error in op38\n"); end
408   end
409   def call_op39()
410     STDOUT.puts("op39\n")
411     a1 = ArrayOfstring["abc", "abc"]
412     _ret = target.op39(a1)
413     if (!(true && (_ret[0] == "def") && (_ret[1] == "def"))); STDOUT.puts("_ret value error in op39\n"); end
414   end
415   def call_op40()
416     STDOUT.puts("op40\n")
417     a1 = cons_0001()
418     a2 = ArrayOfboolean[false, false]
419     a3 = ArrayOfint[-100000, -100000]
420     a4 = ArrayOfdouble[0.12e3, 0.12e3]
421     a5 = ArrayOfstring["abc", "abc"]
422     target.op40(a1,a2,a3,a4,a5)
423   end
424   def call_op41()
425     STDOUT.puts("op41\n")
426     a1 = cons_0002()
427     _ret = target.op41(a1)
428     if (!comp_0001(_ret)); STDOUT.puts("_ret value error in op41\n"); end
429   end
430   def call_op42()
431     STDOUT.puts("op42\n")
432     a1 = ArrayOfC_struct[cons_0004(), cons_0004()]
433     _ret = target.op42(a1)
434     if (!(true && comp_0003(_ret[0]) && comp_0003(_ret[1]))); STDOUT.puts("_ret value error in op42\n"); end
435   end
436   def call_op43()
437     STDOUT.puts("op43\n")
438     a1 = cons_0005()
439     a2 = ArrayOfC_struct[cons_0006(), cons_0006()]
440     target.op43(a1,a2)
441   end
442   def call_excop1()
443     STDOUT.puts("excop1\n")
444     begin
445       target.excop1()
446     rescue A_except => _exc
447         if (!comp_0004(_exc)); STDOUT.puts("_exc value error in excop1\n"); end
448         return
449     end
450     STDOUT.puts("no exception raised in excop1\n")
451   end
452   def call_excop2()
453     STDOUT.puts("excop2\n")
454     begin
455       target.excop2()
456     rescue C_except => _exc
457         if (!comp_0005(_exc)); STDOUT.puts("_exc value error in excop2\n"); end
458         return
459     end
460     STDOUT.puts("no exception raised in excop2\n")
461   end
462   def call_excop3()
463     STDOUT.puts("excop3\n")
464     begin
465       target.excop3()
466     rescue F_except1 => _exc
467         if (!comp_0007(_exc)); STDOUT.puts("_exc value error in excop3\n"); end
468         return
469     end
470     STDOUT.puts("no exception raised in excop3\n")
471   end
472   def call_excop4()
473     STDOUT.puts("excop4\n")
474     begin
475       target.excop4()
476     rescue F_except2 => _exc
477         if (!comp_0010(_exc)); STDOUT.puts("_exc value error in excop4\n"); end
478         return
479     end
480     STDOUT.puts("no exception raised in excop4\n")
481   end
482
483 public
484
485   def dispatcher(argv, start, argc)
486     all = (start == argc)
487     i = all ? start-1 : start
488     while (i < argc) do
489         if (all || ("op0" == argv[i])); call_op0(); end
490         if (all || ("op1" == argv[i])); call_op1(); end
491         if (all || ("op4" == argv[i])); call_op4(); end
492         if (all || ("op5" == argv[i])); call_op5(); end
493         if (all || ("op6" == argv[i])); call_op6(); end
494         if (all || ("op7" == argv[i])); call_op7(); end
495         if (all || ("op8" == argv[i])); call_op8(); end
496         if (all || ("op9" == argv[i])); call_op9(); end
497         if (all || ("op11" == argv[i])); call_op11(); end
498         if (all || ("op14" == argv[i])); call_op14(); end
499         if (all || ("op15" == argv[i])); call_op15(); end
500         if (all || ("op16" == argv[i])); call_op16(); end
501         if (all || ("op17" == argv[i])); call_op17(); end
502         if (all || ("op18" == argv[i])); call_op18(); end
503         if (all || ("op19" == argv[i])); call_op19(); end
504         if (all || ("op21" == argv[i])); call_op21(); end
505         if (all || ("op24" == argv[i])); call_op24(); end
506         if (all || ("op25" == argv[i])); call_op25(); end
507         if (all || ("op26" == argv[i])); call_op26(); end
508         if (all || ("op27" == argv[i])); call_op27(); end
509         if (all || ("op28" == argv[i])); call_op28(); end
510         if (all || ("op29" == argv[i])); call_op29(); end
511         if (all || ("op30" == argv[i])); call_op30(); end
512         if (all || ("op31" == argv[i])); call_op31(); end
513         if (all || ("op34" == argv[i])); call_op34(); end
514         if (all || ("op35" == argv[i])); call_op35(); end
515         if (all || ("op36" == argv[i])); call_op36(); end
516         if (all || ("op37" == argv[i])); call_op37(); end
517         if (all || ("op38" == argv[i])); call_op38(); end
518         if (all || ("op39" == argv[i])); call_op39(); end
519         if (all || ("op40" == argv[i])); call_op40(); end
520         if (all || ("op41" == argv[i])); call_op41(); end
521         if (all || ("op42" == argv[i])); call_op42(); end
522         if (all || ("op43" == argv[i])); call_op43(); end
523         if (all || ("excop1" == argv[i])); call_excop1(); end
524         if (all || ("excop2" == argv[i])); call_excop2(); end
525         if (all || ("excop3" == argv[i])); call_excop3(); end
526         if (all || ("excop4" == argv[i])); call_excop4(); end
527
528         i += 1
529     end
530   end
531
532 end
533
534
535 #url = "http://localhost:10080/"
536 #url = "http://16.175.170.131:8080/axis/services/sm11Port"
537 #url = "http://16.175.170.131/soapsrv"
538 url = ARGV.shift
539 require 'driver'
540 drv = Sm11PortType.new( url )
541 #drv.setWireDumpDev( STDOUT )
542 Sm11Caller.new( drv ).dispatcher( ARGV, 0, ARGV.size )
Note: See TracBrowser for help on using the browser.