random = new Random();
}
public void testDocImportUnExistingPropertyDefinition() throws Exception
{
InvocationContext context = new InvocationContext();
try
{
context.put(ContentImporter.RESPECT_PROPERTY_DEFINITIONS_CONSTRAINTS, true);
((ExtendedSession)session)
.importXML(root.getPath(), new ByteArrayInputStream(docView2.getBytes()), 0, context);
session.save();
fail();
}
catch (RepositoryException e)
{
// ok
}
try
{
context.put(ContentImporter.RESPECT_PROPERTY_DEFINITIONS_CONSTRAINTS, false);
((ExtendedSession)session)
.importXML(root.getPath(), new ByteArrayInputStream(docView2.getBytes()), 0, context);
session.save();
}
catch (RepositoryException e)