| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| package org.apache.sling.testing.paxexam; |
| |
| import org.ops4j.pax.exam.Option; |
| import org.ops4j.pax.exam.util.PathUtils; |
| |
| import static org.ops4j.pax.exam.CoreOptions.composite; |
| import static org.ops4j.pax.exam.CoreOptions.mavenBundle; |
| import static org.ops4j.pax.exam.CoreOptions.systemPackages; |
| import static org.ops4j.pax.exam.CoreOptions.systemProperty; |
| import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration; |
| import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration; |
| |
| /** |
| * NOTE: This file is generated from Sling's Karaf Features |
| */ |
| public class SlingOptions { |
| |
| public static SlingVersionResolver versionResolver = new SlingVersionResolver(); |
| |
| public static Option config() { |
| return mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version(versionResolver); |
| } |
| |
| public static Option eventadmin() { |
| return composite( |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.eventadmin").version(versionResolver), |
| config() |
| ); |
| } |
| |
| public static Option http() { |
| return composite( |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.jetty").version(versionResolver), |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version(versionResolver), |
| config() |
| ); |
| } |
| |
| public static Option httpWhiteboard() { |
| return composite( |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.whiteboard").version(versionResolver), |
| http() |
| ); |
| } |
| |
| public static Option management() { |
| return composite( |
| mavenBundle().groupId("org.apache.aries").artifactId("org.apache.aries.util").version(versionResolver), |
| mavenBundle().groupId("org.apache.aries.jmx").artifactId("org.apache.aries.jmx.api").version(versionResolver), |
| mavenBundle().groupId("org.apache.aries.jmx").artifactId("org.apache.aries.jmx.core").version(versionResolver), |
| mavenBundle().groupId("org.apache.aries.jmx").artifactId("org.apache.aries.jmx.whiteboard").version(versionResolver), |
| config() |
| ); |
| } |
| |
| public static Option scr() { |
| return composite( |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.metatype").version(versionResolver), |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.scr").version(versionResolver), |
| config() |
| ); |
| } |
| |
| public static Option webconsole() { |
| return composite( |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.webconsole").version(versionResolver), |
| mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.inventory").version(versionResolver), |
| mavenBundle().groupId("commons-fileupload").artifactId("commons-fileupload").version(versionResolver), |
| mavenBundle().groupId("commons-io").artifactId("commons-io").version(versionResolver), |
| http() |
| ); |
| } |
| |
| public static Option paxUrl() { |
| return composite( |
| mavenBundle().groupId("org.ops4j.pax.url").artifactId("pax-url-commons").version(versionResolver), |
| mavenBundle().groupId("org.ops4j.base").artifactId("ops4j-base-lang").version(versionResolver), |
| mavenBundle().groupId("org.ops4j.base").artifactId("ops4j-base-util-property").version(versionResolver), |
| mavenBundle().groupId("org.ops4j.pax.swissbox").artifactId("pax-swissbox-property").version(versionResolver), |
| config() |
| ); |
| } |
| |
| public static Option paxUrlClasspath() { |
| return composite( |
| mavenBundle().groupId("org.ops4j.pax.url").artifactId("pax-url-classpath").version(versionResolver), |
| paxUrl() |
| ); |
| } |
| |
| public static Option paxTinybundles() { |
| return composite( |
| mavenBundle().groupId("org.ops4j.pax.tinybundles").artifactId("tinybundles").version(versionResolver), |
| mavenBundle().groupId("biz.aQute.bnd").artifactId("biz.aQute.bndlib").version(versionResolver) |
| ); |
| } |
| |
| public static Option logback() { |
| final String filename = String.format("file:%s/src/test/resources/logback.xml", PathUtils.getBaseDir()); |
| return composite( |
| systemProperty("logback.configurationFile").value(filename), |
| mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version(versionResolver), |
| mavenBundle().groupId("org.slf4j").artifactId("jcl-over-slf4j").version(versionResolver), |
| mavenBundle().groupId("ch.qos.logback").artifactId("logback-core").version(versionResolver), |
| mavenBundle().groupId("ch.qos.logback").artifactId("logback-classic").version(versionResolver), |
| config() |
| ); |
| } |
| {{#each features}} |
| public static Option {{javaName}}() { |
| return composite({{#each features}} |
| {{this}}(){{#unless @last}},{{/unless}}{{/each}}{{#if features}}{{#if bundles}},{{/if}}{{/if}}{{#each bundles}} |
| mavenBundle().groupId("{{groupId}}").artifactId("{{artifactId}}").version(versionResolver){{#unless @last}},{{/unless}}{{/each}}{{#if configurations}},{{/if}}{{#each configurations}} |
| {{#if factory}}factoryConfiguration{{else}}newConfiguration{{/if}}("{{pid}}"){{#each entries}} |
| .put("{{@key}}", {{{this}}}){{/each}} |
| .asOption(){{#unless @last}},{{/unless}}{{/each}} |
| ); |
| } |
| {{/each}} |
| public static Option slingQuickstartOakTar(final String workingDirectory, final int httpPort) { |
| final String slingHome = String.format("%s/sling", workingDirectory); |
| final String repositoryHome = String.format("%s/repository", slingHome); |
| final String localIndexDir = String.format("%s/index", repositoryHome); |
| return composite( |
| slingQuickstartOak(), |
| mavenBundle().groupId("org.apache.jackrabbit").artifactId("oak-lucene").version(versionResolver), |
| mavenBundle().groupId("org.apache.jackrabbit").artifactId("oak-segment-tar").version(versionResolver), |
| mavenBundle().groupId("org.apache.jackrabbit").artifactId("oak-store-document").version(versionResolver), |
| mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.jcr.oak.server").version(versionResolver), |
| newConfiguration("org.apache.felix.http") |
| .put("org.osgi.service.http.port", httpPort) |
| .asOption(), |
| newConfiguration("org.apache.jackrabbit.oak.segment.SegmentNodeStoreService") |
| .put("repository.home", repositoryHome) |
| .put("name", "Default NodeStore") |
| .asOption(), |
| newConfiguration("org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderService") |
| .put("localIndexDir", localIndexDir) |
| .asOption() |
| ); |
| } |
| |
| public static Option slingQuickstartOakMongo(final String workingDirectory, final int httpPort, final String mongouri) { |
| final String slingHome = String.format("%s/sling", workingDirectory); |
| final String repositoryHome = String.format("%s/repository", slingHome); |
| final String localIndexDir = String.format("%s/index", repositoryHome); |
| return composite( |
| slingQuickstartOak(), |
| mavenBundle().groupId("org.apache.jackrabbit").artifactId("oak-lucene").version(versionResolver), |
| mavenBundle().groupId("org.apache.jackrabbit").artifactId("oak-store-document").version(versionResolver), |
| mavenBundle().groupId("org.mongodb").artifactId("mongo-java-driver").version(versionResolver), |
| mavenBundle().groupId("com.h2database").artifactId("h2-mvstore").version(versionResolver), |
| mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.jcr.oak.server").version(versionResolver), |
| newConfiguration("org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderService") |
| .put("localIndexDir", localIndexDir) |
| .asOption(), |
| newConfiguration("org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService") |
| .put("db", "sling") |
| .put("mongouri", mongouri) |
| .asOption() |
| ); |
| } |
| |
| } |