jetty-start / fixing BaseHomeTest failure

This commit is contained in:
Joakim Erdfelt 2013-08-29 08:54:12 -07:00
parent fad7f94619
commit de4febf1b9
4 changed files with 23 additions and 17 deletions

View File

@ -76,7 +76,7 @@ public class BaseHome
try try
{ {
this.homeDir = homeDir.getCanonicalFile(); this.homeDir = homeDir.getCanonicalFile();
this.baseDir = baseDir == null?homeDir:baseDir.getCanonicalFile(); this.baseDir = baseDir == null?this.homeDir:baseDir.getCanonicalFile();
} }
catch (IOException e) catch (IOException e)
{ {

View File

@ -59,23 +59,28 @@ Module Management:
o The ${jetty.base}/start.d/*.ini files o The ${jetty.base}/start.d/*.ini files
--module=<modulename> --module=<modulename>
Will temporarily enable a module from the command line. Temporarily enable a module from the command line.
Note: this can also be used in the ${jetty.base}/start.ini Note: this can also be used in the ${jetty.base}/start.ini
or ${jetty.base}/start.d/*.ini files. or ${jetty.base}/start.d/*.ini files.
--module-ini=<modulename> --module-ini=<modulename>
Will enable a module by adding an ini file to the Enable a module via creation of an ini file in the
${jetty.base}/start.d/ directory from the template ${jetty.base}/start.d/ directory.
contained in the module definition. Transitive Uses ini template that the module itself maintains.
dependencies are followed and ini files are created Transitive module dependencies are followed and all
for them if they too have a ini template. modules that the specified module depends on are also
enabled via their own ini files in the same directory.
Note: not all modules have ini templates.
--module-start-ini=<modulename> --module-start-ini=<modulename>
Will enable a module by appending lines to the Enable a module by appending lines to the
${jetty.base}/start.ini file from the template ${jetty.base}/start.ini file.
contained in the module definition. Transitive Lines that are added come from the ini template that
dependencies are followed and lines are appended the module itself maintains.
for them if they too have a ini template. Transitive module dependencies are followed and all
modules that the specified module depends on are also
enabled in the ${jetty.base}/start.ini using the same
techniques.
Startup / Shutdown Command Line: Startup / Shutdown Command Line:
-------------------------------- --------------------------------

View File

@ -39,7 +39,7 @@ public class BaseHomeTest
{ {
actual.add(hb.toShortForm(file)); actual.add(hb.toShortForm(file));
} }
Assert.assertThat(message,actual,containsInAnyOrder(expected.toArray())); Assert.assertThat(message + ": " + Main.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
} }
@Test @Test
@ -84,7 +84,7 @@ public class BaseHomeTest
File baseDir = null; File baseDir = null;
BaseHome hb = new BaseHome(homeDir,baseDir); BaseHome hb = new BaseHome(homeDir,baseDir);
List<File> files = hb.listFiles("/start.d", new FS.IniFilter()); List<File> files = hb.listFiles("/start.d",new FS.IniFilter());
List<String> expected = new ArrayList<>(); List<String> expected = new ArrayList<>();
expected.add("${jetty.home}/start.d/jmx.ini"); expected.add("${jetty.home}/start.d/jmx.ini");
@ -120,6 +120,8 @@ public class BaseHomeTest
public void testDefault() throws IOException public void testDefault() throws IOException
{ {
BaseHome bh = new BaseHome(); BaseHome bh = new BaseHome();
Assert.assertThat("Home",bh.getHome(),notNullValue());
Assert.assertThat("Base",bh.getBase(),notNullValue());
} }
@Test @Test

View File

@ -67,5 +67,4 @@ public class TestUseCases
{ {
assertUseCase("home","base.with.db","assert-with-db.txt"); assertUseCase("home","base.with.db","assert-with-db.txt");
} }
} }