MCPcopy Create free account
hub / github.com/WinVector/Logistic / TestSerialUtils

Class TestSerialUtils

test/com/winvector/util/TestSerialUtils.java:9–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7import junit.framework.TestCase;
8
9public class TestSerialUtils extends TestCase {
10 public void testBase64() throws IOException, ClassNotFoundException {
11 byte[] b = new byte[256];
12 for(int i=0;i<b.length;++i) {
13 b[i] = (byte)i;
14 }
15 final String enc = SerialUtils.serializableToString(b);
16 assertNotNull(enc);
17 for(int i=0;i<enc.length();++i) {
18 assertFalse(Character.isWhitespace(enc.charAt(i)));
19 }
20 final byte[] dec = (byte[])SerialUtils.readSerialiazlabeFromString(enc);
21 assertNotNull(dec);
22 assertEquals(b.length,dec.length);
23 for(int i=0;i<b.length;++i) {
24 assertEquals(b[i],dec[i]);
25 }
26 }
27}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected