Search in sources :

Example 1 with LiferayTomcatServer

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);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IServer(org.eclipse.wst.server.core.IServer) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) ILiferayTomcatServer(com.liferay.ide.server.tomcat.core.ILiferayTomcatServer) LiferayTomcatServer(com.liferay.ide.server.tomcat.core.LiferayTomcatServer) ILiferayTomcatServer(com.liferay.ide.server.tomcat.core.ILiferayTomcatServer) Test(org.junit.Test)

Example 2 with LiferayTomcatServer

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]);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IServer(org.eclipse.wst.server.core.IServer) LiferayTomcatServerBehavior(com.liferay.ide.server.tomcat.core.LiferayTomcatServerBehavior) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) LiferayTomcatServer(com.liferay.ide.server.tomcat.core.LiferayTomcatServer) ILiferayTomcatServer(com.liferay.ide.server.tomcat.core.ILiferayTomcatServer) Test(org.junit.Test)

Example 3 with LiferayTomcatServer

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);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IServer(org.eclipse.wst.server.core.IServer) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) ILiferayTomcatServer(com.liferay.ide.server.tomcat.core.ILiferayTomcatServer) LiferayTomcatServer(com.liferay.ide.server.tomcat.core.LiferayTomcatServer) ILiferayTomcatServer(com.liferay.ide.server.tomcat.core.ILiferayTomcatServer) Test(org.junit.Test)

Aggregations

ILiferayTomcatServer (com.liferay.ide.server.tomcat.core.ILiferayTomcatServer)3 LiferayTomcatServer (com.liferay.ide.server.tomcat.core.LiferayTomcatServer)3 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 IServer (org.eclipse.wst.server.core.IServer)3 IServerWorkingCopy (org.eclipse.wst.server.core.IServerWorkingCopy)3 Test (org.junit.Test)3 LiferayTomcatServerBehavior (com.liferay.ide.server.tomcat.core.LiferayTomcatServerBehavior)1