public void testParseXml() throws Exception { PayloadXmlMsgParser parser = new PayloadXmlMsgParser(TEST_XML); PayloadArrayWrapper profile = (PayloadArrayWrapper) parser.getPayloadDescriptor(); PlistDebug.logTest(profile.toString()); assertEquals(profile, createProfile()); assertEquals(parser.getPayload(PayloadBase.PAYLOAD_TYPE_MEMORY_POLICY), getPolicy()); assertTrue( ObjectComparator.equals( parser.getPayload(PayloadBase.PAYLOAD_TYPE_MEMORY_POLICY), getPolicy())); }
public void testXml2Bean() throws Exception { NSDictionary dictionary = (NSDictionary) PlistXmlParser.fromXml(EnrollProfileData.ENROLL_PROFILE); PayloadArrayWrapper wrapper = (PayloadArrayWrapper) PlistBeanConverter.createBeanFromNdict(dictionary, PayloadArrayWrapper.class); assertEquals(wrapper.getPayloadDescription(), "描述文件描述。wjl 测试"); assertEquals(wrapper.getPayloadDisplayName(), "Pekall MDM Profile"); assertEquals(wrapper.getPayloadIdentifier(), "com.pekall.profile"); assertEquals(wrapper.getPayloadOrganization(), "Pekall Capital"); assertEquals(wrapper.getPayloadType(), "Configuration"); assertEquals(wrapper.getPayloadUUID(), "2ED160FF-4B6C-47DD-8105-769231367D2A"); assertEquals(wrapper.getPayloadVersion(), 1); assertEquals(wrapper.getPayloadContent().size(), 7); PlistDebug.logTest("Bean: " + wrapper.toString()); }