use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class MavenTest method getProject.
/**
* @throws Exception
*/
protected static Project getProject(String name) throws Exception {
File wsf = IO.getFile(cwd, "testresources/ws");
Workspace ws = Workspace.getWorkspace(wsf);
assertNotNull(ws);
Project project = ws.getProject(name);
assertNotNull(project);
return project;
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class ProjectLaunchImplTest method setUp.
protected void setUp() throws Exception {
tmp = new File("generated/tmp/test/" + getName());
tmp.mkdirs();
IO.copy(IO.getFile("testresources/ws"), tmp);
ws = new Workspace(tmp);
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class PomRepositoryTest method testMultipleRevisions.
public void testMultipleRevisions() throws Exception {
BndPomRepository mcsr = new BndPomRepository();
Workspace w = Workspace.createStandaloneWorkspace(new Processor(), tmp.toURI());
w.setBase(tmp);
mcsr.setRegistry(w);
File local = new File(tmp, "m2-repository");
local.mkdirs();
Map<String, String> config = new HashMap<>();
config.put("name", "test-dependencies");
String revisions = Strings.join(new String[] { "biz.aQute.bnd:biz.aQute.junit:3.3.0", "biz.aQute.bnd:biz.aQute.launcher:3.3.0", "biz.aQute.bnd:biz.aQute.remote.launcher:3.3.0", "biz.aQute.bnd:biz.aQute.tester:3.3.0" });
config.put("revision", revisions);
config.put("snapshotUrls", "https://repo1.maven.org/maven2/");
config.put("releaseUrls", "https://repo1.maven.org/maven2/");
config.put("local", local.getAbsolutePath());
config.put("transitive", "true");
mcsr.setProperties(config);
List<String> list = mcsr.list(null);
assertNotNull(list);
assertEquals(4, list.size());
RequirementBuilder builder = mcsr.newRequirementBuilder("osgi.identity");
builder.addAttribute("filter", "(osgi.identity=biz.aQute.tester)");
Promise<Collection<Resource>> providers = mcsr.findProviders(builder.buildExpression());
Collection<Resource> resources = providers.getValue();
assertFalse(resources.isEmpty());
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class PomRepositoryTest method testBndPomRepoURI.
public void testBndPomRepoURI() throws Exception {
final BndPomRepository bpr = new BndPomRepository();
Workspace w = Workspace.createStandaloneWorkspace(new Processor(), tmp.toURI());
w.setBase(tmp);
bpr.setRegistry(w);
Map<String, String> config = new HashMap<>();
config.put("pom", "https://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.gogo.shell/0.12.0/org.apache.felix.gogo.shell-0.12.0.pom");
config.put("snapshotUrls", "https://repo1.maven.org/maven2/");
config.put("releaseUrls", "https://repo1.maven.org/maven2/");
config.put("name", "test");
bpr.setProperties(config);
List<String> list = bpr.list(null);
assertNotNull(list);
assertEquals(1, list.size());
RequirementBuilder builder = bpr.newRequirementBuilder("osgi.identity");
builder.addDirective("filter", "(osgi.identity=org.apache.felix.gogo.runtime)");
Promise<Collection<Resource>> providers = bpr.findProviders(builder.buildExpression());
Collection<Resource> resources = providers.getValue();
assertFalse(resources.isEmpty());
assertEquals(1, resources.size());
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class PomRepositoryTest method testBndPomRepoFileExistingParent.
public void testBndPomRepoFileExistingParent() throws Exception {
BndPomRepository bpr = new BndPomRepository();
Workspace w = Workspace.createStandaloneWorkspace(new Processor(), tmp.toURI());
w.setBase(tmp);
bpr.setRegistry(w);
Map<String, String> config = new HashMap<>();
config.put("pom", "testdata/pomrepo/existing-parent.xml");
config.put("snapshotUrls", "https://repo1.maven.org/maven2/");
config.put("releaseUrls", "https://repo1.maven.org/maven2/");
config.put("name", "test");
bpr.setProperties(config);
List<String> list = bpr.list(null);
assertNotNull(list);
assertEquals(1, list.size());
}
Aggregations