use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class SolutionCompatibilityFilterTest method testIncompatibleSearchResult.
public void testIncompatibleSearchResult() throws CoreException {
assumeFalse("Skipping test - this solution and Eclipse/OS are compatible", compatible);
INode foundNode = searchForNode();
assertNull("Incompatible node {0} found in search", foundNode);
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class UnmarshallerTest method featured.
@Test
public void featured() throws IOException, UnmarshalException {
// from http://www.eclipseplugincentral.net/api/v2/featured
Object model = processResource("resources/featured.xml");
assertNotNull(model);
assertTrue(model instanceof Marketplace);
Marketplace marketplace = (Marketplace) model;
Featured featured = marketplace.getFeatured();
assertNotNull(featured);
assertEquals(Integer.valueOf(6), featured.getCount());
assertEquals(6, featured.getNode().size());
INode node = featured.getNode().get(0);
assertEquals("248", node.getId());
assertEquals("eUML2 free edition", node.getName());
assertEquals("http://www.eclipseplugincentral.net/content/euml2-free-edition", node.getUrl());
assertEquals("resource", node.getType());
ICategories categories = node.getCategories();
assertNotNull(categories);
assertEquals(1, categories.getCategory().size());
ICategory category = categories.getCategory().get(0);
assertEquals("19", category.getId());
assertEquals("UML", category.getName());
assertEquals("http://www.eclipseplugincentral.net/taxonomy/term/19", category.getUrl());
assertEquals("Yves YANG", node.getOwner());
assertEquals(Integer.valueOf(0), node.getFavorited());
assertNotNull(node.getBody());
// bug 303149 assertTrue(node.getBody().startsWith("<P><STRONG>eUML2 for Java<"));
// bug 303149 assertTrue(node.getBody().endsWith("</LI></UL>"));
assertTrue(node.getFoundationmember());
assertEquals("http://www.soyatec.com/", node.getHomepageurl());
assertEquals("http://www.soyatec.com/euml2/images/product_euml2_110x80.png", node.getImage());
assertEquals("3.4", node.getVersion());
assertEquals("Free for non-commercial use", node.getLicense());
assertEquals("Soyatec", node.getCompanyname());
assertEquals("Mature", node.getStatus());
assertEquals("3.4.x/3.5.x", node.getEclipseversion());
assertEquals("http://www.soyatec.com/forum", node.getSupporturl());
assertEquals("http://www.soyatec.com/update", node.getUpdateurl());
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class UnmarshallerTest method node.
@Test
public void node() throws IOException, UnmarshalException {
// from http://www.eclipseplugincentral.net/content/mylyn-wikitext-lightweight-markup-editing-tools-and-framework/xml
Object model = processResource("resources/node.xml");
assertNotNull(model);
assertTrue(model instanceof Marketplace);
Marketplace marketplace = (Marketplace) model;
assertEquals(1, marketplace.getNode().size());
INode node = marketplace.getNode().get(0);
assertEquals("1065", node.getId());
assertEquals("Mylyn WikiText - Lightweight Markup Editing, Tools and Framework", node.getName());
assertEquals("http://www.eclipseplugincentral.net/content/mylyn-wikitext-lightweight-markup-editing-tools-and-framework", node.getUrl());
assertNotNull(node.getBody());
assertTrue(node.getBody().startsWith("Mylyn WikiText is a"));
assertTrue(node.getBody().endsWith("FAQ</a>."));
assertNotNull(node.getCategories());
assertEquals(5, node.getCategories().getCategory().size());
ICategory category = node.getCategories().getCategory().get(1);
// <category name='Tools'>/taxonomy/term/17</category>
assertEquals("Tools", category.getName());
// FIXME category id.
assertNotNull(node.getCreated());
assertEquals(1259955243L, node.getCreated().getTime() / 1000);
assertEquals(new Integer(3), node.getFavorited());
assertEquals(Boolean.TRUE, node.getFoundationmember());
assertNotNull(node.getChanged());
assertEquals(1259964722L, node.getChanged().getTime() / 1000);
assertEquals("David Green", node.getOwner());
assertEquals("resource", node.getType());
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class UserFavoritesService method createFavoritesBlobData.
protected String createFavoritesBlobData(Collection<? extends INode> nodes) {
if (nodes.isEmpty()) {
return null;
}
List<String> nodeIds = new ArrayList<String>(nodes.size());
for (INode node : nodes) {
nodeIds.add(node.getId());
}
Collections.sort(nodeIds);
StringBuilder builder = new StringBuilder();
boolean first = true;
for (String nodeId : nodeIds) {
if (first) {
first = false;
} else {
builder.append(SEPARATOR);
}
builder.append(nodeId);
}
return builder.toString();
}
use of org.eclipse.epp.mpc.core.model.INode in project epp.mpc by eclipse.
the class UserFavoritesService method toNodes.
private static List<INode> toNodes(Collection<String> favoriteIds) {
List<INode> favoriteNodes = new ArrayList<INode>(favoriteIds.size());
for (String nodeId : favoriteIds) {
INode node = QueryHelper.nodeById(nodeId);
favoriteNodes.add(node);
}
return favoriteNodes;
}
Aggregations