From de4febf1b9978010e9b4d702c12eee7d25b5332a Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 29 Aug 2013 08:54:12 -0700 Subject: [PATCH] jetty-start / fixing BaseHomeTest failure --- .../org/eclipse/jetty/start/BaseHome.java | 2 +- .../org/eclipse/jetty/start/usage.txt | 27 +++++++++++-------- .../org/eclipse/jetty/start/BaseHomeTest.java | 10 ++++--- .../org/eclipse/jetty/start/TestUseCases.java | 1 - 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHome.java b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHome.java index f68fd39ee00..3cd5199601b 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHome.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseHome.java @@ -76,7 +76,7 @@ public class BaseHome try { this.homeDir = homeDir.getCanonicalFile(); - this.baseDir = baseDir == null?homeDir:baseDir.getCanonicalFile(); + this.baseDir = baseDir == null?this.homeDir:baseDir.getCanonicalFile(); } catch (IOException e) { diff --git a/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt b/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt index 6c9f975e1b7..6817c422e8e 100644 --- a/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt +++ b/jetty-start/src/main/resources/org/eclipse/jetty/start/usage.txt @@ -59,23 +59,28 @@ Module Management: o The ${jetty.base}/start.d/*.ini files --module= - 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 or ${jetty.base}/start.d/*.ini files. --module-ini= - Will enable a module by adding an ini file to the - ${jetty.base}/start.d/ directory from the template - contained in the module definition. Transitive - dependencies are followed and ini files are created - for them if they too have a ini template. + Enable a module via creation of an ini file in the + ${jetty.base}/start.d/ directory. + Uses ini template that the module itself maintains. + Transitive module dependencies are followed and all + 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= - Will enable a module by appending lines to the - ${jetty.base}/start.ini file from the template - contained in the module definition. Transitive - dependencies are followed and lines are appended - for them if they too have a ini template. + Enable a module by appending lines to the + ${jetty.base}/start.ini file. + Lines that are added come from the ini template that + the module itself maintains. + 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: -------------------------------- diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java index 773d91be1e8..e7f3e956ee2 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java @@ -39,7 +39,7 @@ public class BaseHomeTest { actual.add(hb.toShortForm(file)); } - Assert.assertThat(message,actual,containsInAnyOrder(expected.toArray())); + Assert.assertThat(message + ": " + Main.join(actual,", "),actual,containsInAnyOrder(expected.toArray())); } @Test @@ -76,7 +76,7 @@ public class BaseHomeTest assertFileList(hb,"Files found",expected,files); } - + @Test public void testListFiles_Filtered_OnlyHome() throws IOException { @@ -84,7 +84,7 @@ public class BaseHomeTest File baseDir = null; BaseHome hb = new BaseHome(homeDir,baseDir); - List files = hb.listFiles("/start.d", new FS.IniFilter()); + List files = hb.listFiles("/start.d",new FS.IniFilter()); List expected = new ArrayList<>(); expected.add("${jetty.home}/start.d/jmx.ini"); @@ -120,8 +120,10 @@ public class BaseHomeTest public void testDefault() throws IOException { BaseHome bh = new BaseHome(); + Assert.assertThat("Home",bh.getHome(),notNullValue()); + Assert.assertThat("Base",bh.getBase(),notNullValue()); } - + @Test public void testGetFile_Both() throws IOException { diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java index 609f815eef9..ebc67361be7 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java @@ -67,5 +67,4 @@ public class TestUseCases { assertUseCase("home","base.with.db","assert-with-db.txt"); } - }