use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class DefaultMarketplaceServiceTest method getNodes.
@Test
@org.junit.experimental.categories.Category(RemoteTests.class)
public void getNodes() throws CoreException {
// Mylyn
INode idNode1 = QueryHelper.nodeById("206");
// Subversive
INode idNode2 = QueryHelper.nodeById("1139");
// M2E
INode idNode3 = QueryHelper.nodeById("252");
INode urlNode = QueryHelper.nodeByUrl("https://marketplace.eclipse.org/content/egit-git-integration-eclipse");
List<INode> query = Arrays.asList(idNode1, idNode2, urlNode, idNode3);
List<INode> result = marketplaceService.getNodes(query, new NullProgressMonitor());
assertEquals(query.size(), result.size());
for (int i = 0; i < query.size(); i++) {
INode queryNode = query.get(i);
INode resultNode = query.get(i);
if (queryNode.getId() != null) {
assertEquals(queryNode.getId(), resultNode.getId());
}
if (queryNode.getUrl() != null) {
assertEquals(queryNode.getUrl(), resultNode.getUrl());
}
}
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class SolutionCompatibilityFilterTest method searchForNode.
protected INode searchForNode() throws CoreException {
ISearchResult searchResult = marketplaceService.search(null, null, solution.query(), new NullProgressMonitor());
assertSearchResultSanity(searchResult);
List<? extends INode> nodes = searchResult.getNodes();
INode foundNode = null;
for (INode node : nodes) {
if ((solution.id() != null && solution.id().equals(node.getId())) || (solution.url() != null && solution.url().equals(node.getUrl()))) {
foundNode = node;
break;
}
}
return foundNode;
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class SolutionCompatibilityFilterTest method testIncompatibleNode.
public void testIncompatibleNode() throws CoreException {
assumeFalse("Skipping test - this solution and Eclipse/OS are compatible", compatible);
INode node = queryNode();
String updateurl = node.getUpdateurl();
assertNull("Incompatible node {1} should not have an update url, but has {0}", updateurl, node);
IIus ius = node.getIus();
assertNull("Incompatible node {1} should not have an <ius> element", ius, node);
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class SolutionCompatibilityFilterTest method testCompatibleNonInstallableNode.
public void testCompatibleNonInstallableNode() throws CoreException {
assumeTrue("Skipping test - this solution and Eclipse/OS are incompatible", compatible);
assumeFalse("Skipping test - this solution is installable", solution.installable());
INode node = queryNode();
String updateurl = node.getUpdateurl();
assertNull("Uninstallable node {1} should not have an update url, but has {0}", updateurl, node);
IIus ius = node.getIus();
assertNull("Uninstallable node {1} should not have an <ius> element", ius, node);
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class SolutionCompatibilityFilterTest method assertSearchResultSanity.
protected void assertSearchResultSanity(ISearchResult result) {
assertNotNull("Search result is null", result);
assertNotNull("Result node list is null (internal error)", result.getNodes());
assertNotNull("Result match count is null ('count' attribute missing)", result.getMatchCount());
assertTrue("Total search result count {1} has to be at least the number of returned nodes {2}", result.getMatchCount() >= result.getNodes().size(), result.getMatchCount(), result.getNodes().size());
Set<String> ids = new HashSet<String>();
for (INode node : result.getNodes()) {
assertNotNull("Search result node {1} without id", node.getId(), node);
assertTrue("Duplicate search result node {1}", ids.add(node.getId()), node);
}
}
Aggregations