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
Object o = context.getAttribute(MODE);
Mode mode;
if (o instanceof Mode)
mode = (Mode)o;
else
mode = Mode.valueOf((String)o);
if (mode != null)
_mode = mode;
_mode = (o instanceof Mode m)
? m
: (o instanceof String s) ? Mode.valueOf(s) : _mode;
_quickStart = false;

View File

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

View File

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

View File

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