use of org.eclipse.jetty.deploy.test.XmlConfiguredJetty in project jetty.project by eclipse.
the class DeploymentManagerTest method testXmlConfigured.
@Test
public void testXmlConfigured() throws Exception {
XmlConfiguredJetty jetty = null;
try {
jetty = new XmlConfiguredJetty(testdir);
jetty.addConfiguration("jetty.xml");
jetty.addConfiguration("jetty-http.xml");
jetty.addConfiguration("jetty-deploymgr-contexts.xml");
// Should not throw an Exception
jetty.load();
// Start it
jetty.start();
} finally {
if (jetty != null) {
try {
jetty.stop();
} catch (Exception ignore) {
// ignore
}
}
}
}
use of org.eclipse.jetty.deploy.test.XmlConfiguredJetty in project jetty.project by eclipse.
the class WebAppProviderTest method setupEnvironment.
@Before
public void setupEnvironment() throws Exception {
jetty = new XmlConfiguredJetty(testdir);
jetty.addConfiguration("jetty.xml");
jetty.addConfiguration("jetty-http.xml");
jetty.addConfiguration("jetty-deploy-wars.xml");
// Setup initial context
jetty.copyWebapp("foo-webapp-1.war", "foo.war");
// Make symlink
Path pathWar3 = MavenTestingUtils.getTestResourcePathFile("webapps/foo-webapp-3.war");
Path pathBar = jetty.getJettyDir("webapps/bar.war").toPath();
try {
Files.createSymbolicLink(pathBar, pathWar3);
symlinkSupported = true;
} catch (UnsupportedOperationException | FileSystemException e) {
// if unable to create symlink, no point testing that feature
// this is the path that Microsoft Windows takes.
symlinkSupported = false;
}
// Should not throw an Exception
jetty.load();
// Start it
jetty.start();
}
use of org.eclipse.jetty.deploy.test.XmlConfiguredJetty in project jetty.project by eclipse.
the class GlobalWebappConfigBindingTest method setupEnvironment.
@Before
public void setupEnvironment() throws Exception {
jetty = new XmlConfiguredJetty(testdir);
jetty.addConfiguration("jetty.xml");
jetty.addConfiguration("jetty-http.xml");
// Setup initial context
jetty.copyWebapp("foo.xml", "foo.xml");
jetty.copyWebapp("foo-webapp-1.war", "foo.war");
}
use of org.eclipse.jetty.deploy.test.XmlConfiguredJetty in project jetty.project by eclipse.
the class ScanningAppProviderRuntimeUpdatesTest method setupEnvironment.
@Before
public void setupEnvironment() throws Exception {
testdir.ensureEmpty();
Resource.setDefaultUseCaches(false);
jetty = new XmlConfiguredJetty(testdir);
jetty.addConfiguration("jetty.xml");
jetty.addConfiguration("jetty-http.xml");
jetty.addConfiguration("jetty-deploymgr-contexts.xml");
// Should not throw an Exception
jetty.load();
// Start it
jetty.start();
// monitor tick
DeploymentManager dm = jetty.getServer().getBean(DeploymentManager.class);
for (AppProvider provider : dm.getAppProviders()) {
if (provider instanceof ScanningAppProvider) {
_providers++;
((ScanningAppProvider) provider).addScannerListener(new Scanner.ScanListener() {
public void scan() {
_scans.incrementAndGet();
}
});
}
}
}
use of org.eclipse.jetty.deploy.test.XmlConfiguredJetty in project jetty.project by eclipse.
the class ScanningAppProviderStartupTest method setupEnvironment.
@Before
public void setupEnvironment() throws Exception {
jetty = new XmlConfiguredJetty(testdir);
jetty.addConfiguration("jetty.xml");
jetty.addConfiguration("jetty-http.xml");
jetty.addConfiguration("jetty-deploymgr-contexts.xml");
// Setup initial context
jetty.copyWebapp("foo.xml", "foo.xml");
jetty.copyWebapp("foo-webapp-1.war", "foo.war");
// Should not throw an Exception
jetty.load();
// Start it
jetty.start();
}
Aggregations