use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeCatalogItem in project epp.mpc by eclipse.
the class ImportFavoritesPage method getSelection.
public List<MarketplaceNodeCatalogItem> getSelection() {
IStructuredSelection selection = getViewer().getSelection();
@SuppressWarnings("unchecked") List<MarketplaceNodeCatalogItem> importFavorites = selection.toList();
return new ArrayList<MarketplaceNodeCatalogItem>(importFavorites);
}
use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeCatalogItem in project epp.mpc by eclipse.
the class MarketplaceInfoTest method createTestItem.
public static MarketplaceNodeCatalogItem createTestItem() throws Exception {
MarketplaceNodeCatalogItem item = new MarketplaceNodeCatalogItem();
item.setMarketplaceUrl(new URL("http://marketplace.eclipse.org"));
item.setId("123");
Node node = new Node();
node.setId(item.getId());
node.setUrl("http://marketplace.eclipse.org/node/" + node.getId());
node.setIus(new Ius());
addIu(node, "com.example.test.a1");
addIu(node, "com.example.test.a2");
item.setData(node);
item.setInstallableUnits(node.getIus().getIu());
return item;
}
use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeCatalogItem in project epp.mpc by eclipse.
the class MarketplaceCatalogTest method testCheckUpdateOnPerformDiscovery.
@Test
public void testCheckUpdateOnPerformDiscovery() {
assertTrue(checkedForUpdate.isEmpty());
catalog.performDiscovery(new NullProgressMonitor());
List<CatalogItem> items = catalog.getItems();
assertEquals(discoveryNodes.size(), items.size());
assertEquals(installedNodes.size(), checkedForUpdate.size());
int updateable = 0;
for (CatalogItem item : items) {
Boolean hasUpdate = ((MarketplaceNodeCatalogItem) item).getUpdateAvailable();
if (installedNodes.contains(item.getData())) {
assertNotNull(hasUpdate);
} else {
assertNull(hasUpdate);
}
assertEquals(updateAvailable.contains(item.getData()), Boolean.TRUE.equals(hasUpdate));
if (Boolean.TRUE.equals(hasUpdate)) {
updateable++;
}
}
assertEquals(updateAvailable.size(), updateable);
}
Aggregations