use of org.eclipse.jst.server.tomcat.core.internal.TomcatServer 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());
}
use of org.eclipse.jst.server.tomcat.core.internal.TomcatServer in project webtools.servertools by eclipse.
the class ConfigurationWebModuleEditorPart method init.
/* (non-Javadoc)
* Initializes the editor part with a site and input.
*/
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
TomcatServer ts = (TomcatServer) server.loadAdapter(TomcatServer.class, null);
try {
configuration = ts.getTomcatConfiguration();
} catch (Exception e) {
// ignore
}
if (configuration != null)
addChangeListener();
if (server != null)
server2 = (ITomcatServerWorkingCopy) server.loadAdapter(ITomcatServerWorkingCopy.class, null);
initialize();
}
use of org.eclipse.jst.server.tomcat.core.internal.TomcatServer in project webtools.servertools by eclipse.
the class ConfigurationPropertyTester method test.
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
try {
IServerAttributes server = (IServerAttributes) receiver;
TomcatServer tomcatServer = (TomcatServer) server.loadAdapter(ITomcatServer.class, null);
if (tomcatServer != null)
return tomcatServer.getServerConfiguration() != null;
} catch (Exception e) {
// ignore
}
return false;
}
use of org.eclipse.jst.server.tomcat.core.internal.TomcatServer 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);
}
use of org.eclipse.jst.server.tomcat.core.internal.TomcatServer 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);
}
Aggregations