Search in sources :

Example 1 with RuntimeInfoCatalog

use of org.erlide.runtime.runtimeinfo.RuntimeInfoCatalog 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();
}
Also used : RuntimeInfoCatalog(org.erlide.runtime.runtimeinfo.RuntimeInfoCatalog) RuntimeData(org.erlide.runtime.api.RuntimeData) OtpNodeProxy(org.erlide.runtime.internal.OtpNodeProxy) Before(org.junit.Before)

Example 2 with RuntimeInfoCatalog

use of org.erlide.runtime.runtimeinfo.RuntimeInfoCatalog in project erlide_eclipse by erlang.

the class RuntimeCore method getRuntimeInfoCatalog.

public static final synchronized IRuntimeInfoCatalog getRuntimeInfoCatalog(final IRuntimeInfoSerializer serializer) {
    if (RuntimeCore.runtimeInfoCatalog == null) {
        final RuntimeInfoCatalogData data = serializer.load();
        RuntimeCore.runtimeInfoCatalog = new RuntimeInfoCatalog();
        RuntimeCore.runtimeInfoCatalog.setRuntimes(data.runtimes, data.defaultRuntimeName, data.erlideRuntimeName);
        final RuntimeInfo runtime = RuntimeCore.runtimeInfoCatalog.getErlideRuntime();
        if (!HostnameChecker.getInstance().detectHostNames(runtime.getOtpHome())) {
            // XXX show troubleshooting page and re-detect
            ErlLogger.error("no matching hostnames found!! Edit ~/.erlide.hosts");
        }
    }
    return RuntimeCore.runtimeInfoCatalog;
}
Also used : IRuntimeInfoCatalog(org.erlide.runtime.runtimeinfo.IRuntimeInfoCatalog) RuntimeInfoCatalog(org.erlide.runtime.runtimeinfo.RuntimeInfoCatalog) RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) RuntimeInfoCatalogData(org.erlide.runtime.runtimeinfo.RuntimeInfoCatalogData)

Aggregations

RuntimeInfoCatalog (org.erlide.runtime.runtimeinfo.RuntimeInfoCatalog)2 RuntimeData (org.erlide.runtime.api.RuntimeData)1 OtpNodeProxy (org.erlide.runtime.internal.OtpNodeProxy)1 IRuntimeInfoCatalog (org.erlide.runtime.runtimeinfo.IRuntimeInfoCatalog)1 RuntimeInfo (org.erlide.runtime.runtimeinfo.RuntimeInfo)1 RuntimeInfoCatalogData (org.erlide.runtime.runtimeinfo.RuntimeInfoCatalogData)1 Before (org.junit.Before)1