use of com.liferay.ide.server.tomcat.core.ILiferayTomcatRuntime in project liferay-ide by liferay.
the class ServerCoreBase method setupRuntime.
@Before
public void setupRuntime() throws Exception {
if (shouldSkipBundleTests())
return;
assertNotNull("Expected System.getProperty(\"liferay.bundles.dir\") to not be null", System.getProperty("liferay.bundles.dir"));
assertNotNull("Expected liferayBundlesDir to not be null", liferayBundlesDir);
assertEquals("Expected liferayBundlesPath to exist: " + getLiferayBundlesPath().toOSString(), true, getLiferayBundlesPath().toFile().exists());
extractRuntime(getLiferayRuntimeZip(), getLiferayRuntimeDir());
final NullProgressMonitor npm = new NullProgressMonitor();
final String runtimeName = getRuntimeVersion();
runtime = ServerCore.findRuntime(runtimeName);
if (runtime == null) {
final IRuntimeWorkingCopy runtimeWC = ServerCore.findRuntimeType(getRuntimeId()).createRuntime(runtimeName, npm);
runtimeWC.setName(runtimeName);
runtimeWC.setLocation(getLiferayRuntimeDir());
runtime = runtimeWC.save(true, npm);
}
assertNotNull(runtime);
final ILiferayTomcatRuntime liferayRuntime = (ILiferayTomcatRuntime) ServerCore.findRuntime(runtimeName).loadAdapter(ILiferayTomcatRuntime.class, npm);
assertNotNull(liferayRuntime);
final IPath portalBundleFolder = runtime.getLocation().removeLastSegments(1);
final IPath deployPath = portalBundleFolder.append("deploy");
final File deployFolder = deployPath.toFile();
if (!deployFolder.exists()) {
deployFolder.mkdir();
}
assertEquals("Expected the deploy folder to exist:" + deployPath.toOSString(), true, deployFolder.exists());
}
Aggregations