use of org.eclipse.che.api.debug.shared.model.DebuggerInfo in project che by eclipse.
the class AbstractDebugger method connect.
@Override
public Promise<Void> connect(Map<String, String> connectionProperties) {
if (isConnected()) {
return Promises.reject(JsPromiseError.create("Debugger already connected"));
}
Promise<DebugSessionDto> connect = service.connect(debuggerType, connectionProperties);
final DebuggerDescriptor debuggerDescriptor = toDescriptor(connectionProperties);
Promise<Void> promise = connect.then(new Function<DebugSessionDto, Void>() {
@Override
public Void apply(final DebugSessionDto arg) throws FunctionException {
DebuggerInfo debuggerInfo = arg.getDebuggerInfo();
debuggerDescriptor.setInfo(debuggerInfo.getName() + " " + debuggerInfo.getVersion());
setDebugSession(arg);
preserveDebuggerState();
startCheckingEvents();
startDebugger(arg);
return null;
}
}).catchError(new Operation<PromiseError>() {
@Override
public void apply(PromiseError arg) throws OperationException {
Log.error(AbstractDebugger.class, arg.getMessage());
throw new OperationException(arg.getCause());
}
});
for (DebuggerObserver observer : observers) {
observer.onDebuggerAttached(debuggerDescriptor, promise);
}
return promise;
}
use of org.eclipse.che.api.debug.shared.model.DebuggerInfo in project che by eclipse.
the class ZendDbgConfigurationTest method testGetInfo.
@Test(groups = { "zendDbg" }, dependsOnGroups = { "checkPHP" })
public void testGetInfo() throws Exception {
DebuggerInfo info = debugger.getInfo();
assertTrue(info.getFile() == null);
assertTrue(isNullOrEmpty(info.getVersion()));
assertTrue(info.getName().equals("Zend Debugger"));
assertTrue(info.getPid() == 0);
assertTrue(info.getHost().equals(DEBUG_HOST));
assertTrue(info.getPort() == DEBUG_PORT);
}
Aggregations