From 4f947c7ee5f4c1221cc9d50cad9bae5b6c821a72 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Mon, 21 May 2018 16:29:51 -0500 Subject: [PATCH] Issue #2556 - Adding Testcase to verify report Signed-off-by: Joakim Erdfelt --- .../org/eclipse/jetty/start/MainTest.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java index 05e9c1fc22f..78157e3792b 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java @@ -19,6 +19,8 @@ package org.eclipse.jetty.start; import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; @@ -68,11 +70,20 @@ public class MainTest // args.getProperties().forEach(p->System.err.println(p)); // System.err.println("BaseHome.props:"); // baseHome.getConfigSources().getProps().forEach(p->System.err.println(p)); - - assertThat(args.getProperties().getString("jetty.home"),is(baseHome.getHome())); - assertThat(args.getProperties().getString("jetty.home.uri")+"/",is(baseHome.getHomePath().toUri().toString())); - assertThat(args.getProperties().getString("jetty.base"),is(baseHome.getBase())); - assertThat(args.getProperties().getString("jetty.base.uri")+"/",is(baseHome.getBasePath().toUri().toString())); + + Props props = args.getProperties(); + + assertThat("Props(jetty.home)", props.getString("jetty.home"),is(baseHome.getHome())); + assertThat("Props(jetty.home)", props.getString("jetty.home"),is(not(startsWith("file:")))); + assertThat("Props(jetty.home.uri)", props.getString("jetty.home.uri")+"/",is(baseHome.getHomePath().toUri().toString())); + assertThat("Props(jetty.base)", props.getString("jetty.base"),is(baseHome.getBase())); + assertThat("Props(jetty.base)", props.getString("jetty.base"),is(not(startsWith("file:")))); + assertThat("Props(jetty.base.uri)", props.getString("jetty.base.uri")+"/",is(baseHome.getBasePath().toUri().toString())); + + assertThat("System.getProperty(jetty.home)", System.getProperty("jetty.home"), is(baseHome.getHome())); + assertThat("System.getProperty(jetty.home)", System.getProperty("jetty.home"), is(not(startsWith("file:")))); + assertThat("System.getProperty(jetty.base)", System.getProperty("jetty.base"), is(baseHome.getBase())); + assertThat("System.getProperty(jetty.base)", System.getProperty("jetty.base"), is(not(startsWith("file:")))); } @Test