em_hessian2 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ package example;
2
+
3
+ import java.io.Serializable;
4
+
5
+ public class Monkey implements Serializable {
6
+ /**
7
+ *
8
+ */
9
+ private static final long serialVersionUID = 1L;
10
+
11
+ public int age;
12
+ public String name;
13
+
14
+ public Monkey(){}
15
+
16
+ public int getAge() {
17
+ return age;
18
+ }
19
+
20
+ public void setAge(int age) {
21
+ this.age = age;
22
+ }
23
+
24
+ public String getName() {
25
+ return name;
26
+ }
27
+
28
+ public void setName(String name) {
29
+ this.name = name;
30
+ }
31
+ }
@@ -0,0 +1,1125 @@
1
+ package example;
2
+
3
+ import java.util.ArrayList;
4
+ import java.util.Date;
5
+ import java.util.HashMap;
6
+ import java.util.List;
7
+ import java.util.Map;
8
+
9
+ import org.eclipse.jetty.server.Server;
10
+ import org.eclipse.jetty.servlet.ServletContextHandler;
11
+ import org.eclipse.jetty.servlet.ServletHolder;
12
+
13
+ import com.caucho.hessian.server.HessianServlet;
14
+
15
+ public class MonkeyService extends HessianServlet implements IMonkeyService {
16
+ /**
17
+ *
18
+ */
19
+ private static final long serialVersionUID = 1L;
20
+
21
+ public static void main(String[] args) throws Exception {
22
+ Server server = new Server(9292);
23
+ ServletContextHandler context = new ServletContextHandler(
24
+ ServletContextHandler.SESSIONS);
25
+ server.setHandler(context);
26
+ ServletHolder servletHolder = new ServletHolder(new MonkeyService());
27
+ context.addServlet(servletHolder, "/monkey");
28
+ server.start();
29
+ server.join();
30
+
31
+ }
32
+
33
+ // 0x00..0x1f # utf-8 string length 0-31
34
+ public String get_string_0()
35
+ {
36
+ return "";
37
+ }
38
+
39
+ public String get_string_x1f()
40
+ {
41
+ StringBuilder sb = new StringBuilder();
42
+ for(int i = 0; i < 0x1f; i++)
43
+ {
44
+ sb.append("j");
45
+ }
46
+ return sb.toString();
47
+ }
48
+
49
+ public String get_string_x1fu()
50
+ {
51
+ StringBuilder sb = new StringBuilder();
52
+ for(int i = 0; i < 0x1f; i++)
53
+ {
54
+ sb.append("金");
55
+ }
56
+ return sb.toString();
57
+ }
58
+
59
+ public void set_string_0(String string1)
60
+ {
61
+ boolean isT = string1.isEmpty();
62
+ printAssert("set_string_0", isT);
63
+ }
64
+
65
+ public void set_string_x1f(String string1)
66
+ {
67
+ boolean isT = string1.charAt(0) == 'j' && string1.length() == 0x1f;
68
+ printAssert("set_string_x1f", isT);
69
+ }
70
+
71
+ public void set_string_x1fu(String string1)
72
+ {
73
+ boolean isT = string1.charAt(0) == '金' && string1.length() == 0x1f;
74
+ printAssert("set_string_x1fu", isT);
75
+ }
76
+
77
+ // 0x20..0x2f # binary data length 0-15
78
+ public byte[] get_bin_0()
79
+ {
80
+ return new byte[0];
81
+ }
82
+
83
+ public byte[] get_bin_xf()
84
+ {
85
+ return new byte[0xf];
86
+ }
87
+
88
+ public void set_bin_0(byte[] bin1)
89
+ {
90
+ boolean isT = bin1.length == 0;
91
+ printAssert("set_bin_0", isT);
92
+ }
93
+
94
+ public void set_bin_xf(byte[] bin1)
95
+ {
96
+ boolean isT = bin1.length == 0xf;
97
+ printAssert("set_bin_xf", isT);
98
+ }
99
+
100
+ // 0x30..0x33 # utf-8 string length 0-1023
101
+ public String get_string_x20()
102
+ {
103
+ StringBuilder sb = new StringBuilder();
104
+ for(int i = 0; i < 0x20; i++)
105
+ {
106
+ sb.append("j");
107
+ }
108
+ return sb.toString();
109
+ }
110
+
111
+ public String get_string_x20u()
112
+ {
113
+ StringBuilder sb = new StringBuilder();
114
+ for(int i = 0; i < 0x20; i++)
115
+ {
116
+ sb.append("金");
117
+ }
118
+ return sb.toString();
119
+ }
120
+
121
+ public String get_string_x3ff()
122
+ {
123
+ StringBuilder sb = new StringBuilder();
124
+ for(int i = 0; i < 0x3ff; i++)
125
+ {
126
+ sb.append("j");
127
+ }
128
+ return sb.toString();
129
+ }
130
+
131
+ public String get_string_x3ffu()
132
+ {
133
+ StringBuilder sb = new StringBuilder();
134
+ for(int i = 0; i < 0x3ff; i++)
135
+ {
136
+ sb.append("金");
137
+ }
138
+ return sb.toString();
139
+ }
140
+
141
+ public void set_string_x20(String string1)
142
+ {
143
+ boolean isT = string1.charAt(0) == 'j' && string1.length() == 0x20;
144
+ printAssert("set_string_x20", isT);
145
+ }
146
+
147
+ public void set_string_x20u(String string1)
148
+ {
149
+ boolean isT = string1.charAt(0) == '金' && string1.length() == 0x20;
150
+ printAssert("set_string_x20u", isT);
151
+ }
152
+
153
+ public void set_string_x3ff(String string1)
154
+ {
155
+ boolean isT = string1.charAt(0) == 'j' && string1.length() == 0x3ff;
156
+ printAssert("set_string_x3ff", isT);
157
+ }
158
+
159
+ public void set_string_x3ffu(String string1)
160
+ {
161
+ boolean isT = string1.charAt(0) == '金' && string1.length() == 0x3ff;
162
+ printAssert("set_string_x3ffu", isT);
163
+ }
164
+
165
+ // 0x34..0x37 # binary data length 0-1023
166
+ public byte[] get_bin_x10()
167
+ {
168
+ return new byte[0x10];
169
+ }
170
+
171
+ public byte[] get_bin_x3ff()
172
+ {
173
+ return new byte[0x3ff];
174
+ }
175
+
176
+ public void set_bin_x10(byte[] bin1)
177
+ {
178
+ boolean isT = bin1.length == 0x10;
179
+ printAssert("set_bin_x10", isT);
180
+ }
181
+
182
+ public void set_bin_x3ff(byte[] bin1)
183
+ {
184
+ boolean isT = bin1.length == 0x3ff;
185
+ printAssert("set_bin_x3ff", isT);
186
+ }
187
+
188
+ // 0x38..0x3f # three-octet compact long (-x40000 to x3ffff)
189
+ public long get_long_mx801()
190
+ {
191
+ return -0x801L;
192
+ }
193
+
194
+ public long get_long_x800()
195
+ {
196
+ return 0x800L;
197
+ }
198
+
199
+ public long get_long_mx40000()
200
+ {
201
+ return -0x40000L;
202
+ }
203
+
204
+ public long get_long_x3ffff()
205
+ {
206
+ return 0x3ffffL;
207
+ }
208
+
209
+ public void set_long_mx801(long long1)
210
+ {
211
+ boolean isT = long1 == -0x801L;
212
+ printAssert("set_long_mx801", isT);
213
+ }
214
+
215
+ public void set_long_x800(long long1)
216
+ {
217
+ boolean isT = long1 == 0x800L;
218
+ printAssert("set_long_x800", isT);
219
+ }
220
+
221
+ public void set_long_mx40000(long long1)
222
+ {
223
+ boolean isT = long1 == -0x40000L;
224
+ printAssert("set_long_mx40000", isT);
225
+ }
226
+
227
+ public void set_long_x3ffff(long long1)
228
+ {
229
+ boolean isT = long1 == 0x3ffffL;
230
+ printAssert("set_long_x3ffff", isT);
231
+ }
232
+
233
+ // 0x41 # 8-bit binary data non-final chunk ('A')
234
+ public byte[] get_lighthouse()
235
+ {
236
+ return new byte[561276];
237
+ }
238
+
239
+ public void set_lighthouse(byte[] bin1)
240
+ {
241
+ boolean isT = bin1.length == 561276;
242
+ printAssert("set_lighthouse", isT);
243
+ }
244
+
245
+ // 0x42 # 8-bit binary data final chunk ('B')
246
+ public byte[] get_bin_x400()
247
+ {
248
+ return new byte[0x400];
249
+ }
250
+
251
+ public byte[] get_bin_x8000()
252
+ {
253
+ return new byte[0x8000];
254
+ }
255
+
256
+ public void set_bin_x400(byte[] bin1)
257
+ {
258
+ boolean isT = bin1.length == 0x400;
259
+ printAssert("set_bin_x400", isT);
260
+ }
261
+
262
+ public void set_bin_x8000(byte[] bin1)
263
+ {
264
+ boolean isT = bin1.length == 0x8000;
265
+ printAssert("set_bin_x8000", isT);
266
+ }
267
+
268
+ // 0x43 # object type definition ('C') and 0x60..0x6f # object with direct type
269
+ // 0x4d # map with type ('M')
270
+ public Monkey get_monkey()
271
+ {
272
+ Monkey monkey1 = new Monkey();
273
+ monkey1.name = "阿门";
274
+ monkey1.age = 7;
275
+ return monkey1;
276
+ }
277
+
278
+ public void set_monkey(Monkey monkey1)
279
+ {
280
+ boolean isT = monkey1.name.equals("阿门") && monkey1.age == 7;
281
+ printAssert("set_monkey", isT);
282
+ }
283
+
284
+ // 0x44 # 64-bit IEEE encoded double ('D')
285
+ public double get_double_min()
286
+ {
287
+ return Double.MIN_VALUE;
288
+ }
289
+
290
+ public double get_double_max()
291
+ {
292
+ return Double.MAX_VALUE;
293
+ }
294
+
295
+ public double get_double_positive_infinity()
296
+ {
297
+ return Double.POSITIVE_INFINITY;
298
+ }
299
+
300
+ public double get_double_negative_infinity()
301
+ {
302
+ return Double.NEGATIVE_INFINITY;
303
+ }
304
+
305
+ public double get_double_nan()
306
+ {
307
+ return Double.NaN;
308
+ }
309
+
310
+ public double get_123dot456()
311
+ {
312
+ return 123.456d;
313
+ }
314
+
315
+ public void set_double_min(double double1)
316
+ {
317
+ boolean isT = double1 == Double.MIN_VALUE;
318
+ printAssert("set_double_min", isT);
319
+ }
320
+
321
+ public void set_double_max(double double1)
322
+ {
323
+ boolean isT = double1 == Double.MAX_VALUE;
324
+ printAssert("set_double_max", isT);
325
+ }
326
+
327
+ public void set_double_positive_infinity(double double1)
328
+ {
329
+ boolean isT = double1 == Double.POSITIVE_INFINITY;
330
+ printAssert("set_double_positive_infinity", isT);
331
+ }
332
+
333
+ public void set_double_negative_infinity(double double1)
334
+ {
335
+ boolean isT = double1 == Double.NEGATIVE_INFINITY;
336
+ printAssert("set_double_negative_infinity", isT);
337
+ }
338
+
339
+ public void set_double_nan(double double1)
340
+ {
341
+ boolean isT = String.valueOf(double1).equals("NaN");
342
+ printAssert("set_double_nan", isT);
343
+ }
344
+
345
+ public void set_123dot456(double double1)
346
+ {
347
+ boolean isT = double1 == 123.456d;
348
+ printAssert("set_123dot456", isT);
349
+ }
350
+
351
+ // 0x46 # boolean false ('F')
352
+ public boolean get_false()
353
+ {
354
+ return false;
355
+ }
356
+
357
+ public void set_false(boolean false1)
358
+ {
359
+ boolean isT = !false1;
360
+ printAssert("set_false", isT);
361
+ }
362
+
363
+ // 0x48 # untyped map ('H')
364
+ public Map<String, Object> get_map_h()
365
+ {
366
+ Map<String, Object> map1 = new HashMap<String, Object>();
367
+ map1.put("name", "阿门");
368
+ map1.put("age", 7);
369
+ return map1;
370
+ }
371
+
372
+ public void set_map_h(Map<String, Object> map1)
373
+ {
374
+ boolean isT = map1.get("name").equals("阿门") && map1.get("age").equals(7);
375
+ printAssert("set_map_h", isT);
376
+ }
377
+
378
+ // 0x49 # 32-bit signed integer ('I')
379
+ public int get_int_mx40001()
380
+ {
381
+ return -0x40001;
382
+ }
383
+
384
+ public int get_int_x40000()
385
+ {
386
+ return 0x40000;
387
+ }
388
+
389
+ public int get_int_mx40_000_000()
390
+ {
391
+ return -0x40000000;
392
+ }
393
+
394
+ public int get_int_x3f_fff_fff()
395
+ {
396
+ return 0x3fffffff;
397
+ }
398
+
399
+ public void set_int_mx40001(int int1)
400
+ {
401
+ boolean isT = int1 == -0x40001;
402
+ printAssert("set_int_mx40001", isT);
403
+ }
404
+
405
+ public void set_int_x40000(int int1)
406
+ {
407
+ boolean isT = int1 == 0x40000;
408
+ printAssert("set_int_x40000", isT);
409
+ }
410
+
411
+ public void set_int_mx40_000_000(int int1)
412
+ {
413
+ boolean isT = int1 == -0x40000000;
414
+ printAssert("set_int_mx40_000_000", isT);
415
+ }
416
+
417
+ public void set_int_x3f_fff_fff(int int1)
418
+ {
419
+ boolean isT = int1 == 0x3fffffff;
420
+ printAssert("set_int_x3f_fff_fff", isT);
421
+ }
422
+
423
+ // 0x4a # 64-bit UTC millisecond date
424
+ public Date get_date_20130112145959()
425
+ {
426
+ return new Date(1357973999000L);
427
+ }
428
+
429
+ public long get_long_20130112145959()
430
+ {
431
+ return 1357973999000L;
432
+ }
433
+
434
+ public void set_date_20130112145959(Date date1)
435
+ {
436
+ boolean isT = date1.equals(new Date(1357973999000L));
437
+ printAssert("set_date", isT);
438
+ }
439
+
440
+ // 0x4b # 32-bit UTC minute date
441
+ public Date get_date_201301121459()
442
+ {
443
+ return new Date(1357973940000L);
444
+ }
445
+
446
+ public void set_date_201301121459(Date date1)
447
+ {
448
+ boolean isT = date1.equals(new Date(1357973940000L));
449
+ printAssert("set_date_min", isT);
450
+ }
451
+
452
+ // 0x4c # 64-bit signed long integer ('L')
453
+ public long get_long_mx80_000_001()
454
+ {
455
+ return -0x80000001L;
456
+ }
457
+
458
+ public long get_long_x80_000_000()
459
+ {
460
+ return 0x80000000L;
461
+ }
462
+
463
+ public long get_long_mx8_000_000_000_000_000()
464
+ {
465
+ return -0x8000000000000000L;
466
+ }
467
+
468
+ public long get_long_x7_fff_fff_fff_fff_fff()
469
+ {
470
+ return 0x7fffffffffffffffL;
471
+ }
472
+
473
+ public void set_long_mx80_000_001(long long1)
474
+ {
475
+ boolean isT = long1 == -0x80000001L;
476
+ printAssert("set_long_mx80_000_001", isT);
477
+ }
478
+
479
+ public void set_long_x80_000_000(long long1)
480
+ {
481
+ boolean isT = long1 == 0x80000000L;
482
+ printAssert("set_long_x80_000_000", isT);
483
+ }
484
+
485
+ public void set_long_mx8_000_000_000_000_000(long long1)
486
+ {
487
+ boolean isT = long1 == -0x8000000000000000L;
488
+ printAssert("set_long_mx8_000_000_000_000_000", isT);
489
+ }
490
+
491
+ public void set_long_x7_fff_fff_fff_fff_fff(long long1)
492
+ {
493
+ boolean isT = long1 == 0x7fffffffffffffffL;
494
+ printAssert("set_long_x7_fff_fff_fff_fff_fff", isT);
495
+ }
496
+
497
+ // 0x4d # map with type ('M')
498
+ public Monkey get_map()
499
+ {
500
+ Monkey monkey1 = new Monkey();
501
+ monkey1.name = "阿门";
502
+ monkey1.age = 7;
503
+ return monkey1;
504
+ }
505
+
506
+ public void set_map(Monkey map1)
507
+ {
508
+ boolean isT = map1.name.equals("阿门") && map1.age == 7;
509
+ printAssert("set_map", isT);
510
+ }
511
+
512
+ // 0x4e # null ('N')
513
+ public Object get_null()
514
+ {
515
+ return null;
516
+ }
517
+
518
+ public void set_null(Object obj)
519
+ {
520
+ boolean isT = obj == null;
521
+ printAssert("set_null", isT);
522
+ }
523
+
524
+ // 0x4f # object instance ('O')
525
+ public ArrayList<Monkey> get_monkeys()
526
+ {
527
+ Monkey monkey1 = new Monkey();
528
+ monkey1.name = "阿门";
529
+ monkey1.age = 7;
530
+ Monkey monkey2 = new Monkey();
531
+ monkey2.name = "大鸡";
532
+ monkey2.age = 6;
533
+ ArrayList<Monkey> arr = new ArrayList<Monkey>();
534
+ arr.add(monkey1);
535
+ arr.add(monkey2);
536
+ return arr;
537
+ }
538
+
539
+ public void set_monkeys(ArrayList<Monkey> monkeys)
540
+ {
541
+ boolean isT = monkeys.size() == 0x11;
542
+ printAssert("set_monkeys", isT);
543
+ }
544
+
545
+ // 0x51 # reference to map/list/object - integer ('Q')
546
+ public ArrayList<Map<String, Object>> get_map_h_map_h()
547
+ {
548
+ Map<String, Object> map1 = new HashMap<String, Object>();
549
+ map1.put("name", "阿门");
550
+ map1.put("age", 7);
551
+ // Map<String, Object> map2 = new HashMap<String, Object>();
552
+ // map2.put("name", "大鸡");
553
+ // map2.put("age", 6);
554
+ ArrayList<Map<String, Object>> arr = new ArrayList<Map<String, Object>>();
555
+ arr.add(map1);
556
+ arr.add(map1);
557
+ return arr;
558
+ }
559
+
560
+ public ArrayList<int[]> get_direct_list_list()
561
+ {
562
+ int[] list1 = new int[]{1,2,3,4,5,6,7};
563
+ ArrayList<int[]> arr = new ArrayList<int[]>();
564
+ arr.add(list1);
565
+ arr.add(list1);
566
+ return arr;
567
+ }
568
+
569
+ public ArrayList<int[]> get_list_list()
570
+ {
571
+ int[] list1 = new int[]{1,2,3,4,5,6,7,1,2,3,4,5,6,7};
572
+ ArrayList<int[]> arr = new ArrayList<int[]>();
573
+ arr.add(list1);
574
+ arr.add(list1);
575
+ return arr;
576
+ }
577
+
578
+ public ArrayList<List> get_direct_untyped_list_list()
579
+ {
580
+ List list1 = new ArrayList();
581
+ for(int i = 1; i <= 7; i++)
582
+ {
583
+ list1.add(i);
584
+ }
585
+ ArrayList<List> arr = new ArrayList<List>();
586
+ arr.add(list1);
587
+ arr.add(list1);
588
+ return arr;
589
+ }
590
+
591
+ public ArrayList<List> get_untyped_list_list()
592
+ {
593
+ List list1 = new ArrayList();
594
+ for(int i = 1; i <= 7; i++)
595
+ {
596
+ list1.add(i);
597
+ }
598
+ for(int i = 1; i <= 7; i++)
599
+ {
600
+ list1.add(i);
601
+ }
602
+ ArrayList<List> arr = new ArrayList<List>();
603
+ arr.add(list1);
604
+ arr.add(list1);
605
+ return arr;
606
+ }
607
+
608
+ public ArrayList<Monkey> get_monkey_monkey()
609
+ {
610
+ Monkey monkey1 = new Monkey();
611
+ monkey1.name = "阿门";
612
+ monkey1.age = 7;
613
+ ArrayList<Monkey> arr = new ArrayList<Monkey>();
614
+ arr.add(monkey1);
615
+ arr.add(monkey1);
616
+ return arr;
617
+ }
618
+
619
+ public void set_map_list_monkey_map_list_monkey(Map<String, Object> map1, int[] list1, Monkey monkey1,
620
+ Map<String, Object> map2, int[] list2, Monkey monkey2)
621
+ {
622
+ boolean isT = map1.get("name") == map2.get("name") && list1[0] == list2[0] && monkey1.name == monkey2.name;
623
+ printAssert("set_map_list_monkey_map_list_monkey", isT);
624
+ }
625
+
626
+ // 0x52 # utf-8 string non-final chunk ('R')
627
+ public String get_string_x8001()
628
+ {
629
+ StringBuilder sb = new StringBuilder();
630
+ for(int i = 0; i < 0x8001; i++)
631
+ {
632
+ sb.append("j");
633
+ }
634
+ return sb.toString();
635
+ }
636
+
637
+ public String get_string_x8001u()
638
+ {
639
+ StringBuilder sb = new StringBuilder();
640
+ for(int i = 0; i < 0x8001; i++)
641
+ {
642
+ sb.append("金");
643
+ }
644
+ return sb.toString();
645
+ }
646
+
647
+ public void set_string_x8001(String string1)
648
+ {
649
+ boolean isT = string1.length() == 0x8001 && string1.charAt(0) == 'j';
650
+ printAssert("set_string_x8001", isT);
651
+ }
652
+
653
+ public void set_string_x8001u(String string1)
654
+ {
655
+ boolean isT = string1.length() == 0x8001 && string1.charAt(0) == '金';
656
+ printAssert("set_string_x8001u", isT);
657
+ }
658
+
659
+ // 0x53 # utf-8 string final chunk ('S')
660
+ public String get_string_x400()
661
+ {
662
+ StringBuilder sb = new StringBuilder();
663
+ for(int i = 0; i < 0x400; i++)
664
+ {
665
+ sb.append("j");
666
+ }
667
+ return sb.toString();
668
+ }
669
+
670
+ public String get_string_x400u()
671
+ {
672
+ StringBuilder sb = new StringBuilder();
673
+ for(int i = 0; i < 0x400; i++)
674
+ {
675
+ sb.append("金");
676
+ }
677
+ return sb.toString();
678
+ }
679
+
680
+ public String get_string_x8000()
681
+ {
682
+ StringBuilder sb = new StringBuilder();
683
+ for(int i = 0; i < 0x8000; i++)
684
+ {
685
+ sb.append("j");
686
+ }
687
+ return sb.toString();
688
+ }
689
+
690
+ public String get_string_x8000u()
691
+ {
692
+ StringBuilder sb = new StringBuilder();
693
+ for(int i = 0; i < 0x8000; i++)
694
+ {
695
+ sb.append("金");
696
+ }
697
+ return sb.toString();
698
+ }
699
+
700
+ public void set_string_x400(String string1)
701
+ {
702
+ boolean isT = string1.length() == 0x400 && string1.charAt(0) == 'j';
703
+ printAssert("set_string_x400", isT);
704
+ }
705
+
706
+ public void set_string_x400u(String string1)
707
+ {
708
+ boolean isT = string1.length() == 0x400 && string1.charAt(0) == '金';
709
+ printAssert("set_string_x400u", isT);
710
+ }
711
+
712
+ public void set_string_x8000(String string1)
713
+ {
714
+ boolean isT = string1.length() == 0x8000 && string1.charAt(0) == 'j';
715
+ printAssert("set_string_x8000", isT);
716
+ }
717
+
718
+ public void set_string_x8000u(String string1)
719
+ {
720
+ boolean isT = string1.length() == 0x8000 && string1.charAt(0) == '金';
721
+ printAssert("set_string_x8000u", isT);
722
+ }
723
+
724
+ // 0x54 # boolean true ('T')
725
+ public boolean get_true()
726
+ {
727
+ return true;
728
+ }
729
+
730
+ public void set_true(boolean true1)
731
+ {
732
+ boolean isT = true1;
733
+ printAssert("set_true", isT);
734
+ }
735
+
736
+ // 0x56 # fixed-length list/vector ('V')
737
+ // 0x58 # fixed-length untyped list/vector ('X')
738
+ public Monkey[] get_list()
739
+ {
740
+ return new Monkey[]{new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey(), new Monkey()};
741
+ }
742
+
743
+ public List get_untyped_list()
744
+ {
745
+ List list1 = new ArrayList();
746
+ for(int i = 1; i <= 7; i++)
747
+ {
748
+ list1.add(i);
749
+ }
750
+ for(int i = 1; i <= 7; i++)
751
+ {
752
+ list1.add(i);
753
+ }
754
+ return list1;
755
+ }
756
+
757
+ public void set_list(Monkey[] list1)
758
+ {
759
+ boolean isT = list1.length == 14;
760
+ printAssert("set_list", isT);
761
+ }
762
+
763
+ // 0x59 # long encoded as 32-bit int ('Y')
764
+ public long get_long_mx40001()
765
+ {
766
+ return -0x40001L;
767
+ }
768
+
769
+ public long get_long_x40000()
770
+ {
771
+ return 0x40000L;
772
+ }
773
+
774
+ public long get_long_mx80_000_000()
775
+ {
776
+ return -0x80000000L;
777
+ }
778
+
779
+ public long get_long_x7f_fff_fff()
780
+ {
781
+ return 0x7fffffffL;
782
+ }
783
+
784
+ public void set_long_mx40001(long long1)
785
+ {
786
+ boolean isT = long1 == -0x40001L;
787
+ printAssert("set_long_mx40001", isT);
788
+ }
789
+
790
+ public void set_long_x40000(long long1)
791
+ {
792
+ boolean isT = long1 == 0x40000L;
793
+ printAssert("set_long_x40000", isT);
794
+ }
795
+
796
+ public void set_long_mx80_000_000(long long1)
797
+ {
798
+ boolean isT = long1 == -0x80000000L;
799
+ printAssert("set_long_mx80_000_000", isT);
800
+ }
801
+
802
+ public void set_long_x7f_fff_fff(long long1)
803
+ {
804
+ boolean isT = long1 == 0x7fffffffL;
805
+ printAssert("set_long_x7f_fff_fff", isT);
806
+ }
807
+
808
+ // 0x5b # double 0.0
809
+ public double get_double_0()
810
+ {
811
+ return 0.0;
812
+ }
813
+
814
+ public void set_double_0(double double1)
815
+ {
816
+ boolean isT = double1 == 0.0;
817
+ printAssert("set_double_0", isT);
818
+ }
819
+
820
+ // 0x5c # double 1.0
821
+ public double get_double_1()
822
+ {
823
+ return 1.0;
824
+ }
825
+
826
+ public void set_double_1(double double1)
827
+ {
828
+ boolean isT = double1 == 1.0;
829
+ printAssert("set_double_1", isT);
830
+ }
831
+
832
+ // 0x5d # double represented as byte (-128.0 to 127.0)
833
+ public double get_double_m128()
834
+ {
835
+ return -128.0;
836
+ }
837
+
838
+ public double get_double_127()
839
+ {
840
+ return 127.0;
841
+ }
842
+
843
+ public void set_double_m128(double double1)
844
+ {
845
+ boolean isT = double1 == -128.0;
846
+ printAssert("set_double_mx80", isT);
847
+ }
848
+
849
+ public void set_double_127(double double1)
850
+ {
851
+ boolean isT = double1 == 127.0;
852
+ printAssert("set_double_x7f", isT);
853
+ }
854
+
855
+ // 0x5e # double represented as short (-32768.0 to 32767.0)
856
+ public double get_double_m129()
857
+ {
858
+ return -129.0;
859
+ }
860
+
861
+ public double get_double_128()
862
+ {
863
+ return 128.0;
864
+ }
865
+
866
+ public double get_double_m32768()
867
+ {
868
+ return -32768.0;
869
+ }
870
+
871
+ public double get_double_32767()
872
+ {
873
+ return 32767.0;
874
+ }
875
+
876
+ public void set_double_m129(double double1)
877
+ {
878
+ boolean isT = double1 == -129.0;
879
+ printAssert("set_double_mx81", isT);
880
+ }
881
+
882
+ public void set_double_128(double double1)
883
+ {
884
+ boolean isT = double1 == 128.0;
885
+ printAssert("set_double_x80", isT);
886
+ }
887
+
888
+ public void set_double_m32768(double double1)
889
+ {
890
+ boolean isT = double1 == -32768.0;
891
+ printAssert("set_double_mx8000", isT);
892
+ }
893
+
894
+ public void set_double_32767(double double1)
895
+ {
896
+ boolean isT = double1 == 32767.0;
897
+ printAssert("set_double_x7fff", isT);
898
+ }
899
+
900
+ // 0x70..0x77 # fixed list with direct length
901
+ // 0x78..0x7f # fixed untyped list with direct length
902
+ public Monkey[] get_list_size0()
903
+ {
904
+ return new Monkey[]{};
905
+ }
906
+
907
+ public Monkey[] get_list_size7()
908
+ {
909
+ return new Monkey[]{new Monkey(),new Monkey(),new Monkey(),new Monkey(),new Monkey(),new Monkey(),new Monkey()};
910
+ }
911
+
912
+ public List get_untyped_list_size0()
913
+ {
914
+ return new ArrayList();
915
+ }
916
+
917
+ public List get_untyped_list_size7()
918
+ {
919
+ List list1 = new ArrayList();
920
+ for(int i = 1; i <= 7; i++)
921
+ {
922
+ list1.add(i);
923
+ }
924
+ return list1;
925
+ }
926
+
927
+ public void set_list_size0(Monkey[] list1)
928
+ {
929
+ boolean isT = list1.length == 0;
930
+ printAssert("set_list_size0", isT);
931
+ }
932
+
933
+ public void set_list_size7(Monkey[] list1)
934
+ {
935
+ boolean isT = list1.length == 7;
936
+ printAssert("set_list_size7", isT);
937
+ }
938
+
939
+ // 0x80..0xbf # one-octet compact int (-x10 to x2f, x90 is 0)
940
+ public int get_int_mx10()
941
+ {
942
+ return -0x10;
943
+ }
944
+
945
+ public int get_int_x3f()
946
+ {
947
+ return 0x3f;
948
+ }
949
+
950
+ public void set_int_mx10(int int1)
951
+ {
952
+ boolean isT = int1 == -0x10;
953
+ printAssert("set_int_mx10", isT);
954
+ }
955
+
956
+ public void set_int_x3f(int int1)
957
+ {
958
+ boolean isT = int1 == 0x3f;
959
+ printAssert("set_int_x3f", isT);
960
+ }
961
+
962
+ // 0xc0..0xcf # two-octet compact int (-x800 to x7ff)
963
+ public int get_int_mx11()
964
+ {
965
+ return -0x11;
966
+ }
967
+
968
+ public int get_int_x40()
969
+ {
970
+ return 0x40;
971
+ }
972
+
973
+ public int get_int_mx800()
974
+ {
975
+ return -0x800;
976
+ }
977
+
978
+ public int get_int_x7ff()
979
+ {
980
+ return 0x7ff;
981
+ }
982
+
983
+ public void set_int_mx11(int int1)
984
+ {
985
+ boolean isT = int1 == -0x11;
986
+ printAssert("set_int_mx11", isT);
987
+ }
988
+
989
+ public void set_int_x40(int int1)
990
+ {
991
+ boolean isT = int1 == 0x40;
992
+ printAssert("set_int_x40", isT);
993
+ }
994
+
995
+ public void set_int_mx800(int int1)
996
+ {
997
+ boolean isT = int1 == -0x800;
998
+ printAssert("set_int_mx800", isT);
999
+ }
1000
+
1001
+ public void set_int_x7ff(int int1)
1002
+ {
1003
+ boolean isT = int1 == 0x7ff;
1004
+ printAssert("set_int_x7ff", isT);
1005
+ }
1006
+
1007
+ // 0xd0..0xd7 # three-octet compact int (-x40000 to x3ffff)
1008
+ public int get_int_mx801()
1009
+ {
1010
+ return -0x801;
1011
+ }
1012
+
1013
+ public int get_int_x800()
1014
+ {
1015
+ return 0x800;
1016
+ }
1017
+
1018
+ public int get_int_mx40000()
1019
+ {
1020
+ return -0x40000;
1021
+ }
1022
+
1023
+ public int get_int_x3ffff()
1024
+ {
1025
+ return 0x3ffff;
1026
+ }
1027
+
1028
+ public void set_int_mx801(int int1)
1029
+ {
1030
+ boolean isT = int1 == -0x801;
1031
+ printAssert("set_int_set_int_mx801", isT);
1032
+ }
1033
+
1034
+ public void set_int_x800(int int1)
1035
+ {
1036
+ boolean isT = int1 == 0x800;
1037
+ printAssert("set_int_x800", isT);
1038
+ }
1039
+
1040
+ public void set_int_mx40000(int int1)
1041
+ {
1042
+ boolean isT = int1 == -0x40000;
1043
+ printAssert("set_int_mx40000", isT);
1044
+ }
1045
+
1046
+ public void set_int_x3ffff(int int1)
1047
+ {
1048
+ boolean isT = int1 == 0x3ffff;
1049
+ printAssert("set_int_x3ffff", isT);
1050
+ }
1051
+
1052
+ // 0xd8..0xef # one-octet compact long (-x8 to xf, xe0 is 0)
1053
+ public long get_long_mx8()
1054
+ {
1055
+ return -0x8L;
1056
+ }
1057
+
1058
+ public long get_long_xf()
1059
+ {
1060
+ return 0xfL;
1061
+ }
1062
+
1063
+ public void set_long_mx8(long long1)
1064
+ {
1065
+ boolean isT = long1 == -0x8L;
1066
+ printAssert("set_long_mx8", isT);
1067
+ }
1068
+
1069
+ public void set_long_xf(long long1)
1070
+ {
1071
+ boolean isT = long1 == 0xfL;
1072
+ printAssert("set_long_xf", isT);
1073
+ }
1074
+
1075
+ // 0xf0..0xff # two-octet compact long (-x800 to x7ff, xf8 is 0)
1076
+ public long get_long_mx9()
1077
+ {
1078
+ return -0x9L;
1079
+ }
1080
+
1081
+ public long get_long_x10()
1082
+ {
1083
+ return 0x10L;
1084
+ }
1085
+
1086
+ public long get_long_mx800()
1087
+ {
1088
+ return -0x800L;
1089
+ }
1090
+
1091
+ public long get_long_x7ff()
1092
+ {
1093
+ return 0x7ffL;
1094
+ }
1095
+
1096
+ public void set_long_mx9(long long1)
1097
+ {
1098
+ boolean isT = long1 == -0x9L;
1099
+ printAssert("set_long_mx9", isT);
1100
+ }
1101
+
1102
+ public void set_long_x10(long long1)
1103
+ {
1104
+ boolean isT = long1 == 0x10L;
1105
+ printAssert("set_long_x10", isT);
1106
+ }
1107
+
1108
+ public void set_long_mx800(long long1)
1109
+ {
1110
+ boolean isT = long1 == -0x800L;
1111
+ printAssert("set_long_mx800", isT);
1112
+ }
1113
+
1114
+ public void set_long_x7ff(long long1)
1115
+ {
1116
+ boolean isT = long1 == 0x7ffL;
1117
+ printAssert("set_long_x7ff", isT);
1118
+ }
1119
+
1120
+ private void printAssert(String meth, boolean isT)
1121
+ {
1122
+ System.out.println((isT ? "." : "**********fail") + " " + meth);
1123
+ }
1124
+
1125
+ }