use of org.eclipse.wst.server.core.IRuntimeWorkingCopy 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());
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project webtools.servertools by eclipse.
the class TomcatRuntimeTestCase method createRuntime.
protected IRuntimeWorkingCopy createRuntime(String runtimeTypeId) throws Exception {
IRuntimeType rt = ServerCore.findRuntimeType(runtimeTypeId);
IRuntimeWorkingCopy wc = rt.createRuntime("a", null);
wc.setLocation(new Path("c://test"));
return wc;
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class ProjectCoreBase method createNewRuntime.
protected IRuntime createNewRuntime(final String name) throws Exception {
final IPath newRuntimeLocation = new Path(getLiferayRuntimeDir().toString() + "-new");
if (!newRuntimeLocation.toFile().exists()) {
FileUtils.copyDirectory(getLiferayRuntimeDir().toFile(), newRuntimeLocation.toFile());
}
assertEquals(true, newRuntimeLocation.toFile().exists());
final NullProgressMonitor npm = new NullProgressMonitor();
IRuntime runtime = ServerCore.findRuntime(name);
if (runtime == null) {
final IRuntimeWorkingCopy runtimeWC = ServerCore.findRuntimeType(getRuntimeId()).createRuntime(name, npm);
runtimeWC.setName(name);
runtimeWC.setLocation(newRuntimeLocation);
runtime = runtimeWC.save(true, npm);
}
ServerCore.getRuntimes();
assertNotNull(runtime);
return runtime;
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class PortalBundleTests method testPortalBundleTypeDetection.
@Test
public void testPortalBundleTypeDetection() throws Exception {
if (shouldSkipBundleTests())
return;
IProgressMonitor npm = new NullProgressMonitor();
final String name = "detectionTest";
final IRuntimeWorkingCopy runtimeWC = ServerCore.findRuntimeType(getRuntimeId()).createRuntime(name, npm);
assertNotNull(runtimeWC);
runtimeWC.setName(name);
runtimeWC.setLocation(getLiferayRuntimeDir());
PortalRuntime portalRuntime = (PortalRuntime) runtimeWC.loadAdapter(PortalRuntime.class, npm);
assertNotNull(portalRuntime);
assertNotNull(portalRuntime.getPortalBundle());
assertEquals("tomcat", portalRuntime.getPortalBundle().getType());
assertEquals(getLiferayRuntimeDir().append(".."), portalRuntime.getPortalBundle().getLiferayHome());
}
use of org.eclipse.wst.server.core.IRuntimeWorkingCopy in project liferay-ide by liferay.
the class PortalBundleTests method testPortalBundleChangeLocation.
@Test
public void testPortalBundleChangeLocation() throws Exception {
if (shouldSkipBundleTests())
return;
IProgressMonitor npm = new NullProgressMonitor();
final String name = "changeLocationTest";
final IRuntimeWorkingCopy runtimeWC = ServerCore.findRuntimeType(getRuntimeId()).createRuntime(name, npm);
assertNotNull(runtimeWC);
runtimeWC.setName(name);
runtimeWC.setLocation(getLiferayRuntimeDir().append("../.."));
PortalRuntime portalRuntime = (PortalRuntime) runtimeWC.loadAdapter(PortalRuntime.class, npm);
assertNotNull(portalRuntime);
assertNull(portalRuntime.getPortalBundle());
runtimeWC.setLocation(getLiferayRuntimeDir().append(".."));
assertNotNull(portalRuntime.getPortalBundle());
runtimeWC.setLocation(null);
assertNull(portalRuntime.getPortalBundle());
runtimeWC.setLocation(getLiferayRuntimeDir());
assertNotNull(portalRuntime.getPortalBundle());
// set 7.x server with 6.2 location
// IPath zip = getLiferayBundlesPath().append( "liferay-portal-tomcat-6.2-ce-ga4-20150416163831865.zip" );
// IPath dir = ProjectCore.getDefault().getStateLocation().append( "liferay-portal-6.2-ce-ga4/tomcat-7.0.42" );
//
// extractRuntime( zip, dir );
//
// runtimeWC.setLocation( dir );
//
// assertNull( portalRuntime.getPortalBundle() );
}
Aggregations