Search in sources :

Example 1 with UberfireDocksInteractionEvent

use of org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent in project kie-wb-common by kiegroup.

the class AuthoringWorkbenchDocksTest method projectExplorerExpandedEvent_DeselectedInteraction.

@Test
public void projectExplorerExpandedEvent_DeselectedInteraction() {
    final UberfireDocksInteractionEvent uberfireDocksInteractionEvent = createUberfireDocksInteractionEvent(authoringWorkbenchDocks.projectExplorerDock, UberfireDocksInteractionEvent.InteractionType.CLOSED);
    authoringWorkbenchDocks.projectExplorerExpandedEvent(uberfireDocksInteractionEvent);
    verify(authoringWorkbenchDocks).setProjectExplorerExpandedPreference(false);
}
Also used : UberfireDocksInteractionEvent(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent) Test(org.junit.Test)

Example 2 with UberfireDocksInteractionEvent

use of org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent in project kie-wb-common by kiegroup.

the class AuthoringWorkbenchDocksTest method projectExplorerExpandedEvent_SelectedInteraction.

@Test
public void projectExplorerExpandedEvent_SelectedInteraction() {
    final UberfireDocksInteractionEvent uberfireDocksInteractionEvent = createUberfireDocksInteractionEvent(authoringWorkbenchDocks.projectExplorerDock, UberfireDocksInteractionEvent.InteractionType.OPENED);
    authoringWorkbenchDocks.projectExplorerExpandedEvent(uberfireDocksInteractionEvent);
    verify(authoringWorkbenchDocks).setProjectExplorerExpandedPreference(true);
}
Also used : UberfireDocksInteractionEvent(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent) Test(org.junit.Test)

Example 3 with UberfireDocksInteractionEvent

use of org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent in project kie-wb-common by kiegroup.

the class AuthoringWorkbenchDocksTest method projectExplorerExpandedEvent_NotProjectExplorerDock.

@Test
public void projectExplorerExpandedEvent_NotProjectExplorerDock() {
    final UberfireDocksInteractionEvent uberfireDocksInteractionEvent = createUberfireDocksInteractionEvent(mock(UberfireDock.class), UberfireDocksInteractionEvent.InteractionType.OPENED);
    authoringWorkbenchDocks.projectExplorerExpandedEvent(uberfireDocksInteractionEvent);
    verify(authoringWorkbenchDocks, never()).setProjectExplorerExpandedPreference(anyBoolean());
}
Also used : UberfireDock(org.uberfire.client.workbench.docks.UberfireDock) UberfireDocksInteractionEvent(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent) Test(org.junit.Test)

Example 4 with UberfireDocksInteractionEvent

use of org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent in project drools-wb by kiegroup.

the class ScenarioSimulationEditorPresenterTest method onUberfireDocksInteractionEvent.

@Test
public void onUberfireDocksInteractionEvent() {
    UberfireDocksInteractionEvent uberfireDocksInteractionEventMock = mock(UberfireDocksInteractionEvent.class);
    doReturn(false).when(presenterSpy).isUberfireDocksInteractionEventToManage(uberfireDocksInteractionEventMock);
    presenterSpy.onUberfireDocksInteractionEvent(uberfireDocksInteractionEventMock);
    verify(presenterSpy, times(1)).isUberfireDocksInteractionEventToManage(eq(uberfireDocksInteractionEventMock));
    verify(uberfireDocksInteractionEventMock, never()).getTargetDock();
    verify(presenterSpy, never()).populateRightDocks(anyString());
    verify(scenarioSimulationEditorWrapperMock, never()).populateDocks(anyString());
    // 
    reset(presenterSpy);
    presenterSpy.dataManagementStrategy = null;
    presenterSpy.onUberfireDocksInteractionEvent(uberfireDocksInteractionEventMock);
    verify(presenterSpy, times(1)).isUberfireDocksInteractionEventToManage(eq(uberfireDocksInteractionEventMock));
    verify(presenterSpy, never()).populateRightDocks(anyString());
    verify(scenarioSimulationEditorWrapperMock, never()).populateDocks(anyString());
    // 
    reset(presenterSpy);
    reset(uberfireDocksInteractionEventMock);
    presenterSpy.dataManagementStrategy = dataManagementStrategyMock;
    UberfireDock targetDockMock = mock(UberfireDock.class);
    when(uberfireDocksInteractionEventMock.getTargetDock()).thenReturn(targetDockMock);
    doReturn(true).when(presenterSpy).isUberfireDocksInteractionEventToManage(uberfireDocksInteractionEventMock);
    when(targetDockMock.getIdentifier()).thenReturn(SettingsPresenter.IDENTIFIER);
    when(targetDockMock.getPlaceRequest()).thenReturn(placeRequestMock);
    presenterSpy.onUberfireDocksInteractionEvent(uberfireDocksInteractionEventMock);
    verify(presenterSpy, times(1)).isUberfireDocksInteractionEventToManage(eq(uberfireDocksInteractionEventMock));
    // It's invoked twice
    verify(uberfireDocksInteractionEventMock, times(2)).getTargetDock();
    verify(presenterSpy, times(1)).populateRightDocks(eq(SettingsPresenter.IDENTIFIER));
    verify(scenarioSimulationEditorWrapperMock, times(1)).populateDocks(eq(SettingsPresenter.IDENTIFIER));
    // 
    reset(presenterSpy);
    reset(uberfireDocksInteractionEventMock);
    presenterSpy.dataManagementStrategy = dataManagementStrategyMock;
    when(uberfireDocksInteractionEventMock.getTargetDock()).thenReturn(targetDockMock);
    doReturn(true).when(presenterSpy).isUberfireDocksInteractionEventToManage(uberfireDocksInteractionEventMock);
    when(targetDockMock.getIdentifier()).thenReturn(CheatSheetPresenter.IDENTIFIER);
    when(targetDockMock.getPlaceRequest()).thenReturn(placeRequestMock);
    presenterSpy.onUberfireDocksInteractionEvent(uberfireDocksInteractionEventMock);
    verify(presenterSpy, times(1)).isUberfireDocksInteractionEventToManage(eq(uberfireDocksInteractionEventMock));
    // It's invoked twice
    verify(uberfireDocksInteractionEventMock, times(2)).getTargetDock();
    verify(presenterSpy, times(1)).populateRightDocks(eq(CheatSheetPresenter.IDENTIFIER));
    verify(scenarioSimulationEditorWrapperMock, times(1)).populateDocks(eq(CheatSheetPresenter.IDENTIFIER));
    // 
    reset(presenterSpy, scenarioSimulationEditorWrapperMock, uberfireDocksInteractionEventMock);
    presenterSpy.dataManagementStrategy = dataManagementStrategyMock;
    when(uberfireDocksInteractionEventMock.getTargetDock()).thenReturn(targetDockMock);
    doReturn(true).when(presenterSpy).isUberfireDocksInteractionEventToManage(uberfireDocksInteractionEventMock);
    when(targetDockMock.getIdentifier()).thenReturn(TestToolsPresenter.IDENTIFIER);
    when(targetDockMock.getPlaceRequest()).thenReturn(placeRequestMock);
    presenterSpy.onUberfireDocksInteractionEvent(uberfireDocksInteractionEventMock);
    verify(presenterSpy, times(1)).isUberfireDocksInteractionEventToManage(eq(uberfireDocksInteractionEventMock));
    verify(uberfireDocksInteractionEventMock, times(1)).getTargetDock();
    verify(presenterSpy, never()).populateRightDocks(anyString());
    verify(scenarioSimulationEditorWrapperMock, never()).populateDocks(anyString());
}
Also used : UberfireDock(org.uberfire.client.workbench.docks.UberfireDock) UberfireDocksInteractionEvent(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent) Test(org.junit.Test)

Example 5 with UberfireDocksInteractionEvent

use of org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent in project kie-wb-common by kiegroup.

the class AuthoringWorkbenchDocksTest method projectExplorerExpandedEvent_ResizeInteraction.

@Test
public void projectExplorerExpandedEvent_ResizeInteraction() {
    final UberfireDocksInteractionEvent uberfireDocksInteractionEvent = createUberfireDocksInteractionEvent(authoringWorkbenchDocks.projectExplorerDock, UberfireDocksInteractionEvent.InteractionType.RESIZED);
    authoringWorkbenchDocks.projectExplorerExpandedEvent(uberfireDocksInteractionEvent);
    verify(authoringWorkbenchDocks, never()).setProjectExplorerExpandedPreference(anyBoolean());
}
Also used : UberfireDocksInteractionEvent(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 UberfireDocksInteractionEvent (org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent)7 UberfireDock (org.uberfire.client.workbench.docks.UberfireDock)3