本文整理了Java中org.codehaus.cargo.container.deployable.WAR.getContext()
方法的一些代码示例,展示了WAR.getContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WAR.getContext()
方法的具体详情如下:
包路径:org.codehaus.cargo.container.deployable.WAR
类名称:WAR
方法名:getContext
暂无
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jetty
/**
* Get the context path for the webapp.
*
* @param deployable the deployable
* @return the context path
*/
public static String getContext(Deployable deployable)
{
return "/" + ((WAR) deployable).getContext();
}
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Returns the name of this deployable. For WAR file it is its context.
* @return the name of this deployable
*/
@Override
public String getName()
{
return getContext();
}
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Get the context path for the webapp.
*
* @param deployable the deployable
* @return the context path
*/
public static String getContext(Deployable deployable)
{
return "/" + ((WAR) deployable).getContext();
}
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat
/**
* Used by {@link TomcatEmbeddedLocalDeployer} to register {@link Deployable}s that are to be
* deployed once the container is started.
*
* @param deployable {@link Deployable} to be deployed later.
*/
public void scheduleDeployment(Deployable deployable)
{
WAR war = (WAR) deployable;
scheduledDeployables.put(war.getContext(), war);
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Used by {@link TomcatEmbeddedLocalDeployer} to register {@link Deployable}s that are to be
* deployed once the container is started.
*
* @param deployable {@link Deployable} to be deployed later.
*/
public void scheduleDeployment(Deployable deployable)
{
WAR war = (WAR) deployable;
scheduledDeployables.put(war.getContext(), war);
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Adds context parameter if deployable is WAR file.
* @param arguments Arguments passed to configuration script.
*/
private void addContext(StringBuffer arguments)
{
if (deployable instanceof WAR)
{
arguments.append(",'-contextroot','");
arguments.append(((WAR) deployable).getContext());
arguments.append("'");
}
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* @return the context defined in <code>context.xml</code> if any. If there is no
* <code>context.xml</code> or if it doesn't define any root context, then return
* {@link WAR#getContext()}.
*/
@Override
public synchronized String getContext()
{
String result = parseTomcatContextXml();
if (result == null)
{
result = super.getContext();
}
return result;
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat
/**
* {@inheritDoc}
*/
@Override
public void stop(Deployable deployable)
{
WAR war = (WAR) deployable;
container.getHost().findChild(war.getContext()).setAvailable(false);
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat
/**
* {@inheritDoc}
*/
@Override
public void start(Deployable deployable)
{
WAR war = (WAR) deployable;
container.getHost().findChild(war.getContext()).setAvailable(true);
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* {@inheritDoc}
*/
@Override
public void stop(Deployable deployable)
{
WAR war = (WAR) deployable;
container.getHost().findChild(war.getContext()).setAvailable(false);
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* {@inheritDoc}
*/
@Override
public void start(Deployable deployable)
{
WAR war = (WAR) deployable;
container.getHost().findChild(war.getContext()).setAvailable(true);
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* {@inheritDoc}
*/
@Override
public void undeploy(Deployable deployable)
{
WAR war = (WAR) deployable;
TomcatEmbedded.Context context = container.getHost().findChild(war.getContext());
container.getHost().removeChild(context);
}
代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat
/**
* {@inheritDoc}
*/
@Override
public void undeploy(Deployable deployable)
{
WAR war = (WAR) deployable;
TomcatEmbedded.Context context = container.getHost().findChild(war.getContext());
container.getHost().removeChild(context);
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Test context when WAR has an extension.
*/
public void testGetContextWhenWarHasExtension()
{
WAR war = new WAR("c:/some/path/to/war/test.war");
assertEquals("test", war.getContext());
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Test context when WAR has no extension.
*/
public void testGetContextWhenWarHasNoExtension()
{
WAR war = new WAR("/some/path/to/war/test");
assertEquals("test", war.getContext());
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Test WAR context overriden with a slash in the middhe.
*/
public void testGetContextWhenOverrideAndMiddleSlash()
{
WAR war = new WAR("c:/some/path/to/war/test.war");
war.setContext("/a/b");
assertEquals("a/b", war.getContext());
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Test overriden WAR context.
*/
public void testGetContextWhenOverride()
{
WAR war = new WAR("c:/some/path/to/war/test.war");
war.setContext("context");
assertEquals("context", war.getContext());
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Test WAR context overriden with a leading slash.
*/
public void testGetContextWhenOverrideAndLeadingSlash()
{
WAR war = new WAR("c:/some/path/to/war/test.war");
war.setContext("/");
assertEquals("", war.getContext());
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Test logger when getting WAR context.
*/
public void testLoggerWhenCallingGetContext()
{
MockLogger logger = new MockLogger();
WAR war = new WAR("c:/test.war");
war.setLogger(logger);
// Calling getContext just to trigger the log
war.getContext();
assertEquals(1, logger.severities.size());
assertEquals("debug", logger.severities.get(0));
assertEquals("Parsed web context = [test]", logger.messages.get(0));
assertEquals("org.codehaus.cargo.container.deployable.WAR", logger.categories.get(0));
}
代码示例来源:origin: codehaus-cargo/cargo
/**
* Verify that WAR context change works.
* @throws Exception If anything goes wrong.
*/
public void testChangeWarContextAndDeployUndeployRemotely() throws Exception
{
this.war.setContext("simple");
URL warPingURL = new URL("http://localhost:" + getTestData().port + "/"
+ this.war.getContext() + "/index.jsp");
deployer.deploy(this.war);
PingUtils.assertPingTrue("simple war not correctly deployed", warPingURL, getLogger());
deployer.undeploy(this.war);
PingUtils.assertPingFalse("simple war not correctly undeployed", warPingURL, getLogger());
}
内容来源于网络,如有侵权,请联系作者删除!