use of aQute.bnd.build.Project in project bnd by bndtools.
the class LauncherTest method testSpaces.
/**
* Try launching a workspace with spaces
*/
public static void testSpaces() throws Exception {
File f = new File("t m p");
try {
File cnf = new File(f, "cnf");
File demo = new File(f, "demo");
IO.copy(IO.getFile("../cnf"), IO.getFile(f, "cnf"));
IO.copy(IO.getFile("../demo"), IO.getFile(f, "demo"));
IO.copy(IO.getFile("../biz.aQute.launcher"), IO.getFile(f, "biz.aQute.launcher"));
IO.copy(IO.getFile("../biz.aQute.junit"), IO.getFile(f, "biz.aQute.junit"));
Workspace ws = Workspace.getWorkspace(f);
Project p = ws.getProject("demo");
p.setTrace(true);
p.build();
try {
ProjectLauncher l = p.getProjectLauncher();
l.setTrace(true);
l.getRunProperties().put("test.cmd", "exit");
assertEquals(42, l.launch());
} finally {
p.close();
ws.close();
}
} finally {
IO.delete(f);
}
}
use of aQute.bnd.build.Project in project bnd by bndtools.
the class LauncherTest method testTimeout.
public static void testTimeout() throws Exception {
Project project = getProject();
project.clear();
ProjectLauncher l = project.getProjectLauncher();
l.setTimeout(100, TimeUnit.MILLISECONDS);
l.setTrace(false);
l.getRunProperties().put("test.cmd", "timeout");
assertEquals(ProjectLauncher.TIMEDOUT, l.launch());
}
use of aQute.bnd.build.Project in project bnd by bndtools.
the class LauncherTest method assertExitCode.
private static void assertExitCode(String cmd, int rv) throws Exception {
Project project = getProject();
project.clear();
ProjectLauncher l = project.getProjectLauncher();
l.setTimeout(15000, TimeUnit.MILLISECONDS);
l.setTrace(true);
l.getRunProperties().put("test.cmd", cmd);
assertEquals(rv, l.launch());
}
use of aQute.bnd.build.Project in project bnd by bndtools.
the class LocationTest method testMerged.
public void testMerged() throws Exception {
Project project = ws.getProject("locationtest");
FileLine fl = project.getHeader("-merged", "BAZ");
assertNotNull(fl);
assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
assertEquals(18, fl.line);
assertEquals(167, fl.start);
assertEquals(170, fl.end);
}
use of aQute.bnd.build.Project in project bnd by bndtools.
the class LocationTest method testProjectHeaderClauses.
public void testProjectHeaderClauses() throws Exception {
Project project = ws.getProject("locationtest");
assertNotNull(project);
FileLine fl = project.getHeader("-inprojectsep", "BAZ");
assertNotNull(fl);
assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
assertEquals(10, fl.line);
assertEquals(104, fl.start);
assertEquals(107, fl.end);
fl = project.getHeader("-inproject", "BAZ");
assertNotNull(fl);
assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
assertEquals(3, fl.line);
assertEquals(23, fl.start);
assertEquals(26, fl.end);
}
Aggregations