@Nullable @Override protected ProcessHandler doGetProcessHandler() { return new CloudDebugProcessHandler(this); }
@Override protected void destroyProcessImpl() { notifyProcessDetached(); }
/** Initialize the panel. */ public CloudDebugHistoricalSnapshots(@NotNull CloudDebugProcessHandler processHandler) { super(new BorderLayout()); table = new CloudDebuggerTable(); configureToolbar(); process = processHandler.getProcess(); process.getXDebugSession().addSessionListener(this); process.addListener(this); }
@Test public void testDetachIsDefault() { Assert.assertTrue(handler.detachIsDefault()); }
@Test public void testGetProcessInput() { Assert.assertNull(handler.getProcessInput()); }
@Test public void testIsSilentlyDisposed() { Assert.assertTrue(handler.isSilentlyDestroyOnClose()); }
@Test public void testOnLogoutDebugProcessIsDetached() throws Exception { new LogoutDebugProcessDetacher<CloudDebugProcessHandler>(processHandler).statusChanged(false); verify(processHandler).detachProcess(); }
@Before public void setUp() { MockApplication application = new MyMockApplicationEx(parent); ActionManagerEx manager = Mockito.mock(ActionManagerEx.class); ActionToolbar actionToolbar = Mockito.mock(ActionToolbar.class); Mockito.when(actionToolbar.getComponent()).thenReturn(new JComponent() {}); Mockito.when( manager.createActionToolbar( Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean())) .thenReturn(actionToolbar); Mockito.when( manager.createActionToolbar( Mockito.anyString(), Mockito.any(ActionGroup.class), Mockito.anyBoolean(), Mockito.anyBoolean())) .thenReturn(actionToolbar); application.addComponent(ActionManager.class, manager); application.registerService(UISettings.class); ApplicationManager.setApplication(application, parent); XDebugSession session = Mockito.mock(XDebugSession.class); Mockito.when(handler.getProcess()).thenReturn(mockProcess); Mockito.when(mockProcess.getXDebugSession()).thenReturn(session); }
private void setupMocks() { GoogleLoginState googleLoginState = mock(GoogleLoginState.class); CredentialedUser credentialedUser = mock(CredentialedUser.class); when(credentialedUser.getGoogleLoginState()).thenReturn(googleLoginState); LinkedHashMap<String, CredentialedUser> users = new LinkedHashMap<String, CredentialedUser>(); users.put("mockUser@foo.bar", credentialedUser); when(mockLoginService.getAllUsers()).thenReturn(users); CloudDebugProcessState cloudDebugProcessState = mock(CloudDebugProcessState.class); when(cloudDebugProcessState.getUserEmail()).thenReturn("mockUser@foo.bar"); CloudDebugProcess cloudDebugProcess = mock(CloudDebugProcess.class); when(cloudDebugProcess.getProcessState()).thenReturn(cloudDebugProcessState); handler = new CloudDebugProcessHandler(cloudDebugProcess); } }
@Override protected void detachProcessImpl() { notifyProcessDetached(); }