use of com.zimbra.soap.mail.type.ActivityInfo in project zm-mailbox by Zimbra.
the class OctopusJaxbTest method toActivityInfo.
private static ActivityInfo toActivityInfo(String account, String op, long timestamp, String itemId, int version, String itemName, Map<String, String> args) {
ActivityInfo activity = ActivityInfo.fromOperationTimeStampItemId(op, timestamp, itemId);
if (version > 0)
activity.setVersion(version);
if (account != null)
activity.setEmail(account);
activity.setArgs(args);
checkActivityInfo(activity, "toActivityInfo result ");
return activity;
}
use of com.zimbra.soap.mail.type.ActivityInfo in project zm-mailbox by Zimbra.
the class OctopusJaxbTest method activityInfoForGetActivityStreamXml.
@Test
public void activityInfoForGetActivityStreamXml() throws Exception {
Map<String, String> args = Maps.newHashMap();
args.put("key1", "value1");
args.put("key2", "value2");
ActivityInfo ai = toActivityInfo("account", "op", 333L, "123-123-123:22", 44, "itemName", args);
Element notify = XMLElement.create(SoapProtocol.Soap12, "pink");
Element activityElem = JaxbUtil.addChildElementFromJaxb(notify, MailConstants.E_A, MailConstants.NAMESPACE_STR, ai);
ai = JaxbUtil.elementToJaxb(activityElem, ActivityInfo.class);
checkActivityInfo(ai, "XML round tripped ");
}
use of com.zimbra.soap.mail.type.ActivityInfo in project zm-mailbox by Zimbra.
the class OctopusJaxbTest method activityInfoForGetActivityStreamJSON.
@Test
public void activityInfoForGetActivityStreamJSON() throws Exception {
Map<String, String> args = Maps.newHashMap();
args.put("key1", "value1");
args.put("key2", "value2");
ActivityInfo ai = toActivityInfo("account", "op", 333L, "123-123-123:22", 44, "itemName", args);
Element notify = JSONElement.create(SoapProtocol.SoapJS, "pink");
Element activityElem = JaxbUtil.addChildElementFromJaxb(notify, MailConstants.E_A, MailConstants.NAMESPACE_STR, ai);
ai = JaxbUtil.elementToJaxb(activityElem, ActivityInfo.class);
checkActivityInfo(ai, "JSON round tripped ");
}
Aggregations