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;
}
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());
}
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());
}
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);
}
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());
}
Aggregations