use of org.eclipse.che.plugin.zdb.server.connection.ZendDbgSettings in project che by eclipse.
the class ZendDbgFactory method create.
@Override
public Debugger create(Map<String, String> properties, Debugger.DebuggerCallback debuggerCallback) throws DebuggerException {
Map<String, String> normalizedProps = properties.entrySet().stream().collect(toMap(e -> e.getKey().toLowerCase(), Map.Entry::getValue));
String breakAtFirstLineProp = normalizedProps.get("break-at-first-line");
if (breakAtFirstLineProp == null) {
throw new DebuggerException("Can't establish connection: debug break at first line property is unknown.");
}
boolean breakAtFirstLine = Boolean.valueOf(breakAtFirstLineProp);
String clientHostIPProp = normalizedProps.get("client-host-ip");
if (clientHostIPProp == null) {
throw new DebuggerException("Can't establish connection: client host/IP property is unknown.");
}
String debugPortProp = normalizedProps.get("debug-port");
if (debugPortProp == null) {
throw new DebuggerException("Can't establish connection: debug port property is unknown.");
}
int debugPort;
try {
debugPort = Integer.parseInt(debugPortProp);
} catch (NumberFormatException e) {
throw new DebuggerException("Unknown debug port property format: " + debugPortProp);
}
String useSslEncryptionProp = normalizedProps.get("use-ssl-encryption");
if (useSslEncryptionProp == null) {
throw new DebuggerException("Can't establish connection: debug use SSL encryption property is unknown.");
}
boolean useSslEncryption = Boolean.valueOf(useSslEncryptionProp);
return new ZendDebugger(new ZendDbgSettings(debugPort, clientHostIPProp, breakAtFirstLine, useSslEncryption), new ZendDbgLocationHandler(), debuggerCallback);
}
use of org.eclipse.che.plugin.zdb.server.connection.ZendDbgSettings in project che by eclipse.
the class ZendDbgConfigurationTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
ZendDbgSettings dbgSettings = new ZendDbgSettings(DEBUG_PORT, DEBUG_HOST, true, false);
debugger = new ZendDebugger(dbgSettings, null, null);
}
Aggregations