Exemplo n.º 1
0
  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()));
  }
Exemplo n.º 2
0
 private PayloadArrayWrapper createWrapper() {
   PayloadArrayWrapper wrapper = new PayloadArrayWrapper();
   wrapper.setPayloadDescription("描述文件描述。wjl 测试");
   wrapper.setPayloadDisplayName("Pekall MDM Profile");
   wrapper.setPayloadIdentifier("com.pekall.profile");
   wrapper.setPayloadOrganization("Pekall Capital");
   wrapper.setPayloadType("Configuration");
   wrapper.setPayloadUUID("2ED160FF-4B6C-47DD-8105-769231367D2A");
   wrapper.setPayloadVersion(1);
   wrapper.setPayloadRemovalDisallowed(true);
   return wrapper;
 }
Exemplo n.º 3
0
  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());
  }
Exemplo n.º 4
0
 private PayloadArrayWrapper createProfile() {
   PayloadArrayWrapper wrapper = createWrapper();
   wrapper.addPayLoadContent(getPolicy());
   return wrapper;
 }
Exemplo n.º 5
0
  public void testTwoWay() throws Exception {
    PayloadXmlMsgParser parser = new PayloadXmlMsgParser(TEST_XML);
    PayloadArrayWrapper profile = (PayloadArrayWrapper) parser.getPayloadDescriptor();

    assertEquals(TEST_XML, profile.toXml());
  }
Exemplo n.º 6
0
 public void testGenXml() throws Exception {
   PayloadArrayWrapper profile = createProfile();
   String xml = profile.toXml();
   PlistDebug.logTest(xml);
   assertEquals(xml, TEST_XML);
 }