PublishQosServer publishQosServer = new PublishQosServer(glob, xml, true); // true prevents new timestamp
MsgUnit msgUnit = new MsgUnit(publishKey.getData(), "HO".getBytes(), publishQosServer.getData());
StorageId storageId = new StorageId(glob, "mystore", "someid");
MsgUnitWrapper msgUnitWrapper = new MsgUnitWrapper(glob, msgUnit, storageId);
I_EntryFactory factory = glob.getEntryFactory(); // storageId.getStrippedId()
/* MsgUnitWrapper.getOwnerCache() fails with this test as RequestBroker is unknown
msgUnitWrapper.incrementReferenceCounter(4);
assertEquals("", 4, msgUnitWrapper.getReferenceCounter());
msgUnitWrapper.incrementReferenceCounter(-4);
assertEquals("", 0, msgUnitWrapper.getReferenceCounter());
*/
int priority = msgUnitWrapper.getPriority();
long uniqueId = msgUnitWrapper.getUniqueId();
String type = msgUnitWrapper.getEmbeddedType();
boolean persistent = msgUnitWrapper.isPersistent();
long sizeInBytes = msgUnitWrapper.getSizeInBytes();
byte[] blob = factory.toBlob(msgUnitWrapper);
MsgUnitWrapper newWrapper = (MsgUnitWrapper)factory.createEntry(priority,
uniqueId, type, persistent, sizeInBytes, new ByteArrayInputStream(blob), storageId);
assertEquals("", msgUnitWrapper.getPriority(), newWrapper.getPriority());
assertEquals("", msgUnitWrapper.getReferenceCounter(), newWrapper.getReferenceCounter()); // A reference counter is reset to 0 when loaded from persistence
assertEquals("", msgUnitWrapper.isExpired(), newWrapper.isExpired());