1 package org
.lwes
.serializer
;
3 import static org
.junit
.Assert
.assertEquals
;
4 import static org
.junit
.Assert
.assertNotNull
;
11 public class SerializerTest
{
14 public void testSerializeStringArray() {
15 String
[] array
= new String
[]{
16 "test", "one", "two", "three"
19 byte[] bytes
= new byte[30];
22 int numbytes
= Serializer
.serializeStringArray(array
,
26 assertEquals("Number of bytes serialized incorrect", 25, numbytes
);
27 DeserializerState state
= new DeserializerState();
28 String
[] a
= Deserializer
.deserializeStringArray(state
, bytes
, encoding
);
30 assertEquals("wrong number of elements", 4, a
.length
);
31 for (int i
= 0; i
< a
.length
; i
++) {
32 assertEquals("Element "+i
+" incorrect", array
[i
], a
[i
]);