/**
* Tests parsing of a file created by 7Zip.
*/
public void testFrom7ZipFile() throws Exception
{
Binary zipBin = Binary.parse("504b03040a0000000000756f44380000" +
"00000000000000000000090000007365" +
"696e66656c642f504b03040a00000000" +
"00756f44380000000000000000000000" +
"00140000007365696e66656c642f6368" +
"61726163746572732f504b03040a0000" +
"000000656f4438d49ad5361300000013" +
"0000001e0000007365696e66656c642f" +
"636861726163746572732f67656f7267" +
"652e747874436f6e74656e7473206f66" +
"2067656f7267652e504b03040a000000" +
"0000676f4438f96918f2120000001200" +
"00001d0000007365696e66656c642f63" +
"6861726163746572732f6a657272792e" +
"747874436f6e74656e7473206f66206a" +
"657272792e504b010214000a00000000" +
"00756f44380000000000000000000000" +
"00090000000000000000001000000000" +
"0000007365696e66656c642f504b0102" +
"14000a0000000000756f443800000000" +
"00000000000000001400000000000000" +
"000010000000270000007365696e6665" +
"6c642f636861726163746572732f504b" +
"010214000a0000000000656f4438d49a" +
"d53613000000130000001e0000000000" +
"0000000020000000590000007365696e" +
"66656c642f636861726163746572732f" +
"67656f7267652e747874504b01021400" +
"0a0000000000676f4438f96918f21200" +
"0000120000001d000000000000000000" +
"20000000a80000007365696e66656c64" +
"2f636861726163746572732f6a657272" +
"792e747874504b050600000000040004" +
"0010010000f500000000000a");
TransferObject root = m_parser.parse(new ObjectInput(zipBin), m_message);
List filesList = (List)root.getValue("files");
assertEquals("Zip_AllMapped", root.getClassName());
assertNotNull(filesList);
assertEquals(4, filesList.size());
TransferObject file;
file = (TransferObject)filesList.get(0);
assertEquals("seinfeld" + SysUtil.FILE_SEP, file.getValue("fileName"));
assertTrue(((Boolean)file.getValue("isDirectory")).booleanValue());
assertEquals(0, ((Long)file.getValue("fileSize")).longValue());
assertNull(file.getValue("data"));
file = (TransferObject)filesList.get(1);
assertEquals("seinfeld" + SysUtil.FILE_SEP + "characters" + SysUtil.FILE_SEP, file.getValue("fileName"));
assertTrue(((Boolean)file.getValue("isDirectory")).booleanValue());
assertEquals(0, ((Long)file.getValue("fileSize")).longValue());
assertNull(file.getValue("data"));
file = (TransferObject)filesList.get(2);
assertEquals("seinfeld" + SysUtil.FILE_SEP + "characters" + SysUtil.FILE_SEP + "george.txt", file.getValue("fileName"));
assertFalse(((Boolean)file.getValue("isDirectory")).booleanValue());
assertEquals(19, ((Long)file.getValue("fileSize")).longValue());
assertEquals(new Binary("Contents of george.".getBytes("UTF-8")), file.getValue("data"));
file = (TransferObject)filesList.get(3);
assertEquals("seinfeld" + SysUtil.FILE_SEP + "characters" + SysUtil.FILE_SEP + "jerry.txt", file.getValue("fileName"));
assertFalse(((Boolean)file.getValue("isDirectory")).booleanValue());
assertEquals(18, ((Long)file.getValue("fileSize")).longValue());
assertEquals(new Binary("Contents of jerry.".getBytes("UTF-8")), file.getValue("data"));
}