Search in sources :

Example 1 with ILiferayTomcatServerWC

use of com.liferay.ide.server.tomcat.core.ILiferayTomcatServerWC in project liferay-ide by liferay.

the class ServerCustomSettingTests method testVMArgsWithCustomMemoryArgs.

@Test
public void testVMArgsWithCustomMemoryArgs() throws Exception {
    if (shouldSkipBundleTests())
        return;
    final NullProgressMonitor npm = new NullProgressMonitor();
    if (runtime == null) {
        setupRuntime();
    }
    assertNotNull(runtime);
    final IServerWorkingCopy serverWC = createServerForRuntime("testvmargs", runtime);
    ILiferayTomcatServerWC wc = (ILiferayTomcatServerWC) serverWC.loadAdapter(ILiferayTomcatServerWC.class, npm);
    wc.setMemoryArgs("-Xmx2048m");
    final IServer newServer = serverWC.save(true, npm);
    final LiferayTomcatServerBehavior behavior = (LiferayTomcatServerBehavior) newServer.loadAdapter(LiferayTomcatServerBehavior.class, npm);
    assertEquals("-Xmx2048m", behavior.getRuntimeVMArguments()[6]);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ILiferayTomcatServerWC(com.liferay.ide.server.tomcat.core.ILiferayTomcatServerWC) IServer(org.eclipse.wst.server.core.IServer) LiferayTomcatServerBehavior(com.liferay.ide.server.tomcat.core.LiferayTomcatServerBehavior) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) Test(org.junit.Test)

Aggregations

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