Search in sources :

Example 1 with ProjectLauncher

use of aQute.bnd.build.ProjectLauncher in project bnd by bndtools.

the class ProjectTesterImpl method prepare.

@Override
public boolean prepare() throws Exception {
    if (!prepared) {
        prepared = true;
        super.prepare();
        ProjectLauncher launcher = getProjectLauncher();
        if (port > 0) {
            launcher.getRunProperties().put(TESTER_PORT, "" + port);
            if (host != null)
                launcher.getRunProperties().put(TESTER_HOST, "" + host);
        }
        launcher.getRunProperties().put(TESTER_UNRESOLVED, getProject().getProperty(Constants.TESTUNRESOLVED, "true"));
        launcher.getRunProperties().put(TESTER_DIR, getReportDir().getAbsolutePath());
        launcher.getRunProperties().put(TESTER_CONTINUOUS, "" + getContinuous());
        if (getProject().is(Constants.RUNTRACE))
            launcher.getRunProperties().put(TESTER_TRACE, "true");
        Collection<String> testnames = getTests();
        if (testnames.size() > 0) {
            launcher.getRunProperties().put(TESTER_NAMES, Processor.join(testnames));
        }
        //
        // We used to add this bundle to the -runpath. However, now we add
        // it
        // ad the add the end of the -runbundles
        //
        launcher.addRunBundle(me.getFile().getAbsolutePath());
        launcher.prepare();
    }
    return true;
}
Also used : ProjectLauncher(aQute.bnd.build.ProjectLauncher)

Example 2 with ProjectLauncher

use of aQute.bnd.build.ProjectLauncher in project bnd by bndtools.

the class LauncherTest method testUnresolved.

public void testUnresolved() throws Exception {
    Project project = getProject();
    project.clear();
    project.setProperty(Constants.RUNTRACE, "true");
    String mandatorynoversion = IO.getFile("jar/mandatorynoversion.jar").getAbsolutePath();
    String runbundles = project.getProperty(Constants.RUNBUNDLES);
    project.setProperty(Constants.RUNBUNDLES, runbundles + "," + mandatorynoversion + ";version=file");
    ProjectTester tester = project.getProjectTester();
    tester.prepare();
    ProjectLauncher l = tester.getProjectLauncher();
    l.addRunBundle(mandatorynoversion);
    l.setTimeout(25000, TimeUnit.MILLISECONDS);
    l.setTrace(true);
    assertEquals(1, l.launch());
}
Also used : Project(aQute.bnd.build.Project) ProjectLauncher(aQute.bnd.build.ProjectLauncher) ProjectTester(aQute.bnd.build.ProjectTester)

Example 3 with ProjectLauncher

use of aQute.bnd.build.ProjectLauncher in project bnd by bndtools.

the class LauncherTest method testAgent.

/**
	 * Test the java agent
	 * 
	 * @throws Exception
	 */
public static void testAgent() throws Exception {
    Project project = getProject();
    project.clear();
    project.setProperty("-javaagent", "true");
    ProjectLauncher l = project.getProjectLauncher();
    l.setTrace(true);
    l.getRunProperties().put("test.cmd", "agent");
    assertEquals(55, l.launch());
}
Also used : Project(aQute.bnd.build.Project) ProjectLauncher(aQute.bnd.build.ProjectLauncher)

Example 4 with ProjectLauncher

use of aQute.bnd.build.ProjectLauncher in project bnd by bndtools.

the class LauncherTest method testRemotePackager.

/**
	 * Test the packager for remote
	 * 
	 * @throws Exception
	 */
public static void testRemotePackager() throws Exception {
    Project project = getProject();
    project.clear();
    project.setProperty("-runpath", "biz.aQute.remote.launcher;version=latest");
    ProjectLauncher l = project.getProjectLauncher();
    l.setTrace(true);
    Jar executable = l.executable();
    assertTrue(project.check());
    assertNotNull(executable);
}
Also used : Project(aQute.bnd.build.Project) ProjectLauncher(aQute.bnd.build.ProjectLauncher) Jar(aQute.bnd.osgi.Jar)

Example 5 with ProjectLauncher

use of aQute.bnd.build.ProjectLauncher in project bnd by bndtools.

the class LauncherTest method testEnv.

/**
	 * Test env variables
	 * 
	 * @throws Exception
	 */
public static void testEnv() throws Exception {
    Project project = getProject();
    project.clear();
    project.setProperty("-runenv", "ANSWER=84");
    ProjectLauncher l = project.getProjectLauncher();
    l.setTrace(true);
    l.getRunProperties().put("test.cmd", "env");
    assertEquals(84, l.launch());
}
Also used : Project(aQute.bnd.build.Project) ProjectLauncher(aQute.bnd.build.ProjectLauncher)

Aggregations

ProjectLauncher (aQute.bnd.build.ProjectLauncher)18 Project (aQute.bnd.build.Project)15 Jar (aQute.bnd.osgi.Jar)3 File (java.io.File)3 ProjectTester (aQute.bnd.build.ProjectTester)1 Run (aQute.bnd.build.Run)1 RunSession (aQute.bnd.build.RunSession)1 Workspace (aQute.bnd.build.Workspace)1 Processor (aQute.bnd.osgi.Processor)1 Resource (aQute.bnd.osgi.Resource)1 LaunchStatusHandler (bndtools.launch.ui.internal.LaunchStatusHandler)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 Callable (java.util.concurrent.Callable)1 Manifest (java.util.jar.Manifest)1 IProject (org.eclipse.core.resources.IProject)1 IResource (org.eclipse.core.resources.IResource)1 CoreException (org.eclipse.core.runtime.CoreException)1