Search in sources :

Example 1 with Featured

use of org.eclipse.epp.internal.mpc.core.model.Featured 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());
}
Also used : Marketplace(org.eclipse.epp.internal.mpc.core.model.Marketplace) INode(org.eclipse.epp.mpc.core.model.INode) ICategories(org.eclipse.epp.mpc.core.model.ICategories) ICategory(org.eclipse.epp.mpc.core.model.ICategory) Featured(org.eclipse.epp.internal.mpc.core.model.Featured) Test(org.junit.Test)

Aggregations

Featured (org.eclipse.epp.internal.mpc.core.model.Featured)1 Marketplace (org.eclipse.epp.internal.mpc.core.model.Marketplace)1 ICategories (org.eclipse.epp.mpc.core.model.ICategories)1 ICategory (org.eclipse.epp.mpc.core.model.ICategory)1 INode (org.eclipse.epp.mpc.core.model.INode)1 Test (org.junit.Test)1