use of org.erlide.runtime.api.RuntimeData in project erlide_eclipse by erlang.
the class OtpNodeProxyTest method nonManagedRuntimeWorks.
@Test
public void nonManagedRuntimeWorks() {
final RuntimeData data = new RuntimeData(info, "run");
data.setNodeName(runtime.getNodeName());
data.setLongName(false);
data.setCookie("c");
data.setManaged(false);
final OtpNodeProxy runtime2 = new OtpNodeProxy(data);
runtime2.ensureRunning();
final Process process2 = runtime2.getProcess();
assertThat(runtime2.isRunning()).isEqualTo(true);
assertThat(process2).isNull();
final IOtpRpc site = runtime2.getOtpRpc();
OtpErlangObject r;
try {
r = site.call("erlang", "now", "");
} catch (final RpcException e) {
r = null;
}
assertThat(r).isNotNull();
try {
runtime2.dispose();
} catch (final Throwable t) {
ErlLogger.error(t);
}
try {
Thread.sleep(100);
} catch (final InterruptedException e) {
}
expect(runtime2, process2, -1, State.TERMINATED);
assertThat(runtime.state()).isEqualTo(State.RUNNING);
}
use of org.erlide.runtime.api.RuntimeData in project erlide_eclipse by erlang.
the class OtpNodeProxyTest method prepareRuntime.
@Before
public void prepareRuntime() {
final RuntimeInfoCatalog cat = new RuntimeInfoCatalog();
cat.initializeRuntimesList();
assertThat(cat.getRuntimes()).isNotEmpty();
info = cat.getRuntimes().iterator().next();
assertThat(info).isNotEqualTo(RuntimeInfo.NO_RUNTIME_INFO);
HostnameChecker.getInstance().detectHostNames(info.getOtpHome());
final RuntimeData data = new RuntimeData(info, "run");
data.setNodeName("etest" + System.currentTimeMillis());
data.setLongName(false);
data.setCookie("c");
data.setManaged(true);
data.setRestartable(false);
runtime = new OtpNodeProxy(data);
runtime.ensureRunning();
process = runtime.getProcess();
assertThat(process).isNotNull();
}
Aggregations