Search in sources :

Example 6 with TomcatServerBehaviour

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

the class AbstractTomcatServerTestCase method verifyLegacyDeployConfig.

/**
 * Verify configuration when deployment directory is unset.
 * Deployment directory should default to "webapps".
 * @throws Exception
 */
public void verifyLegacyDeployConfig() throws Exception {
    TomcatServer ts = getTomcatServer();
    assertNotNull(ts);
    ts.setDeployDirectory("webapps");
    TomcatServerBehaviour tsb = getTomcatServerBehaviour();
    assertNotNull(tsb);
    assertEquals("webapps", ts.getDeployDirectory());
    // Verify that legacy setting results in attribute removal
    Server svr = (Server) getServer().loadAdapter(Server.class, null);
    assertNotNull(svr);
    String attr = svr.getAttribute("webapps", (String) null);
    assertNull(attr);
    IPath tempDir = tsb.getTempDirectory();
    IPath baseDir = tsb.getRuntimeBaseDirectory();
    assertEquals(tempDir, baseDir);
    IPath deployDir = tsb.getServerDeployDirectory();
    assertEquals(baseDir.append("webapps"), deployDir);
}
Also used : TomcatServer(org.eclipse.jst.server.tomcat.core.internal.TomcatServer) IServer(org.eclipse.wst.server.core.IServer) Server(org.eclipse.wst.server.core.internal.Server) IPath(org.eclipse.core.runtime.IPath) 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