use of org.codehaus.plexus.interpolation.SimpleRecursionInterceptor in project indy by Commonjava.
the class AbstractKojiIT method initTestConfig.
@Override
protected void initTestConfig(CoreServerFixture fixture) throws IOException {
super.initTestConfig(fixture);
withNewClient((client) -> {
try {
File clientKeyCertPem = getClientKeyCertPem(client);
File serverCertsPem = getServerCertsPem(client);
Properties properties = System.getProperties();
properties.setProperty("client.pem", clientKeyCertPem.getAbsolutePath());
properties.setProperty("server.pem", serverCertsPem.getAbsolutePath());
properties.setProperty("hub.url", formatSSLUrl("kojihub"));
properties.setProperty("storage.url", formatSSLUrl("kojifiles"));
properties.setProperty("extra.config", getKojiExtraConfig());
StringSearchInterpolator ssi = new StringSearchInterpolator();
ssi.addValueSource(new PropertiesBasedValueSource(properties));
RecursionInterceptor ri = new SimpleRecursionInterceptor();
String kojiConf = readTestResource("test-koji.conf");
try {
kojiConf = ssi.interpolate(kojiConf, ri);
} catch (InterpolationException e) {
e.printStackTrace();
fail("Interpolation of test koji.conf failed!");
}
writeConfigFile("conf.d/koji.conf", kojiConf);
} catch (IOException e) {
e.printStackTrace();
fail("Cannot setup SSL config files for Koji.");
}
});
}
Aggregations