Search in sources :

Example 11 with UpdatedLockStatusEvent

use of org.uberfire.client.mvp.UpdatedLockStatusEvent in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterTest method testOnUpdatedLockStatusEvent_NotLocked.

@Test
public void testOnUpdatedLockStatusEvent_NotLocked() {
    final UpdatedLockStatusEvent event = mock(UpdatedLockStatusEvent.class);
    when(event.getFile()).thenReturn(dtPath);
    dtPresenter.onUpdatedLockStatusEvent(event);
    verify(dtPresenter).refreshColumnsPage();
    verify(dtPresenter).refreshMenus();
    assertEquals(NOBODY, dtPresenter.getAccess().getLock());
}
Also used : UpdatedLockStatusEvent(org.uberfire.client.mvp.UpdatedLockStatusEvent) Test(org.junit.Test)

Example 12 with UpdatedLockStatusEvent

use of org.uberfire.client.mvp.UpdatedLockStatusEvent in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterTest method testOnUpdatedLockStatusEvent_LockedByOtherUser.

@Test
public void testOnUpdatedLockStatusEvent_LockedByOtherUser() {
    final UpdatedLockStatusEvent event = mock(UpdatedLockStatusEvent.class);
    when(event.getFile()).thenReturn(dtPath);
    when(event.isLockedByCurrentUser()).thenReturn(false);
    when(event.isLocked()).thenReturn(true);
    dtPresenter.onUpdatedLockStatusEvent(event);
    verify(dtPresenter).refreshColumnsPage();
    verify(dtPresenter).refreshMenus();
    assertEquals(OTHER_USER, dtPresenter.getAccess().getLock());
}
Also used : UpdatedLockStatusEvent(org.uberfire.client.mvp.UpdatedLockStatusEvent) Test(org.junit.Test)

Example 13 with UpdatedLockStatusEvent

use of org.uberfire.client.mvp.UpdatedLockStatusEvent in project drools-wb by kiegroup.

the class GuidedDecisionTablePresenterTest method testOnUpdatedLockStatusEvent_NullFile.

@Test
public void testOnUpdatedLockStatusEvent_NullFile() {
    final UpdatedLockStatusEvent event = mock(UpdatedLockStatusEvent.class);
    dtPresenter.onUpdatedLockStatusEvent(event);
}
Also used : UpdatedLockStatusEvent(org.uberfire.client.mvp.UpdatedLockStatusEvent) Test(org.junit.Test)

Aggregations

UpdatedLockStatusEvent (org.uberfire.client.mvp.UpdatedLockStatusEvent)13 Test (org.junit.Test)12 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)6 ObservablePath (org.uberfire.backend.vfs.ObservablePath)2