public void testSetWeakReferenceValue() throws RepositoryException {
NodeId nid = getNodeId(testPath);
NodeInfo nInfo = rs.getNodeInfo(si, nid);
if (!Arrays.asList(nInfo.getMixins()).contains(NameConstants.MIX_REFERENCEABLE)) {
Batch b = rs.createBatch(si, nid);
b.setMixins(nid, new Name[] {NameConstants.MIX_REFERENCEABLE});
rs.submit(b);
}
String ref = rs.getNodeInfo(si, nid).getId().getUniqueID();
Name propName = resolver.getQName("weakRefProp");
QValue v = rs.getQValueFactory().create(ref, PropertyType.WEAKREFERENCE);
Batch b = rs.createBatch(si, nid);
b.addProperty(nid, propName, v);
rs.submit(b);
PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
assertFalse(pi.isMultiValued());
assertEquals(v, pi.getValues()[0]);