File: MarshallTestCase.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (559 lines) | stat: -rw-r--r-- 24,463 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
/**
 * MarshallTestCase.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.2RC2 Feb 06, 2005 (12:14:42 EST) WSDL2Java emitter.
 */
package test.wsdl.marshall;

import java.math.BigInteger;
import java.util.Iterator;
import javax.xml.namespace.QName;
import org.apache.axis.Message;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.SOAPBody;

public class MarshallTestCase extends junit.framework.TestCase {

    private static final String DIMS = "[3]";

    public MarshallTestCase(java.lang.String name) {
        super(name);
    }

    public void testMarshallPortWSDL() throws Exception {
        javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory
                .newInstance();
        java.net.URL url = new java.net.URL(
                new test.wsdl.marshall.MarshallLocator()
                        .getMarshallPortAddress()
                        + "?WSDL");
        javax.xml.rpc.Service service = serviceFactory.createService(url,
                new test.wsdl.marshall.MarshallLocator().getServiceName());
        assertTrue(service != null);
    }

    public void test1MarshallPortMyBeanArray() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        test.wsdl.marshall.types.MyBean[] value = null;
        value = binding.myBeanArray(new test.wsdl.marshall.types.MyBean[0]);
        // TBD - validate results
    }

    public void test2MarshallPortMyBeanMultiArray() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        test.wsdl.marshall.types.MyBean[][] value = null;
        value = binding
                .myBeanMultiArray(new test.wsdl.marshall.types.MyBean[0][0]);
        // TBD - validate results
    }

    public void test3MarshallPortMyBean() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        test.wsdl.marshall.types.MyBean value = null;
        value = binding.myBean(new test.wsdl.marshall.types.MyBean());
        // TBD - validate results
    }

    public void test4MarshallPortArrayOfSoapEncString() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        String[] value = new String[] { "1", "2", "", null, "5" };
        String[] ret = null;
        ret = binding.arrayOfSoapEncString(value);
        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfSoapEncStringResponse");
        QName returnQName = new QName("return");
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        MessageElement response = body.getChildElement(responseQName);
        MessageElement returnE = response.getChildElement(returnQName);
        String arrayType = returnE.getAttributeNS(
                "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
        assertEquals("wrong array type", "soapenc:string[5]", arrayType);
        // TBD - validate results
    }

    public void test5MarshallPortArrayOfXsdString() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        String[] value = new String[] { "1", "2", "", null, "5" };
        String[] ret = null;
        ret = binding.arrayOfXsdString(value);
        // TBD - validate results
        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfXsdStringResponse");
        QName returnQName = new QName("return");
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        MessageElement response = body.getChildElement(responseQName);
        MessageElement returnE = response.getChildElement(returnQName);
        String arrayType = returnE.getAttributeNS(
                "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
        assertEquals("wrong array type", "xsd:string[5]", arrayType);
    }

    public void test6MarshallPortArrayOfbase64Binary() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        byte[][] value = null;
        value = binding.arrayOfbase64Binary(getBiDimensionnalByteArray());
        // TBD - validate results
        checkArrayReturnValues(value);
        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfbase64BinaryResponse");
        String innerTypeString = "xsd:base64Binary";
        String arrayTypeString = innerTypeString + DIMS;
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        checkReturnMessage(body, responseQName, arrayTypeString,
                innerTypeString);
    }

    public void test7MarshallPortArrayOfhexBinary() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        byte[][] value = null;
        value = binding.arrayOfhexBinary(getBiDimensionnalByteArray());
        // TBD - validate results
        checkArrayReturnValues(value);
        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfhexBinaryResponse");
        String innerTypeString = "xsd:hexBinary";
        String arrayTypeString = innerTypeString + DIMS;
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        checkReturnMessage(body, responseQName, arrayTypeString,
                innerTypeString);
    }

    public void test8MarshallPortArrayOfsoapencbase64() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        byte[][] value = null;
        value = binding.arrayOfsoapencbase64(getBiDimensionnalByteArray());
        // TBD - validate results
        checkArrayReturnValues(value);
        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfsoapencbase64Response");
        String innerTypeString = "soapenc:base64";
        String arrayTypeString = innerTypeString + DIMS;
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        checkReturnMessage(body, responseQName, arrayTypeString,
                innerTypeString);
    }

    public void test9MarshallPortArrayOfbase64BinaryUnbounded()
            throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        byte[][] value = null;
        value = binding
                .arrayOfbase64BinaryUnbounded(getBiDimensionnalByteArray());
        // TBD - validate results
        checkArrayReturnValues(value);

        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfbase64BinaryUnboundedResponse");
        String innerTypeString = "xsd:base64Binary";
        String arrayTypeString = innerTypeString + DIMS;
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        checkReturnMessage(body, responseQName, arrayTypeString,
                innerTypeString);
    }

    public void test10MarshallPortArrayOfhexBinaryUnbounded() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        byte[][] value = null;
        value = binding.arrayOfhexBinaryUnbounded(getBiDimensionnalByteArray());
        // TBD - validate results
        checkArrayReturnValues(value);

        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfhexBinaryUnboundedResponse");
        String innerTypeString = "xsd:hexBinary";
        String arrayTypeString = innerTypeString + DIMS;
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        checkReturnMessage(body, responseQName, arrayTypeString,
                innerTypeString);
    }

    public void test11MarshallPortArrayOfsoapencbase64Unbounded()
            throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        byte[][] value = null;
        value = binding
                .arrayOfsoapencbase64Unbounded(getBiDimensionnalByteArray());
        // TBD - validate results
        checkArrayReturnValues(value);

        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfsoapencbase64UnboundedResponse");
        String innerTypeString = "soapenc:base64";
        String arrayTypeString = innerTypeString + DIMS;
        Message m = binding._getCall().getResponseMessage();
        SOAPBody body = (SOAPBody) m.getSOAPBody();
        checkReturnMessage(body, responseQName, arrayTypeString,
                innerTypeString);
    }

    public void test12MarshallPortArrayOfArrayOfSoapEncString() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        String[] v1 = new String[] { "a1", "a2", "", null, "a5", null};
        String[] v2 = new String[] { "b1", "b2", "", null, "b5", null };
        String[] v3 = new String[] { "c1", "c2", "", null, "c5", null };
        String[][] value = new String[][] {v1, v2, v3};
        String[][] ret = null;
        ret = binding.arrayOfArrayOfSoapEncString(value);

        // print Array
        for(int i = 0; i < ret.length; i++) {
            System.out.print("[");
            for(int j = 0; j < ret[i].length; j++) {
                System.out.print("[" + ret[i][j] + "]");
            }
            System.out.println("]");
        }

        assertEquals("array size incorrect", value.length, ret.length);
        for(int i = 0; i < value.length; i++) {
            assertEquals("array size incorrect", value[i].length, ret[i].length);
            for(int j = 0; j < value[i].length; j++) {
                assertEquals("value not equals", value[i][j], ret[i][j]);
            }
        }

        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfArrayOfSoapEncStringResponse");
        QName returnQName = new QName("return");
        Message m = binding._getCall().getResponseMessage();

        SOAPBody body = (SOAPBody) m.getSOAPBody();
        MessageElement response = body.getChildElement(responseQName);
        MessageElement returnE = response.getChildElement(returnQName);
        String arrayType = returnE.getAttributeNS(
                "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
        assertEquals("wrong array type", "soapenc:string[][3]", arrayType);


        for (Iterator it = returnE.getChildElements(returnQName); it.hasNext();) {
            returnE = (MessageElement) it.next();
            arrayType = returnE.getAttributeNS(
                    "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
            assertEquals("wrong array type", "soapenc:string[6]", arrayType);


            for (Iterator it2 = returnE.getChildElements(returnQName); it2.hasNext();) {
                returnE = (MessageElement) it2.next();
                String xsiType = returnE.getAttributeNS(
                        "http://www.w3.org/2001/XMLSchema-instance", "type");
                assertEquals("wrong xsi type", "soapenc:string", xsiType);


            }
        }
        // TBD - validate results
    }

    public void test13MarshallPortArrayOfArrayOfinteger() throws Exception {
        test.wsdl.marshall.MarshallBindingStub binding;
        try {
            binding = (test.wsdl.marshall.MarshallBindingStub) new test.wsdl.marshall.MarshallLocator()
                    .getMarshallPort();
        } catch (javax.xml.rpc.ServiceException jre) {
            if (jre.getLinkedCause() != null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError(
                    "JAX-RPC ServiceException caught: " + jre);
        }
        assertNotNull("binding is null", binding);
        // Time out after a minute
        binding.setTimeout(60000);
        // Test operation
        BigInteger[] v1 = new BigInteger[] { new BigInteger("-3254687"), new BigInteger("0"), new BigInteger("3254687"), null};
        BigInteger[] v2 = new BigInteger[] { new BigInteger("-3254688"), new BigInteger("0"), new BigInteger("3254688"), null};
        BigInteger[] v3 = new BigInteger[] { new BigInteger("-3254689"), new BigInteger("0"), new BigInteger("3254689"), null};
        BigInteger[][] value = new BigInteger[][] {v1, v2, v3};
        BigInteger[][] ret = null;
        ret = binding.arrayOfArrayOfinteger(value);

        // print Array
        for(int i = 0; i < ret.length; i++) {
            System.out.print("[");
            for(int j = 0; j < ret[i].length; j++) {
                System.out.print("[" + ret[i][j] + "]");
            }
            System.out.println("]");
        }

        assertEquals("array size incorrect", value.length, ret.length);
        for(int i = 0; i < value.length; i++) {
            assertEquals("array size incorrect", value[i].length, ret[i].length);
            for(int j = 0; j < value[i].length; j++) {
                assertEquals("value not equals", value[i][j], ret[i][j]);
            }
        }

        QName responseQName = new QName("http://marshall.wsdl.test",
                "ArrayOfArrayOfintegerResponse");
        QName returnQName = new QName("return");
        Message m = binding._getCall().getResponseMessage();

        SOAPBody body = (SOAPBody) m.getSOAPBody();
        MessageElement response = body.getChildElement(responseQName);
        MessageElement returnE = response.getChildElement(returnQName);
        String arrayType = returnE.getAttributeNS(
                "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
        assertEquals("wrong array type", "xsd:integer[][3]", arrayType);


        for (Iterator it = returnE.getChildElements(returnQName); it.hasNext();) {
            returnE = (MessageElement) it.next();
            arrayType = returnE.getAttributeNS(
                    "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
            assertEquals("wrong array type", "xsd:integer[4]", arrayType);


            for (Iterator it2 = returnE.getChildElements(returnQName); it2.hasNext();) {
                returnE = (MessageElement) it2.next();
                // we have multiRef to follow here
                MessageElement real = returnE.getRealElement();
                String xsiType = real.getAttributeNS(
                        "http://www.w3.org/2001/XMLSchema-instance", "type");
                assertEquals("wrong xsi type", "xsd:integer", xsiType);


            }
        }
        // TBD - validate results
    }

    /**
     * @param m
     */
    private void printMessage(Message m) throws Exception {
        System.out.println();
        m.writeTo(System.out);
        System.out.println();
    }

    /**
     * @param responseQName
     * @param arrayTypeString
     * @param innerTypeString
     */
    private void checkReturnMessage(SOAPBody body, QName responseQName,
            String arrayTypeString, String innerTypeString) {
        // Message should looks like this :
        // ns:<methodName>Response
        // return @soapenc:arrayType
        // return @xsi:type
        QName returnQName = new QName("return");
        MessageElement response = body.getChildElement(responseQName);
        // check arrayType attribute
        MessageElement returnE = response.getChildElement(returnQName);
        String arrayType = returnE.getAttributeNS(
                "http://schemas.xmlsoap.org/soap/encoding/", "arrayType");
        assertEquals("wrong array type", arrayTypeString, arrayType);
        for (Iterator i = returnE.getChildElements(returnQName); i.hasNext();) {
            MessageElement ret = (MessageElement) i.next();
            String xsiType = ret.getAttributeNS(
                    "http://www.w3.org/2001/XMLSchema-instance", "type");
            assertNotNull("should have an xsi:type attribute", xsiType);
            assertEquals("wrong xsi:type", innerTypeString, xsiType);
        }
    }

    /**
     * @param value
     */
    private void checkArrayReturnValues(byte[][] value) {
        assertEquals("wrong array length", 3, value.length);
        assertEquals("wrong subarray length", 3, value[0].length);
        assertEquals("wrong subarray length", 3, value[1].length);
        assertEquals("wrong subarray length", 3, value[2].length);
        assertEquals("wrong value[0][0]", -127, value[0][0]);
        assertEquals("wrong value[0][1]", 0, value[0][1]);
        assertEquals("wrong value[0][2]", 127, value[0][2]);
        assertEquals("wrong value[1][0]", -127, value[1][0]);
        assertEquals("wrong value[1][1]", 0, value[1][1]);
        assertEquals("wrong value[1][2]", 127, value[1][2]);
        assertEquals("wrong value[2][0]", -127, value[2][0]);
        assertEquals("wrong value[2][1]", 0, value[2][1]);
        assertEquals("wrong value[2][2]", 127, value[2][2]);
    }

    /**
     * @return
     */
    private byte[][] getBiDimensionnalByteArray() {
        byte[][] array = new byte[3][];
        array[0] = new byte[3];
        array[1] = new byte[3];
        array[2] = new byte[3];
        array[0][0] = -127;
        array[0][1] = 0;
        array[0][2] = 127;
        array[1][0] = -127;
        array[1][1] = 0;
        array[1][2] = 127;
        array[2][0] = -127;
        array[2][1] = 0;
        array[2][2] = 127;
        return array;
    }

}