Search in sources :

Example 1 with GetAllConfigResponse

use of com.zimbra.soap.admin.message.GetAllConfigResponse in project zm-mailbox by Zimbra.

the class GetAllConfigTest method unmarshallGetAllConfigResponseTest.

@Test
public void unmarshallGetAllConfigResponseTest() throws Exception {
    InputStream is = getClass().getResourceAsStream("GetAllConfigResponse.xml");
    Element elem = Element.parseXML(is);
    List<KeyValuePair> kvps = elem.listKeyValuePairs();
    is.close();
    is = getClass().getResourceAsStream("GetAllConfigResponse.xml");
    GetAllConfigResponse resp = (GetAllConfigResponse) unmarshaller.unmarshal(is);
    Assert.assertNotNull("Response", resp);
    List<Attr> attrs = resp.getAttrs();
    LOG.info("unmarshallGetAllConfigResponseTest:KVPS from elem=" + kvps.size() + " from jaxb=" + attrs.size());
    Assert.assertTrue("Have some attrs", attrs.size() > 20);
    Assert.assertEquals("Number of attrs from elem and from jaxb agree", kvps.size(), attrs.size());
}
Also used : KeyValuePair(com.zimbra.common.soap.Element.KeyValuePair) GetAllConfigResponse(com.zimbra.soap.admin.message.GetAllConfigResponse) InputStream(java.io.InputStream) Element(com.zimbra.common.soap.Element) Attr(com.zimbra.soap.admin.type.Attr) Test(org.junit.Test)

Aggregations

Element (com.zimbra.common.soap.Element)1 KeyValuePair (com.zimbra.common.soap.Element.KeyValuePair)1 GetAllConfigResponse (com.zimbra.soap.admin.message.GetAllConfigResponse)1 Attr (com.zimbra.soap.admin.type.Attr)1 InputStream (java.io.InputStream)1 Test (org.junit.Test)1