use of com.liferay.ide.server.tomcat.core.LiferayTomcatServer in project liferay-ide by liferay.
the class ServerCustomSettingTests method testDefaultValueOfUseDefaultPortalSetting.
@Test
public void testDefaultValueOfUseDefaultPortalSetting() throws Exception {
if (shouldSkipBundleTests())
return;
final NullProgressMonitor npm = new NullProgressMonitor();
if (runtime == null) {
setupRuntime();
}
assertNotNull(runtime);
final IServerWorkingCopy serverWC = createServerForRuntime("testdefault", runtime);
IServer newServer = serverWC.save(true, npm);
IServer findServer = ServerCore.findServer(newServer.getId());
assertNotNull(findServer);
ILiferayTomcatServer portalServer = (ILiferayTomcatServer) findServer.loadAdapter(ILiferayTomcatServer.class, null);
final boolean useDefaultPortalServerSettings = ((LiferayTomcatServer) portalServer).getUseDefaultPortalServerSettings();
assertEquals(false, useDefaultPortalServerSettings);
}
use of com.liferay.ide.server.tomcat.core.LiferayTomcatServer in project liferay-ide by liferay.
the class ServerCustomSettingTests method testVMArgsWithCustomMemoryArgsAndUseDefaultSetting.
@Test
public void testVMArgsWithCustomMemoryArgsAndUseDefaultSetting() throws Exception {
if (shouldSkipBundleTests())
return;
final NullProgressMonitor npm = new NullProgressMonitor();
if (runtime == null) {
setupRuntime();
}
assertNotNull(runtime);
final IServerWorkingCopy serverWC = createServerForRuntime("testvmargs", runtime);
LiferayTomcatServer wc = (LiferayTomcatServer) serverWC.loadAdapter(LiferayTomcatServer.class, npm);
wc.setMemoryArgs("-Xmx2048m");
wc.setUseDefaultPortalServerSettings(true);
final IServer newServer = serverWC.save(true, npm);
final LiferayTomcatServerBehavior behavior = (LiferayTomcatServerBehavior) newServer.loadAdapter(LiferayTomcatServerBehavior.class, npm);
assertEquals("-Xmx1024m", behavior.getRuntimeVMArguments()[6]);
}
use of com.liferay.ide.server.tomcat.core.LiferayTomcatServer in project liferay-ide by liferay.
the class ServerCustomSettingTests method testSettingValueOfUseDefaultPortalSetting.
@Test
public void testSettingValueOfUseDefaultPortalSetting() throws Exception {
if (shouldSkipBundleTests())
return;
final NullProgressMonitor npm = new NullProgressMonitor();
if (runtime == null) {
setupRuntime();
}
assertNotNull(runtime);
final IServerWorkingCopy serverWC = createServerForRuntime("testdefault2", runtime);
serverWC.setAttribute(ILiferayTomcatServer.PROPERTY_USE_DEFAULT_PORTAL_SERVER_SETTINGS, true);
IServer newServer = serverWC.save(true, npm);
IServer findServer = ServerCore.findServer(newServer.getId());
ILiferayTomcatServer portalServer = (ILiferayTomcatServer) findServer.loadAdapter(ILiferayTomcatServer.class, npm);
final boolean useDefaultPortalServerSettings = ((LiferayTomcatServer) portalServer).getUseDefaultPortalServerSettings();
assertEquals(true, useDefaultPortalServerSettings);
}
Aggregations