/** * 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(); }
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); }
/** * 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); }
/** * 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() 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); }
/** * 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 ); }
/** * Constructor. */ public MockitoBundlesOption() { super( wrappedBundle( maven() .groupId( "org.mockito" ) .artifactId( "mockito-all" ) .version( "1.7" ) ) ); noUpdate(); startLevel( START_LEVEL_SYSTEM_BUNDLES ); }
private Option getKarafFeatureOptions() { return features( maven() .groupId("org.apache.karaf.features") .artifactId("standard") .version(DependencyVersionResolver.resolver()) .classifier("features") .type("xml"), "standard"); }
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; }
/** * Use the same Karaf version from the project for integration testing with Pax Exam */ public static DefaultCompositeOption useDefaultKarafAsInProjectWithJunitBundles() { String karafVersion = getKarafVersionAsInProject(); MavenArtifactUrlReference karafUrl = maven().groupId(KARAF_GROUP_ID) .artifactId(KARAF_ARTIFACT_ID) .version(karafVersion) .type("tar.gz"); return new DefaultCompositeOption() .add(karafDistributionConfiguration() .frameworkUrl(karafUrl) .karafVersion(karafVersion) .name("Apache Karaf") .unpackDirectory(new File("target/exam"))) .add(keepRuntimeFolder()) .add(junitBundles()) .add(logLevel(LogLevelOption.LogLevel.INFO)); }
@Configuration public Option[] config() throws Exception { return new Option[] { KarafDistributionOption .karafDistributionConfiguration() .unpackDirectory(new File("target/pax")) .frameworkUrl( maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz") .version(KARAF_VERSION)).karafVersion(KARAF_VERSION), KarafDistributionOption.features(maven().groupId("org.infinispan").artifactId("infinispan-remote") .type("xml").classifier("features").versionAsInProject(), "infinispan-remote"), KarafDistributionOption.features(new RawUrlReference("file:///" + RESOURCES_DIR.replace("\\", "/") + "/test-features.xml"), "query-sample-domain"), KarafDistributionOption.editConfigurationFileExtend("etc/jre.properties", "jre-1.7", "sun.misc"), KarafDistributionOption.editConfigurationFileExtend("etc/jre.properties", "jre-1.6", "sun.misc"), KarafDistributionOption.keepRuntimeFolder(), localRepoForPAXUrl() }; }