@Test public void unlocksOnActionExecutedEvent() { this.listener.onEvent(new ActionExecutedEvent("save"), this.doc, null); Mockito.verify(this.lockManager).unlock(this.docRef); }
@Override public void onEvent(Event event, Object source, Object data) { if (event == null || source == null || !(event instanceof ActionExecutionEvent)) { return; } String name = ((ActionExecutionEvent) event).getActionName(); if (!SUPPORTED_EVENTS.contains(name)) { return; } if (event instanceof ActionExecutingEvent) { this.lockManager.lock(((XWikiDocument) source).getDocumentReference()); } else if (event instanceof ActionExecutedEvent) { this.lockManager.unlock(((XWikiDocument) source).getDocumentReference()); } }
LockingListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (event == null || source == null || !(event instanceof ActionExecutionEvent)) { return; } String name = ((ActionExecutionEvent) event).getActionName(); if (!SUPPORTED_EVENTS.contains(name)) { return; } if (event instanceof ActionExecutingEvent) { this.lockManager.lock(((XWikiDocument) source).getDocumentReference()); } else if (event instanceof ActionExecutedEvent) { this.lockManager.unlock(((XWikiDocument) source).getDocumentReference()); } } }
LockingListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (event == null || source == null || !(event instanceof ActionExecutionEvent)) { return; } String name = ((ActionExecutionEvent) event).getActionName(); if (!SUPPORTED_EVENTS.contains(name)) { return; } if (event instanceof ActionExecutingEvent) { this.lockManager.lock(((XWikiDocument) source).getDocumentReference()); } else if (event instanceof ActionExecutedEvent) { this.lockManager.unlock(((XWikiDocument) source).getDocumentReference()); } } LockingListener(); }
LockingListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (event == null || source == null || !(event instanceof ActionExecutionEvent)) { return; } String name = ((ActionExecutionEvent) event).getActionName(); if (!SUPPORTED_EVENTS.contains(name)) { return; } if (event instanceof ActionExecutingEvent) { this.lockManager.lock(((XWikiDocument) source).getDocumentReference()); } else if (event instanceof ActionExecutedEvent) { this.lockManager.unlock(((XWikiDocument) source).getDocumentReference()); } } LockingListener(); @Override void onEvent(Event event, Object source, Object data); }
LockingListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (event == null || source == null || !(event instanceof ActionExecutionEvent)) { return; } String name = ((ActionExecutionEvent) event).getActionName(); if (!SUPPORTED_EVENTS.contains(name)) { return; } if (event instanceof ActionExecutingEvent) { this.lockManager.lock(((XWikiDocument) source).getDocumentReference()); } else if (event instanceof ActionExecutedEvent) { this.lockManager.unlock(((XWikiDocument) source).getDocumentReference()); } } LockingListener(); @Override void onEvent(Event event, Object source, Object data);  }