public void testConcurrentModification() throws Exception {
String pubId = "test";
String area = "authoring";
Session lenyaSession = login("lenya");
DocumentFactory lenyaFactory = DocumentUtil.createDocumentFactory(getManager(), lenyaSession);
Publication lenyaPub = lenyaFactory.getPublication(pubId);
SiteStructure lenyaSite = lenyaPub.getArea(area).getSite();
lenyaSite.getRepositoryNode().lock();
Session aliceSession = login("alice");
DocumentFactory aliceFactory = DocumentUtil.createDocumentFactory(getManager(), aliceSession);
Publication alicePub = aliceFactory.getPublication(pubId);
SiteStructure aliceSite = alicePub.getArea(area).getSite();
aliceSite.getRepositoryNode().lock();
SiteNode lenyaNode = lenyaSite.getNodes()[1];
lenyaNode.setVisible(!lenyaNode.isVisible());
lenyaSession.commit();
SiteNode aliceNode = aliceSite.getNodes()[2];
aliceNode.setVisible(!aliceNode.isVisible());
try {
aliceSession.commit();
assertTrue("No exception raised", false);
}
catch (Exception ignore) {
}