use of org.ops4j.store.intern.TemporaryStore in project karaf by apache.
the class KarafMinimalMonitoredTestSupport method baseConfig.
public Option[] baseConfig() throws Exception {
MavenArtifactUrlReference karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf-minimal").versionAsInProject().type("tar.gz");
String rmiRegistryPort = Integer.toString(KarafTestSupport.getAvailablePort(Integer.parseInt(MIN_RMI_REG_PORT), Integer.parseInt(MAX_RMI_REG_PORT)));
String rmiServerPort = Integer.toString(KarafTestSupport.getAvailablePort(Integer.parseInt(MIN_RMI_SERVER_PORT), Integer.parseInt(MAX_RMI_SERVER_PORT)));
Store<InputStream> store = new TemporaryStore(new File("target/exam"), false);
Handle handle = store.store(createMonitorBundle());
URL url = store.getLocation(handle).toURL();
return new Option[] { karafDistributionConfiguration().frameworkUrl(karafUrl).name("Apache Karaf").unpackDirectory(new File("target/exam")), // enable JMX RBAC security, thanks to the KarafMBeanServerBuilder
configureSecurity().disableKarafMBeanServerBuilder(), logLevel(LogLevelOption.LogLevel.INFO), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort), editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort), editConfigurationFilePut("etc/startup.properties", "file:../../" + new File(url.toURI()).getName(), "1"), composite(editConfigurationFilePut("etc/org.apache.karaf.features.cfg", new File("target/test-classes/etc/org.apache.karaf.features.cfg"))) };
}
Aggregations