org.ops4j.pax.exam.util.PathUtils Java Examples

The following examples show how to use org.ops4j.pax.exam.util.PathUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OSGiTestCase.java    From extended-objects with Apache License 2.0 6 votes vote down vote up
@Override
public Option[] createConfiguration() {
    final Option[] xoBundles = options(cleanCaches(true), //
            systemProperty("logback.configurationFile").value("file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml"), //
            workspaceBundle("api"), //
            workspaceBundle("spi"), //
            workspaceBundle("impl"), //
            mavenBundle("javax.validation", "validation-api", "1.1.0.Final"), //
            mavenBundle("org.apache.felix", "org.apache.felix.scr", "1.8.2"), //
            mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.8.0").start(true), //
            mavenBundle("org.slf4j", "slf4j-api", "1.7.2"), //
            mavenBundle("ch.qos.logback", "logback-core", "1.0.6"), //
            mavenBundle("ch.qos.logback", "logback-classic", "1.0.6"), //
            mavenBundle("com.google.guava", "guava", "23.0"));
    return OptionUtils.combine(xoBundles, CoreOptions.junitBundles());
}
 
Example #2
Source File: ApiOsgiTestBase.java    From directory-ldap-api with Apache License 2.0 5 votes vote down vote up
@Configuration
public Option[] config() throws IOException
{
    List<Option> dependencies = new ArrayList<Option>();

    URL resource = getClass().getResource( "/" );
    File targetTestClassesDir = new File( resource.getFile() );
    File targetDependenciesDir = new File( targetTestClassesDir.getParent(), "dependency" );
    File[] files = targetDependenciesDir.listFiles();
    for ( File file : files )
    {
        if ( !skips.contains( file.getName() ) )
        {
            dependencies.add( url( file.toURI().toString() ) );
        }
    }

    // shuffle dependencies, there mustn't be any dependency on order
    Collections.shuffle( dependencies );

    return options(
        systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "WARN" ),
        systemProperty( "logback.configurationFile" ).value(
            "file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml" ),
        systemPackages( "javax.xml.stream;version=1.0.0", "javax.xml.stream.util;version=1.0.0",
            "javax.xml.stream.events;version=1.0.0" ), mavenBundle( "ch.qos.logback", "logback-classic", "1.0.6" ),
        mavenBundle( "ch.qos.logback", "logback-core", "1.0.6" ), junitBundles(),
        composite( dependencies.toArray( new Option[0] ) ) );
}
 
Example #3
Source File: OSGiTestCase.java    From extended-objects with Apache License 2.0 4 votes vote down vote up
protected static UrlProvisionOption workspaceBundle(String pathFromRoot) {
    String url = String.format("reference:file:%s/../%s/target/classes", PathUtils.getBaseDir(), pathFromRoot);
    return bundle(url);
}
 
Example #4
Source File: OSGiTestEnvironment.java    From camunda-bpm-platform-osgi with Apache License 2.0 4 votes vote down vote up
@Override
public Option[] createConfiguration() {
  Option[] camundaBundles = options(

    // camunda core
    mavenBundle("org.camunda.bpm", "camunda-engine").versionAsInProject(),
    mavenBundle("org.camunda.bpm.dmn", "camunda-engine-feel-api").versionAsInProject(),
    mavenBundle("org.camunda.bpm.dmn", "camunda-engine-feel-juel").versionAsInProject(),
    mavenBundle("org.camunda.bpm.dmn", "camunda-engine-dmn").versionAsInProject(),
    mavenBundle("org.camunda.bpm.model", "camunda-bpmn-model").versionAsInProject(),
    mavenBundle("org.camunda.bpm.model", "camunda-cmmn-model").versionAsInProject(),
    mavenBundle("org.camunda.bpm.model", "camunda-xml-model").versionAsInProject(),
    mavenBundle("org.camunda.bpm.model", "camunda-dmn-model").versionAsInProject(),
    mavenBundle("org.camunda.commons", "camunda-commons-typed-values").versionAsInProject(),
    mavenBundle("org.camunda.commons", "camunda-commons-logging").versionAsInProject(),
    mavenBundle("org.camunda.commons", "camunda-commons-utils").versionAsInProject(),
    // camunda core dependencies
    mavenBundle("joda-time", "joda-time").versionAsInProject(),
    mavenBundle("com.h2database", "h2").versionAsInProject(),
    mavenBundle("org.mybatis", "mybatis").versionAsInProject(),
    mavenBundle("com.fasterxml.uuid", "java-uuid-generator").versionAsInProject(),
    mavenBundle("de.odysseus.juel", "juel-api").versionAsInProject(),
    mavenBundle("de.odysseus.juel", "juel-impl").versionAsInProject(),
    mavenBundle("org.slf4j", "slf4j-api", "1.7.7"),
    mavenBundle("ch.qos.logback", "logback-core", "1.1.2"),
    mavenBundle("ch.qos.logback", "logback-classic", "1.1.2"),
    mavenBundle("com.sun.activation", "javax.activation", "1.2.0"),
    //camunda osgi
    mavenBundle("org.camunda.bpm.extension.osgi", "camunda-bpm-osgi").versionAsInProject(),
    //camunda osgi dependencies
    mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),

    // make sure compiled classes from src/main are included
    bundle("reference:file:target/classes"));
  return OptionUtils.combine(
    camundaBundles,
    CoreOptions.junitBundles(),
    //for the logging
    systemProperty("logback.configurationFile")
    .value("file:" + PathUtils.getBaseDir() + "/src/test/resources/logback-test.xml")
  );
}