Search in sources :

Example 1 with TemporaryStore

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"))) };
}
Also used : TemporaryStore(org.ops4j.store.intern.TemporaryStore) InputStream(java.io.InputStream) Option(org.ops4j.pax.exam.Option) LogLevelOption(org.ops4j.pax.exam.karaf.options.LogLevelOption) File(java.io.File) URL(java.net.URL) MavenArtifactUrlReference(org.ops4j.pax.exam.options.MavenArtifactUrlReference) Handle(org.ops4j.store.Handle)

Aggregations

File (java.io.File)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 Option (org.ops4j.pax.exam.Option)1 LogLevelOption (org.ops4j.pax.exam.karaf.options.LogLevelOption)1 MavenArtifactUrlReference (org.ops4j.pax.exam.options.MavenArtifactUrlReference)1 Handle (org.ops4j.store.Handle)1 TemporaryStore (org.ops4j.store.intern.TemporaryStore)1