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;
}
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());
}
Aggregations