Search in sources :

Example 6 with GetInfoResponse

use of com.zimbra.soap.account.message.GetInfoResponse in project zm-mailbox by Zimbra.

the class JaxbToElementTest method elementToJaxbUsingDom4jTest.

/**
     * Using Dom4j seems problematic - hence why elementToJaxbUsingDom4j is deprecated.  e.g. Seen this from
     * Jenkins, so now disabling the test - the underlying method is deprecated anyway.
     * com.zimbra.common.service.ServiceException: system failure: Unable to unmarshal response for GetInfoResponse
     * <pre>
ExceptionId:main:1337887540849:9bb07215a97a1378
Code:service.FAILURE
    at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:258)
    at com.zimbra.soap.JaxbUtil.elementToJaxbUsingDom4j(JaxbUtil.java:1153)
    at com.zimbra.soap.account.JaxbToElementTest.elementToJaxbUsingDom4jTest(JaxbToElementTest.java:244)
Caused by: javax.xml.bind.UnmarshalException: Namespace URIs and local names to the unmarshaller needs to be interned.
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
    at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:118)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1063)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
    at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:150)
    at org.dom4j.io.SAXWriter.startElement(SAXWriter.java:628)
    at org.dom4j.io.SAXWriter.write(SAXWriter.java:579)
    at org.dom4j.io.SAXWriter.writeContent(SAXWriter.java:475)
    at org.dom4j.io.SAXWriter.write(SAXWriter.java:176)
    at org.dom4j.io.SAXWriter.parse(SAXWriter.java:457)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:218)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:190)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:120)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:103)
    at com.zimbra.soap.JaxbUtil.elementToJaxbUsingDom4j(JaxbUtil.java:1151)
     * </pre>
     */
@SuppressWarnings("deprecation")
public // Disabled @Test
void elementToJaxbUsingDom4jTest() throws Exception {
    for (int cnt = 1; cnt <= iterationNum; cnt++) {
        GetInfoResponse getInfoResp = JaxbUtil.elementToJaxbUsingDom4j(getInfoRespElem);
        Assert.assertEquals("Account name", "user1@tarka.local", getInfoResp.getAccountName());
    }
}
Also used : GetInfoResponse(com.zimbra.soap.account.message.GetInfoResponse)

Example 7 with GetInfoResponse

use of com.zimbra.soap.account.message.GetInfoResponse in project zm-mailbox by Zimbra.

the class JaxbToElementTest method elementToJaxbUsingByteArrayTest.

/**  Not much point in running a test of a deprecated method - left for future timing comparison purposes */
@SuppressWarnings("deprecation")
public // Disabled @Test
void elementToJaxbUsingByteArrayTest() throws Exception {
    for (int cnt = 1; cnt <= iterationNum; cnt++) {
        GetInfoResponse getInfoResp = JaxbUtil.elementToJaxbUsingByteArray(getInfoRespElem);
        Assert.assertEquals("Account name", "user1@tarka.local", getInfoResp.getAccountName());
    }
}
Also used : GetInfoResponse(com.zimbra.soap.account.message.GetInfoResponse)

Example 8 with GetInfoResponse

use of com.zimbra.soap.account.message.GetInfoResponse in project zm-mailbox by Zimbra.

the class ZMailbox method getAccountInfo.

public ZGetInfoResult getAccountInfo(boolean refresh) throws ServiceException {
    if (mGetInfoResult == null || refresh) {
        GetInfoRequest req = new GetInfoRequest(NOT_ZIMLETS);
        GetInfoResponse res = invokeJaxb(req);
        mGetInfoResult = new ZGetInfoResult(res);
    }
    return mGetInfoResult;
}
Also used : GetInfoResponse(com.zimbra.soap.account.message.GetInfoResponse) GetInfoRequest(com.zimbra.soap.account.message.GetInfoRequest)

Aggregations

GetInfoResponse (com.zimbra.soap.account.message.GetInfoResponse)8 Test (org.junit.Test)4 Element (com.zimbra.common.soap.Element)3 JSONElement (com.zimbra.common.soap.Element.JSONElement)3 XMLElement (com.zimbra.common.soap.Element.XMLElement)3 GetInfoRequest (com.zimbra.soap.account.message.GetInfoRequest)3 JAXBElement (javax.xml.bind.JAXBElement)3 SoapTransport (com.zimbra.common.soap.SoapTransport)2 Account (com.zimbra.cs.account.Account)2 SoapFaultException (com.zimbra.common.soap.SoapFaultException)1 Group (com.zimbra.cs.account.Group)1 DiscoverRightsInfo (com.zimbra.soap.account.type.DiscoverRightsInfo)1 DiscoverRightsTarget (com.zimbra.soap.account.type.DiscoverRightsTarget)1