/** * Base configuration for a Karaf container running the specified Ignite features. * * @return The configuration. */ public Option[] baseConfig() { return options( // Specify which version of Karaf to use. karafDistributionConfiguration() .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz") .versionAsInProject()) .karafVersion(System.getProperty("karafVersion")) .useDeployFolder(false) .unpackDirectory(new File("target/paxexam/unpack")), // Add JUnit bundles. junitBundles(), // Add the additional JRE exports that Ignite requires. editConfigurationFileExtend("etc/jre.properties", "jre-1.7", "sun.nio.ch"), editConfigurationFileExtend("etc/jre.properties", "jre-1.8", "sun.nio.ch"), // Make log level INFO. logLevel(LogLevelOption.LogLevel.INFO), // Add our features repository. features(mavenBundle() .groupId("org.apache.ignite").artifactId("ignite-osgi-karaf") .version(System.getProperty("projectVersion")).type("xml/features"), featuresToInstall().toArray(new String[0])), // Propagate the projectVersion system property. systemProperty("projectVersion").value(System.getProperty("projectVersion")) ); }
/** * Convenience method (shorter) for referencing an maven artifact based on groupId/artifactId. * * @param groupId * artifact group id * @param artifactId * artifact id * * @return maven artifact url */ public static MavenArtifactUrlReference maven(final String groupId, final String artifactId) { return maven().groupId(groupId).artifactId(artifactId); }
/** * Convenience method (shorter) for referencing an maven artifact based on groupId/artifactId. * * @param groupId * artifact group id * @param artifactId * artifact id * * @return maven artifact url */ public static MavenArtifactUrlReference maven(final String groupId, final String artifactId) { return maven().groupId(groupId).artifactId(artifactId); }
public String getKarafDistro() { String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP, KARAF_DISTRO_GROUPID); String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP, KARAF_DISTRO_ARTIFACTID); String type = System.getProperty(KARAF_DISTRO_TYPE_PROP, KARAF_DISTRO_TYPE); return maven().groupId(groupId).artifactId(artifactId).versionAsInProject().type(type).getURL(); }
/** * To test a different version set the 'it.nexus.bundle.version' system property.<br> * You can also override the 'groupId', 'artifactId', and 'classifier' the same way. * * @return Pax-Exam option to install a Nexus distribution based on groupId and artifactId */ public static Option nexusDistribution(final String groupId, final String artifactId) { return nexusDistribution(maven(groupId, artifactId).versionAsInProject().type("zip")); }
/** * Convenience method (shorter) for referencing a maven artifact based on * groupId/artifactId/version. * * @param groupId * artifact group id * @param artifactId * artifact id * @param version * artifact version * * @return maven artifact url */ public static MavenArtifactUrlReference maven(final String groupId, final String artifactId, final String version) { return maven().groupId(groupId).artifactId(artifactId).version(version); }
protected Option getKarafDistroOption() { String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP,KARAF_DISTRO_GROUPID); String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP,KARAF_DISTRO_ARTIFACTID); String version = System.getProperty(KARAF_DISTRO_VERSION_PROP,KARAF_DISTRO_VERSION); String type = System.getProperty(KARAF_DISTRO_TYPE_PROP,KARAF_DISTRO_TYPE); LOG.info("Using karaf distro {} {} {} {}",groupId,artifactId,version,type); return karafDistributionConfiguration() .frameworkUrl( maven() .groupId(groupId) .artifactId(artifactId) .type(type) .version(version)) .name("OpenDaylight") .unpackDirectory(new File("target/pax")) .useDeployFolder(false); }
/** * @return Pax-Exam option to change the Nexus edition based on groupId and artifactId */ public static Option nexusEdition(final String groupId, final String artifactId) { return nexusEdition(maven(groupId, artifactId).versionAsInProject().classifier("features").type("xml"), artifactId); }
/** * To test a different version set the 'it.nexus.bundle.version' system property.<br> * You can also override the 'groupId', 'artifactId', and 'classifier' the same way. * * @return Pax-Exam option to install a Nexus distribution based on groupId, artifactId and classifier */ public static Option nexusDistribution(final String groupId, final String artifactId, final String classifier) { return nexusDistribution(maven(groupId, artifactId).classifier(classifier).versionAsInProject().type("zip")); }
/** * @return Pax-Exam option to install a Nexus plugin based on groupId and artifactId */ public static Option nexusFeature(final String groupId, final String artifactId) { return nexusFeature(maven(groupId, artifactId).versionAsInProject().classifier("features").type("xml"), artifactId); }
protected Option getKarafDistroOption() throws IOException { String groupId = System.getProperty(KARAF_DISTRO_GROUPID_PROP, KARAF_DISTRO_GROUPID); String artifactId = System.getProperty(KARAF_DISTRO_ARTIFACTID_PROP, KARAF_DISTRO_ARTIFACTID); String type = System.getProperty(KARAF_DISTRO_TYPE_PROP, KARAF_DISTRO_TYPE); LOG.info("Using karaf distro {} {} {} {}", groupId, artifactId, getKarafDistroVersion(), type); return karafDistributionConfiguration() .frameworkUrl( maven() .groupId(groupId) .artifactId(artifactId) .type(type) .version(getKarafDistroVersion())) .name("OpenDaylight") .unpackDirectory(new File("target/pax")) .useDeployFolder(false); }
/** * Use the vanilla Apache Karaf container. Override this method to use * a different Karaf-compatible framework artifact. */ protected MavenUrlReference getFrameworkUrl() { return maven() .groupId("org.apache.karaf") .artifactId("apache-karaf") .type("tar.gz") .version(getKarafVersion()); }
/** * Method to directly register Karaf standard features. * * @param features a list of features which should be loaded from the Karaf standard feature file. * @return a pax-exam option */ public static FeaturesScannerProvisionOption loadKarafStandardFeatures(String... features) { return scanFeatures( maven().groupId("org.apache.karaf.assemblies.features").artifactId("standard").type("xml") .classifier("features").versionAsInProject(), features); }
/** * Create an option to install the test support bundle inside the PAX Exam container */ public static FeaturesScannerProvisionOption installProvisionrTestSupportBundle() { return scanFeatures( maven().groupId("org.apache.provisionr").artifactId("provisionr-test-support") .type("xml").classifier("features").versionAsInProject(), "provisionr-test-support" ); }
/** * Method to directly register Karaf enterprise features. * * @param features a list of features which should be loaded from the Karaf enterprise feature file. * @return a pax-exam option */ public static FeaturesScannerProvisionOption loadKarafEnterpriseFeatures(String... features) { return scanFeatures( maven().groupId("org.apache.karaf.assemblies.features").artifactId("enterprise").type("xml") .classifier("features").versionAsInProject(), features); }
/** * Create an option to install all the requested Provisionr features inside the PAX Exam container */ public static FeaturesScannerProvisionOption installProvisionrFeatures(String... features) { return scanFeatures( maven().groupId("org.apache.provisionr").artifactId("provisionr-features") .type("xml").classifier("features").versionAsInProject(), features ); } }
@Override protected Option getDistributionOptions() { return karafDistributionConfiguration() .frameworkUrl( maven() .groupId("org.apache.karaf") .artifactId("apache-karaf") .version(getVersion()) .type("zip")) .unpackDirectory(new File("target", "exam")) .useDeployFolder(false); }
private Option getKarafFeatureOptions() { return features( maven() .groupId("org.apache.karaf.features") .artifactId("standard") .version(DependencyVersionResolver.resolver()) .classifier("features") .type("xml"), "standard"); }
/** * You'll get a wrapped artifact of jmock version 2.5.1 by default. */ public JMockBundlesOption() { super( wrappedBundle( maven() .groupId( "org.jmock" ) .artifactId( "jmock" ) .version( "2.5.1" ) ) ); noUpdate(); startLevel( START_LEVEL_SYSTEM_BUNDLES ); }
public static Option[] configure(String... features) { ArrayList<String> f = new ArrayList<>(); f.addAll(Arrays.asList(features)); Option[] options = new Option[]{karafDistributionConfiguration().frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").versionAsInProject()).unpackDirectory(new File("target/paxexam/unpack/")), KarafDistributionOption.keepRuntimeFolder(), logLevel(LogLevelOption.LogLevel.INFO), editConfigurationFilePut("etc/config.properties", "karaf.startlevel.bundle", "50"), // uncomment this to debug it. // debugConfiguration("5005", true), features(getArtemisMQKarafFeatureUrl(), f.toArray(new String[f.size()]))}; return options; }