assertNull(
Value.getSingleValueString(doc, SpiConstants.PROPNAME_LASTMODIFIED));
}
public void testAddFile() throws Exception {
Document doc = new FileDocument(foo, makeContext(false, true), root);
String docId =
Value.getSingleValueString(doc, SpiConstants.PROPNAME_DOCID);
assertEquals(foo.getPath(), docId);
assertEquals(foo.getDisplayUrl(), Value.getSingleValueString(doc,
SpiConstants.PROPNAME_DISPLAYURL));
assertEquals("text/html", Value.getSingleValueString(doc,
SpiConstants.PROPNAME_MIMETYPE));
// Don't advertise the CONTENT property, but should be able to fetch it.
assertFalse(doc.getPropertyNames().contains(SpiConstants.PROPNAME_CONTENT));
assertEquals("contents of foo", getDocumentContents(doc));
Calendar lastModified = Value.iso8601ToCalendar(
Value.getSingleValueString(doc, SpiConstants.PROPNAME_LASTMODIFIED));
assertEquals(LAST_MODIFIED.getTimeInMillis(),
lastModified.getTimeInMillis());
assertNotNull(doc.findProperty(SpiConstants.PROPNAME_ISPUBLIC));
assertEquals(Boolean.TRUE.toString(),
Value.getSingleValueString(doc, SpiConstants.PROPNAME_ISPUBLIC));
assertNull(doc.findProperty(SpiConstants.PROPNAME_ACLUSERS));
assertNull(doc.findProperty(SpiConstants.PROPNAME_ACLGROUPS));
assertNull(doc.findProperty(SpiConstants.PROPNAME_ACLDENYUSERS));
assertNull(doc.findProperty(SpiConstants.PROPNAME_ACLDENYGROUPS));
}