Issue #6021 - Fixing test case

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2021-03-02 14:53:58 -06:00
parent 613e0ecd54
commit 927dc60983
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 16 additions and 8 deletions

View File

@ -1622,15 +1622,23 @@ public class XmlConfigurationTest
" </Set>" + " </Set>" +
"</Configure>"); "</Configure>");
configuration.setJettyStandardIdsAndProperties(null, Resource.newResource(war)); try
configuration.getProperties().put("jetty.base", "/var/lib/jetty-base"); {
if (configValue != null) configuration.setJettyStandardIdsAndProperties(null, Resource.newResource(war));
configuration.getProperties().put("jetty.sslContext.keyStorePath", configValue); configuration.getProperties().put("jetty.base", "/var/lib/jetty-base");
if (configValue != null)
configuration.getProperties().put("jetty.sslContext.keyStorePath", configValue);
TestConfiguration tc = new TestConfiguration(); TestConfiguration tc = new TestConfiguration();
configuration.configure(tc); configuration.configure(tc);
assertThat(tc.getTestString(), is(expectedPath)); assertThat(tc.getTestString(), is(expectedPath));
}
finally
{
// cleanup after myself
configuration.getProperties().remove("jetty.base");
}
} }
@Test @Test
@ -1658,7 +1666,7 @@ public class XmlConfigurationTest
FS.ensureDeleted(testPath); FS.ensureDeleted(testPath);
Path baseDir = testPath.resolve("bogus"); Path baseDir = testPath.resolve("bogus");
String resolved = XmlConfiguration.resolvePath(baseDir.toString(), "etc/keystore"); String resolved = XmlConfiguration.resolvePath(baseDir.toString(), "etc/keystore");
assertNull(resolved, "Should be null as baseDir does not exist"); assertEquals(baseDir.resolve("etc/keystore").toString(), resolved);
} }
private ByteArrayOutputStream captureLoggingBytes(ThrowableAction action) throws Exception private ByteArrayOutputStream captureLoggingBytes(ThrowableAction action) throws Exception