| 7 | import junit.framework.TestCase; |
| 8 | |
| 9 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected