use of org.eclipse.ui.IWindowListener in project gfm_viewer by satyagraha.
the class DIManagerTest method shouldStopNormally.
@Test
public void shouldStopNormally() {
// given
// when
DIManager.start(workbench, bundleContext, packagePrefix, debugging);
DIManager.stop();
// then
IWindowListener windowListener = windowListenerCaptor.getValue();
assertThat(windowListener, notNullValue());
verify(workbench, times(1)).removeWindowListener(eq(windowListener));
}
use of org.eclipse.ui.IWindowListener in project gfm_viewer by satyagraha.
the class DIManagerTest method shouldInstantiateNewPluginScopeComponentWhenNewWindow.
@Test
public void shouldInstantiateNewPluginScopeComponentWhenNewWindow() throws Exception {
// given
// when
DIManager.start(workbench, bundleContext, packagePrefix, debugging);
InjectedPageClass injectedPageClassInstance1 = DIManager.getDefault().getInjector(Scope.PAGE).getInstance(InjectedPageClass.class);
// given
given(workbench.getActiveWorkbenchWindow()).willReturn(workbenchWindow2);
// when
IWindowListener windowListener = windowListenerCaptor.getValue();
windowListener.windowOpened(workbenchWindow2);
InjectedPageClass injectedPageClassInstance2 = DIManager.getDefault().getInjector(Scope.PAGE).getInstance(InjectedPageClass.class);
// then
assertThat(injectedPageClassInstance2, not(sameInstance(injectedPageClassInstance1)));
}
use of org.eclipse.ui.IWindowListener in project gfm_viewer by satyagraha.
the class DIManagerTest method shouldStartNormally.
@Test
public void shouldStartNormally() {
// given
// when
DIManager.start(workbench, bundleContext, packagePrefix, debugging);
// then
verify(workbench, times(1)).addWindowListener(any(IWindowListener.class));
IWindowListener windowListener = windowListenerCaptor.getValue();
assertThat(windowListener, notNullValue());
}
Aggregations