public MavenArtifactUrlReference versionAsInProject() { return version(MavenUtils.asInProject()); }
/** * Sets the default distribution. * * @return carbon home option */ private CarbonDistributionBaseOption getDefaultConfiguration() { String defaultDistribution = System.getProperty(DEFAULT_DISTRIBUTION); if (defaultDistribution == null) { throw new TestContainerException("Default distribution is not specified."); } String[] distribution = defaultDistribution.split(":"); if (distribution.length < 3) { return new CarbonDistributionBaseOption().distributionMavenURL( maven().groupId(distribution[0]).artifactId(distribution[1]).versionAsInProject().type("zip")); } else { return new CarbonDistributionBaseOption().distributionMavenURL( maven().groupId(distribution[0]).artifactId(distribution[1]).version(distribution[2]).type("zip")); } } }
public MavenArtifactUrlReference versionAsInProject() { return version(MavenUtils.asInProject()); }
/** * Sets the default distribution. * * @return carbon home option */ private CarbonDistributionBaseOption getDefaultConfiguration() { String defaultDistribution = System.getProperty(DEFAULT_DISTRIBUTION); if (defaultDistribution == null) { throw new TestContainerException("Default distribution is not specified."); } String[] distribution = defaultDistribution.split(":"); if (distribution.length < 3) { return new CarbonDistributionBaseOption().distributionMavenURL( maven().groupId(distribution[0]).artifactId(distribution[1]).versionAsInProject().type("zip")); } else { return new CarbonDistributionBaseOption().distributionMavenURL( maven().groupId(distribution[0]).artifactId(distribution[1]).version(distribution[2]).type("zip")); } } }
public MavenArtifactUrlReference version(final VersionResolver _resolver) { validateNotNull(_resolver, "Version resolver"); return version(_resolver.getVersion(groupId, artifactId)); }
@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() }; }
public MavenArtifactUrlReference version(final VersionResolver _resolver) { validateNotNull(_resolver, "Version resolver"); return version(_resolver.getVersion(groupId, artifactId)); }
/** * Sets the Mockito version. * * @param version Mockito version. * * @return itself, for fluent api usage */ public MockitoBundlesOption version( final String version ) { ( (MavenArtifactUrlReference) ( (WrappedUrlProvisionOption) getDelegate() ).getUrlReference() ).version( version ); return this; }
/** * Sets the JMock version. * * @param version JMock version. * * @return itself, for fluent api usage */ public JMockBundlesOption version( final String version ) { ( (MavenArtifactUrlReference) ( (WrappedUrlProvisionOption) getDelegate() ).getUrlReference() ).version( version ); return itself(); }
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()); }
@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); }
/** * 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"); }
/** * 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 ); }
/** * Adds a new {@link Option} for the features listed and contained in the features.xml file * identified by the Maven coordinates provided. * * @param groupId Maven group ID of the features.xml file * @param artifactId Maven artifact ID of the features.xml file * @param featureNames names of the features to install from the features.xml file identified by * the Maven coordinates provided * @return this {@link FeatureOption} */ public FeatureOption addFeatures(String groupId, String artifactId, String... featureNames) { options = composite( options, features( maven(groupId, artifactId) .version(DependencyVersionResolver.resolver()) .classifier("features") .type("xml"), featureNames)); return this; }
/** * 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)); }