Search in sources :

Example 1 with TomcatServerBehaviour

use of org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour in project webtools.servertools by eclipse.

the class AbstractTomcatServerTestCase method verifyDefaultDeployConfig.

/*
	 * Tests to verify modules are deployed correctly per configuration
	 */
/**
 * @throws Exception
 */
public void verifyDefaultDeployConfig() throws Exception {
    TomcatServer ts = getTomcatServer();
    assertNotNull(ts);
    TomcatServerBehaviour tsb = getTomcatServerBehaviour();
    assertNotNull(tsb);
    assertEquals(ITomcatServerWorkingCopy.DEFAULT_DEPLOYDIR, ts.getDeployDirectory());
    IPath tempDir = tsb.getTempDirectory();
    IPath baseDir = tsb.getRuntimeBaseDirectory();
    assertEquals(tempDir, baseDir);
    IPath deployDir = tsb.getServerDeployDirectory();
    assertEquals(baseDir.append(ITomcatServerWorkingCopy.DEFAULT_DEPLOYDIR), deployDir);
}
Also used : IPath(org.eclipse.core.runtime.IPath) TomcatServerBehaviour(org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour) TomcatServer(org.eclipse.jst.server.tomcat.core.internal.TomcatServer)

Example 2 with TomcatServerBehaviour

use of org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour in project webtools.servertools by eclipse.

the class AbstractTomcatServerTestCase method verifyLegacyRemovePublish.

/**
 * @throws Exception
 */
public void verifyLegacyRemovePublish() throws Exception {
    IModule webModule = ModuleTestCase.webModule;
    IServerWorkingCopy wc = getServer().createWorkingCopy();
    // Unset the deployment directory
    ((TomcatServer) wc.loadAdapter(TomcatServer.class, null)).setDeployDirectory(null);
    wc.modifyModules(null, new IModule[] { webModule }, null);
    wc.save(true, null);
    getServer().publish(IServer.PUBLISH_FULL, null);
    TomcatServerBehaviour tsb = getTomcatServerBehaviour();
    IPath baseDir = tsb.getRuntimeBaseDirectory();
    IPath moduleDir = baseDir.append("webapps").append(ModuleTestCase.webModule.getName());
    assertFalse(moduleDir.toFile().exists());
}
Also used : IModule(org.eclipse.wst.server.core.IModule) IPath(org.eclipse.core.runtime.IPath) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) TomcatServerBehaviour(org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour) TomcatServer(org.eclipse.jst.server.tomcat.core.internal.TomcatServer)

Example 3 with TomcatServerBehaviour

use of org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour in project webtools.servertools by eclipse.

the class AbstractTomcatServerTestCase method verifyDefaultRemovePublish.

/**
 * @throws Exception
 */
public void verifyDefaultRemovePublish() throws Exception {
    IModule webModule = ModuleTestCase.webModule;
    IServerWorkingCopy wc = getServer().createWorkingCopy();
    wc.modifyModules(null, new IModule[] { webModule }, null);
    wc.save(true, null);
    getServer().publish(IServer.PUBLISH_FULL, null);
    TomcatServerBehaviour tsb = getTomcatServerBehaviour();
    IPath baseDir = tsb.getRuntimeBaseDirectory();
    IPath moduleDir = baseDir.append(ITomcatServerWorkingCopy.DEFAULT_DEPLOYDIR).append(ModuleTestCase.webModule.getName());
    assertFalse(moduleDir.toFile().exists());
}
Also used : IModule(org.eclipse.wst.server.core.IModule) IPath(org.eclipse.core.runtime.IPath) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) TomcatServerBehaviour(org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour)

Example 4 with TomcatServerBehaviour

use of org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour in project webtools.servertools by eclipse.

the class AbstractTomcatServerTestCase method verifyDefaultAddPublish.

/**
 * @throws Exception
 */
public void verifyDefaultAddPublish() throws Exception {
    IModule webModule = ModuleTestCase.webModule;
    IServerWorkingCopy wc = getServer().createWorkingCopy();
    wc.modifyModules(new IModule[] { webModule }, null, null);
    wc.save(true, null);
    getServer().publish(IServer.PUBLISH_FULL, null);
    TomcatServerBehaviour tsb = getTomcatServerBehaviour();
    IPath baseDir = tsb.getRuntimeBaseDirectory();
    IPath moduleDir = baseDir.append(ITomcatServerWorkingCopy.DEFAULT_DEPLOYDIR).append(ModuleTestCase.webModule.getName());
    assertTrue(moduleDir.toFile().exists());
    verifyPublishedModule(baseDir, ModuleTestCase.webModule);
}
Also used : IModule(org.eclipse.wst.server.core.IModule) IPath(org.eclipse.core.runtime.IPath) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) TomcatServerBehaviour(org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour)

Example 5 with TomcatServerBehaviour

use of org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour in project webtools.servertools by eclipse.

the class AbstractTomcatServerTestCase method verifyLegacyAddPublish.

/**
 * @throws Exception
 */
public void verifyLegacyAddPublish() throws Exception {
    IModule webModule = ModuleTestCase.webModule;
    IServerWorkingCopy wc = getServer().createWorkingCopy();
    // Unset the deployment directory
    ((TomcatServer) wc.loadAdapter(TomcatServer.class, null)).setDeployDirectory(null);
    wc.modifyModules(new IModule[] { webModule }, null, null);
    wc.save(true, null);
    getServer().publish(IServer.PUBLISH_FULL, null);
    TomcatServerBehaviour tsb = getTomcatServerBehaviour();
    IPath baseDir = tsb.getRuntimeBaseDirectory();
    IPath moduleDir = baseDir.append("webapps").append(ModuleTestCase.webModule.getName());
    assertTrue(moduleDir.toFile().exists());
    verifyPublishedModule(baseDir, ModuleTestCase.webModule);
}
Also used : IModule(org.eclipse.wst.server.core.IModule) IPath(org.eclipse.core.runtime.IPath) IServerWorkingCopy(org.eclipse.wst.server.core.IServerWorkingCopy) TomcatServerBehaviour(org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour) TomcatServer(org.eclipse.jst.server.tomcat.core.internal.TomcatServer)

Aggregations

IPath (org.eclipse.core.runtime.IPath)6 TomcatServerBehaviour (org.eclipse.jst.server.tomcat.core.internal.TomcatServerBehaviour)6 TomcatServer (org.eclipse.jst.server.tomcat.core.internal.TomcatServer)4 IModule (org.eclipse.wst.server.core.IModule)4 IServerWorkingCopy (org.eclipse.wst.server.core.IServerWorkingCopy)4 IServer (org.eclipse.wst.server.core.IServer)1 Server (org.eclipse.wst.server.core.internal.Server)1