Search in sources :

Example 1 with ITomcatRuntimeWorkingCopy

use of org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy in project webtools.servertools by eclipse.

the class GetDelegateTestCase method createRuntime.

protected IRuntimeWorkingCopy createRuntime(String runtimeTypeId, String runtimeTypeLocation) throws CoreException {
    if (runtimeTypeId == null)
        throw new IllegalArgumentException();
    IRuntimeWorkingCopy runtimeCopy = ServerCore.findRuntimeType(runtimeTypeId).createRuntime(runtimeTypeId, null);
    runtimeCopy.setLocation(new Path(runtimeTypeLocation));
    runtimeCopy.setReadOnly(false);
    IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
    ITomcatRuntimeWorkingCopy rwc = (ITomcatRuntimeWorkingCopy) runtimeCopy.loadAdapter(ITomcatRuntimeWorkingCopy.class, new NullProgressMonitor());
    rwc.setVMInstall(vmInstall);
    runtimeCopy.save(false, null);
    return runtimeCopy;
}
Also used : Path(org.eclipse.core.runtime.Path) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IVMInstall(org.eclipse.jdt.launching.IVMInstall) ITomcatRuntimeWorkingCopy(org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy) IRuntimeWorkingCopy(org.eclipse.wst.server.core.IRuntimeWorkingCopy)

Example 2 with ITomcatRuntimeWorkingCopy

use of org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy in project webtools.servertools by eclipse.

the class TomcatRuntimeTestCase method modifyRuntime.

protected void modifyRuntime() throws Exception {
    IRuntimeWorkingCopy wc = runtime.createWorkingCopy();
    ITomcatRuntimeWorkingCopy trwc = (ITomcatRuntimeWorkingCopy) wc.loadAdapter(ITomcatRuntimeWorkingCopy.class, null);
    trwc.setVMInstall(null);
    wc.save(true, null);
    tomcatRuntime = (ITomcatRuntime) runtime.loadAdapter(ITomcatRuntime.class, null);
    assertNotNull(tomcatRuntime.getVMInstall());
}
Also used : ITomcatRuntimeWorkingCopy(org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy) IRuntimeWorkingCopy(org.eclipse.wst.server.core.IRuntimeWorkingCopy)

Aggregations

ITomcatRuntimeWorkingCopy (org.eclipse.jst.server.tomcat.core.internal.ITomcatRuntimeWorkingCopy)2 IRuntimeWorkingCopy (org.eclipse.wst.server.core.IRuntimeWorkingCopy)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Path (org.eclipse.core.runtime.Path)1 IVMInstall (org.eclipse.jdt.launching.IVMInstall)1