@Configuration public static Option[] configuration() { MavenArtifactUrlReference karafUrl = maven() .groupId("org.apache.karaf") .artifactId("apache-karaf") .version("4.0.2") .type("tar.gz"); return new Option[] { karafDistributionConfiguration() .frameworkUrl(karafUrl) .karafVersion("4.0.2") .name("Apache Karaf") .useDeployFolder(false) // .runEmbedded(true) .unpackDirectory(new File("target/pax/")), KarafDistributionOption.keepRuntimeFolder(), // debugConfiguration(), // nor this systemProperty("java.awt.headless").value("true"), features( maven() .groupId("com.basistech") .artifactId("hibernate-validation") .classifier("features") .type("xml") .version("0.0.1-SNAPSHOT"), "hibernate-validation"), logLevel(LogLevelOption.LogLevel.INFO), junitBundles(), systemProperty("pax.exam.osgi.unresolved.fail").value("true"), systemProperty("org.ops4j.pax.exam.rbc.rmi.host").value("localhost") }; }
protected Option[] configureConfigurationPorts() throws URISyntaxException, IOException { return options( editConfigurationFilePut("etc/system.properties", "urlScheme", "https"), editConfigurationFilePut("etc/system.properties", "host", "localhost"), editConfigurationFilePut("etc/system.properties", "jetty.port", HTTPS_PORT.getPort()), editConfigurationFilePut("etc/system.properties", "hostContext", "/solr"), editConfigurationFilePut("etc/system.properties", "ddf.home", "${karaf.home}"), editConfigurationFilePut( "etc/users.properties", SYSTEM_ADMIN_USER, SYSTEM_ADMIN_USER_PASSWORD + ",system-admin"), editConfigurationFilePut( "etc/system.properties", HTTP_PORT.getSystemProperty(), HTTP_PORT.getPort()), editConfigurationFilePut( "etc/system.properties", HTTPS_PORT.getSystemProperty(), HTTPS_PORT.getPort()), editConfigurationFilePut( "etc/system.properties", DEFAULT_PORT.getSystemProperty(), DEFAULT_PORT.getPort()), editConfigurationFilePut( "etc/system.properties", BASE_PORT.getSystemProperty(), BASE_PORT.getPort()), // DDF-1572: Disables the periodic backups of .bundlefile. In itests, having those // backups serves no purpose and it appears that intermittent failures have occurred // when the background thread attempts to create the backup before the exam bundle // is completely exploded. editConfigurationFilePut( "etc/system.properties", "eclipse.enableStateSaver", Boolean.FALSE.toString()), editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", SSH_PORT.getPort()), editConfigurationFilePut("etc/ddf.platform.config.cfg", "port", HTTPS_PORT.getPort()), editConfigurationFilePut("etc/ddf.platform.config.cfg", "host", "localhost"), editConfigurationFilePut( "etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT.getPort()), editConfigurationFilePut( "etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port.secure", HTTPS_PORT.getPort()), editConfigurationFilePut( "etc/org.apache.karaf.management.cfg", "rmiRegistryPort", RMI_REG_PORT.getPort()), editConfigurationFilePut( "etc/org.apache.karaf.management.cfg", "rmiServerPort", RMI_SERVER_PORT.getPort()), installStartupFile( getClass().getClassLoader().getResourceAsStream("hazelcast.xml"), "/etc/hazelcast.xml"), installStartupFile( getClass() .getClassLoader() .getResourceAsStream("ddf.security.sts.client.configuration.config"), "/etc/ddf.security.sts.client.configuration.config"), KarafDistributionOption.editConfigurationFilePut( "etc/ddf.security.sts.client.configuration.config", "address", "\"" + SECURE_ROOT + HTTPS_PORT.getPort() + "/services/SecurityTokenService?wsdl" + "\""), installStartupFile( getClass() .getClassLoader() .getResourceAsStream("ddf.catalog.solr.external.SolrHttpCatalogProvider.config"), "/etc/ddf.catalog.solr.external.SolrHttpCatalogProvider.config")); }
@Configuration public Option[] config() { return new Option[] { new DefaultCompositeOption(fabricDistributionConfiguration()), // KarafDistributionOption.debugConfiguration("5005", true), KarafDistributionOption.editConfigurationFilePut( "etc/system.properties", "fabric.version", MavenUtils.asInProject().getVersion(GROUP_ID, ARTIFACT_ID)) }; }
/** * Make available system properties that are configured for the test, to the test container. * * <p>Note: If not obvious the container runs in in forked mode and thus system properties passed * form command line or surefire plugin are not available to the container without an approach * like this. */ public static Option copySystemProperty(String propertyName) { return KarafDistributionOption.editConfigurationFilePut( "etc/system.properties", propertyName, System.getProperty(propertyName) != null ? System.getProperty(propertyName) : ""); }
public Option[] baseConfig() { return new Option[] { karafDistributionConfiguration() .frameworkUrl(mvnKarafDist()) .unpackDirectory(new File("target/paxexam/unpack/")) .useDeployFolder(false), // debugConfiguration("5005", true), configureConsole().ignoreLocalConsole(), when(isEquinox()) .useOptions( editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK, "equinox"), systemProperty("pax.exam.framework").value(System.getProperty("pax.exam.framework")), systemProperty("osgi.console").value("6666"), systemProperty("osgi.console.enable.builtin").value("true")), logLevel(LogLevel.INFO), keepRuntimeFolder(), editConfigurationFilePut( "etc/org.apache.karaf.management.cfg", "rmiRegistryPort", RMI_REG_PORT), editConfigurationFilePut( "etc/org.apache.karaf.management.cfg", "rmiServerPort", RMI_SERVER_PORT), KarafDistributionOption.replaceConfigurationFile( "etc/keystore", new File("src/test/resources/keystore")), systemProperty("ProjectVersion").value(getProjectVersion()), addCodeCoverageOption(), /*features( maven().groupId("org.ops4j.pax.web") .artifactId("pax-web-features").type("xml") .classifier("features").versionAsInProject(), "pax-war"),*/ mavenBundle() .groupId("org.ops4j.pax.web.itest") .artifactId("pax-web-itest-base") .versionAsInProject(), // new ExamBundlesStartLevel(4), wrappedBundle(mavenBundle("org.apache.httpcomponents", "httpcore").version(asInProject())), wrappedBundle(mavenBundle("org.apache.httpcomponents", "httpmime").version(asInProject())), wrappedBundle(mavenBundle("org.apache.httpcomponents", "httpclient").version(asInProject())), mavenBundle() .groupId("commons-beanutils") .artifactId("commons-beanutils") .version(asInProject()), mavenBundle() .groupId("commons-collections") .artifactId("commons-collections") .version(asInProject()), mavenBundle().groupId("commons-codec").artifactId("commons-codec").version(asInProject()), mavenBundle() .groupId("org.apache.servicemix.bundles") .artifactId("org.apache.servicemix.bundles.commons-digester") .version("1.8_4"), mavenBundle() .groupId("org.apache.geronimo.bundles") .artifactId("commons-discovery") .version("0.4_1"), mavenBundle() .groupId("org.apache.servicemix.specs") .artifactId("org.apache.servicemix.specs.jsr303-api-1.0.0") .version(asInProject()) }; }