use of org.eclipse.che.api.debug.shared.dto.DebugSessionDto in project che by eclipse.
the class DebuggerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
super.setUp();
debuggerDescriptor = new DebuggerDescriptor(NAME + " " + VERSION, HOST + ":" + PORT);
doReturn(locationDto).when(dtoFactory).createDto(LocationDto.class);
doReturn(breakpointDto).when(dtoFactory).createDto(BreakpointDto.class);
doReturn(locationDto).when(breakpointDto).getLocation();
doReturn(messageBus).when(messageBusProvider).getMachineMessageBus();
doReturn(localStorage).when(localStorageProvider).get();
doReturn(DEBUG_INFO).when(localStorage).getItem(AbstractDebugger.LOCAL_STORAGE_DEBUGGER_SESSION_KEY);
doReturn(debugSessionDto).when(dtoFactory).createDtoFromJson(anyString(), eq(DebugSessionDto.class));
doReturn(Path.valueOf(PATH)).when(file).getLocation();
debugger = new TestDebugger(service, dtoFactory, localStorageProvider, messageBusProvider, eventBus, activeFileHandler, debuggerManager, notificationManager, "id");
doReturn(promiseInfo).when(service).getSessionInfo(SESSION_ID);
doReturn(promiseInfo).when(promiseInfo).then(any(Operation.class));
// setup messageBus
verify(eventBus).addHandler(eq(WsAgentStateEvent.TYPE), extServerStateHandlerCaptor.capture());
extServerStateHandlerCaptor.getValue().onWsAgentStarted(WsAgentStateEvent.createWsAgentStartedEvent());
debugger.addObserver(observer);
FileType fileType = mock(FileType.class);
doReturn("java").when(fileType).getExtension();
}
Aggregations