WIP fix quickstart tests

This commit is contained in:
Jan Bartel 2022-07-08 12:47:49 +10:00
parent 2129666236
commit e31166f333
4 changed files with 10 additions and 20 deletions

View File

@ -100,14 +100,9 @@ public class QuickStartConfiguration extends AbstractConfiguration
//Get the mode //Get the mode
Object o = context.getAttribute(MODE); Object o = context.getAttribute(MODE);
Mode mode; _mode = (o instanceof Mode m)
if (o instanceof Mode) ? m
mode = (Mode)o; : (o instanceof String s) ? Mode.valueOf(s) : _mode;
else
mode = Mode.valueOf((String)o);
if (mode != null)
_mode = mode;
_quickStart = false; _quickStart = false;

View File

@ -137,7 +137,7 @@ public class TestQuickStart
// quick start // quick start
WebAppContext webapp = new WebAppContext(); WebAppContext webapp = new WebAppContext();
webapp.addConfiguration(new QuickStartConfiguration()); webapp.addConfiguration(new QuickStartConfiguration());
quickstart.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
webapp.setBaseResource(testDir.toPath()); webapp.setBaseResource(testDir.toPath());
webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee10.quickstart."); webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee10.quickstart.");
server.setHandler(webapp); server.setHandler(webapp);
@ -178,7 +178,7 @@ public class TestQuickStart
// quick start // quick start
WebAppContext webapp = new WebAppContext(); WebAppContext webapp = new WebAppContext();
webapp.addConfiguration(new QuickStartConfiguration()); webapp.addConfiguration(new QuickStartConfiguration());
quickstart.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
webapp.setBaseResource(testDir.toPath()); webapp.setBaseResource(testDir.toPath());
webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee10.quickstart."); webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee10.quickstart.");
server.setHandler(webapp); server.setHandler(webapp);

View File

@ -100,14 +100,9 @@ public class QuickStartConfiguration extends AbstractConfiguration
//Get the mode //Get the mode
Object o = context.getAttribute(MODE); Object o = context.getAttribute(MODE);
Mode mode; _mode = (o instanceof Mode m)
if (o instanceof Mode) ? m
mode = (Mode)o; : (o instanceof String s) ? Mode.valueOf(s) : _mode;
else
mode = Mode.valueOf((String)o);
if (mode != null)
_mode = mode;
_quickStart = false; _quickStart = false;

View File

@ -137,7 +137,7 @@ public class TestQuickStart
// quick start // quick start
WebAppContext webapp = new WebAppContext(); WebAppContext webapp = new WebAppContext();
webapp.addConfiguration(new QuickStartConfiguration()); webapp.addConfiguration(new QuickStartConfiguration());
quickstart.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
webapp.setResourceBase(testDir.getAbsolutePath()); webapp.setResourceBase(testDir.getAbsolutePath());
webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart."); webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
server.setHandler(webapp); server.setHandler(webapp);
@ -178,7 +178,7 @@ public class TestQuickStart
// quick start // quick start
WebAppContext webapp = new WebAppContext(); WebAppContext webapp = new WebAppContext();
webapp.addConfiguration(new QuickStartConfiguration()); webapp.addConfiguration(new QuickStartConfiguration());
quickstart.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART); webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.QUICKSTART);
webapp.setResourceBase(testDir.getAbsolutePath()); webapp.setResourceBase(testDir.getAbsolutePath());
webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart."); webapp.getServerClassMatcher().exclude("org.eclipse.jetty.ee9.quickstart.");
server.setHandler(webapp); server.setHandler(webapp);