@Override public void onError(String errorMessage) { cloudIdeLineBreakpoint.setErrorMessage(errorMessage); process.updateBreakpointPresentation(cloudIdeLineBreakpoint); } });
private void verifyMutedIconSettingInUpdateBreakpointPresentation(Boolean muted) { XBreakpointManager breakpointManager = mock(XBreakpointManager.class); XDebugSession debugSession = mock(XDebugSession.class); when(debugSession.areBreakpointsMuted()).thenReturn(muted); CloudDebugProcess cloudDebugProcess = mockCloudDebugProcess(breakpointManager, debugSession); CloudLineBreakpoint breakpoint = mockCloudLineBreakpoint( cloudDebugProcess, "mock error message", mock(XLineBreakpointImpl.class)); cloudDebugProcess.updateBreakpointPresentation(breakpoint); verify(breakpoint).getSetIcon(muted); }
public void testRegisterBreakpointErrorShouldSetErrorMessageAndCallUpdateBreakpointPresentation() { registrationShouldSucceed = false; registerMockBreakpoint( psiJavaFile, new String[] {"foowatch1"}, "condition == true", 123, "foo.java", "com.google", false, "b_id"); ArgumentCaptor<CloudLineBreakpoint> breakpointArgumentCaptor = ArgumentCaptor.forClass(CloudLineBreakpoint.class); verify(process).updateBreakpointPresentation(breakpointArgumentCaptor.capture()); assertThat( breakpointArgumentCaptor.getValue().getErrorMessage(), equalTo("Registration failed")); }
public void testRegisterBreakpointErrorShouldSetErrorMessageAndCallUpdateBreakpointPresentation2() { registerMockBreakpoint( psiJavaFile, new String[] {"foowatch1"}, "condition == true", 123, "foo.java", "com.google", false, ""); ArgumentCaptor<CloudLineBreakpoint> breakpointArgumentCaptor = ArgumentCaptor.forClass(CloudLineBreakpoint.class); verify(process).updateBreakpointPresentation(breakpointArgumentCaptor.capture()); assertThat( breakpointArgumentCaptor.getValue().getErrorMessage(), equalTo("The snapshot location could not be set.")); }
@Test public void testUpdateBreakpointRepresentationUsesBreakpointErrorMsgAndIcon() { XBreakpointManager breakpointManager = mock(XBreakpointManager.class); CloudDebugProcess cloudDebugProcess = mockCloudDebugProcess(breakpointManager, mock(XDebugSession.class)); XLineBreakpointImpl xBreakpoint = mock(XLineBreakpointImpl.class); CloudLineBreakpoint breakpoint = mockCloudLineBreakpoint(cloudDebugProcess, "mock error message", xBreakpoint); Icon icon = mock(Icon.class); when(breakpoint.getSetIcon(anyBoolean())).thenReturn(icon); cloudDebugProcess.updateBreakpointPresentation(breakpoint); verify(cloudDebugProcess, times(1)).getXBreakpoint(breakpoint); verify(breakpoint).getSetIcon(anyBoolean()); verify(breakpoint).getErrorMessage(); verify(breakpointManager).updateBreakpointPresentation(xBreakpoint, icon, "mock error message"); }
cloudLineBreakpoint.setErrorMessage( BreakpointUtil.getUserErrorMessage(breakpoint.getStatus())); updateBreakpointPresentation(cloudLineBreakpoint);
assertFalse(cloudLineBreakpointProperties.isCreatedByServer()); verify(cloudDebugProcess).updateBreakpointPresentation(cloudLineBreakpoint);
cloudIdeLineBreakpoint.setVerified(true); cloudIdeLineBreakpoint.setErrorMessage(null); debugProcess.updateBreakpointPresentation(cloudIdeLineBreakpoint);
public void testSimpleKotlinFileBreakpointRegister() { KtFile ktFile = mock(KtFile.class); when(ktFile.getFileType()).thenReturn(KotlinFileType.INSTANCE); registerMockBreakpoint( ktFile, new String[] {"foowatch1"}, "condition == true", 123, "foo.java", "com.google", false, "b_id"); assertNull(removedBp.get()); assertNotNull(addedBp.get()); assertContainsElements(addedBp.get().getExpressions(), "foowatch1"); assertTrue(addedBp.get().getLocation().getLine() == 124); assertTrue(addedBp.get().getLocation().getPath().equals("com/google/foo.java")); assertTrue(addedBp.get().getCondition().equals("condition == true")); ArgumentCaptor<CloudLineBreakpoint> breakpointArgumentCaptor = ArgumentCaptor.forClass(CloudLineBreakpoint.class); verify(process).updateBreakpointPresentation(breakpointArgumentCaptor.capture()); assertThat(breakpointArgumentCaptor.getValue().getErrorMessage(), nullValue()); }
public void testSimpleJavaFileBreakpointRegister() { registerMockBreakpoint( psiJavaFile, new String[] {"foowatch1"}, "condition == true", 123, "foo.java", "com.google", false, "b_id"); assertNull(removedBp.get()); assertNotNull(addedBp.get()); assertContainsElements(addedBp.get().getExpressions(), "foowatch1"); assertTrue(addedBp.get().getLocation().getLine() == 124); assertTrue(addedBp.get().getLocation().getPath().equals("com/google/foo.java")); assertTrue(addedBp.get().getCondition().equals("condition == true")); ArgumentCaptor<CloudLineBreakpoint> breakpointArgumentCaptor = ArgumentCaptor.forClass(CloudLineBreakpoint.class); verify(process).updateBreakpointPresentation(breakpointArgumentCaptor.capture()); assertThat(breakpointArgumentCaptor.getValue().getErrorMessage(), nullValue()); }
cloudIdeLineBreakpoint.setVerified(true); cloudIdeLineBreakpoint.setErrorMessage(null); process.updateBreakpointPresentation(cloudIdeLineBreakpoint);
@Override public void stop() { getStateController().stopBackgroundListening(); RunProfile profile = getXDebugSession().getRunProfile(); if (profile instanceof CloudDebugRunConfiguration) { ((CloudDebugRunConfiguration) profile).setProcessState(processState); } getRepositoryValidator().restoreToOriginalState(getXDebugSession().getProject()); XBreakpointManager breakpointManager = XDebuggerManager.getInstance(getXDebugSession().getProject()).getBreakpointManager(); for (XBreakpoint bp : breakpointManager.getAllBreakpoints()) { com.intellij.debugger.ui.breakpoints.Breakpoint cloudBreakpoint = BreakpointManager.getJavaBreakpoint(bp); if (!(cloudBreakpoint instanceof CloudLineBreakpointType.CloudLineBreakpoint)) { continue; } CloudLineBreakpointType.CloudLineBreakpoint cloudLineBreakpoint = (CloudLineBreakpointType.CloudLineBreakpoint) cloudBreakpoint; cloudLineBreakpoint.setVerified(false); cloudLineBreakpoint.setErrorMessage(null); updateBreakpointPresentation(cloudLineBreakpoint); } }