use of org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService in project epp.mpc by eclipse.
the class DefaultMarketplaceServiceTest method setUp.
@Before
public void setUp() throws Exception {
marketplaceService = new DefaultMarketplaceService();
// configure client id (bug 397004), as well as eclipse and marketplace versions (bug 418865)
Map<String, String> requestMetaParameters = ServiceLocator.computeDefaultRequestMetaParameters();
marketplaceService.setRequestMetaParameters(requestMetaParameters);
}
use of org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService in project epp.mpc by eclipse.
the class SolutionCompatibilityFilterTest method setupMarketplaceService.
@Before
public void setupMarketplaceService() throws Exception {
marketplaceService = new DefaultMarketplaceService(new URL(BASE_URL));
marketplaceService.setRequestMetaParameters(computeRequestMetaParameters(system, eclipseRelease));
}
use of org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService in project epp.mpc by eclipse.
the class SelectionModelStateSerializerTest method setUp.
@Before
public void setUp() throws Exception {
CatalogDescriptor catalogDescriptor = new CatalogDescriptor(new URL("http://marketplace.eclipse.org"), "Eclipse.org Marketplace");
discoveryStrategy = new MarketplaceDiscoveryStrategy(catalogDescriptor) {
@Override
public IMarketplaceService createMarketplaceService() {
DefaultMarketplaceService marketplaceService = new DefaultMarketplaceService(catalogDescriptor.getUrl());
Map<String, String> requestMetaParameters = ServiceLocator.computeDefaultRequestMetaParameters();
marketplaceService.setRequestMetaParameters(requestMetaParameters);
return marketplaceService;
}
};
catalog = new MarketplaceCatalog();
catalog.getDiscoveryStrategies().add(discoveryStrategy);
selectionModel = new SelectionModel(new InstallProfile() {
public Set<String> getInstalledFeatures() {
return Collections.emptySet();
}
});
}
use of org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService in project epp.mpc by eclipse.
the class ServiceLocator method createMarketplaceService.
protected IMarketplaceService createMarketplaceService(String baseUrl) {
IMarketplaceService service;
URL base;
try {
base = URLUtil.toURL(baseUrl);
} catch (MalformedURLException e) {
throw new IllegalArgumentException(e);
}
DefaultMarketplaceService defaultService = new DefaultMarketplaceService(base);
Map<String, String> requestMetaParameters = computeDefaultRequestMetaParameters();
defaultService.setRequestMetaParameters(requestMetaParameters);
IUserFavoritesService favoritesService = getFavoritesService(baseUrl);
// FIXME this should be a service reference!
defaultService.setUserFavoritesService(favoritesService);
service = new CachingMarketplaceService(defaultService);
return service;
}
use of org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService in project epp.mpc by eclipse.
the class MarketplaceDiscoveryStrategyTest method testSearchByNodeUrl.
@Test
public void testSearchByNodeUrl() throws Exception {
final INode[] testNode = new INode[1];
final IMarketplaceService marketplaceService = new DefaultMarketplaceService(catalogUrl) {
@Override
public Node getNode(INode node, IProgressMonitor monitor) throws CoreException {
testNode[0] = node;
return (Node) node;
}
@Override
public SearchResult search(IMarket market, ICategory category, String queryText, IProgressMonitor monitor) throws CoreException {
Assert.fail("Unexpected invocation");
// dead code
return null;
}
};
setupCatalog(marketplaceService);
testNode[0] = null;
catalog.performQuery(null, null, new URL(catalogUrl, "content/test").toExternalForm(), new NullProgressMonitor());
assertNotNull(testNode[0]);
assertNotNull(testNode[0].getUrl());
testNode[0] = null;
catalog.performQuery(null, null, new URL(catalogUrl, "node/12345").toExternalForm(), new NullProgressMonitor());
assertNotNull(testNode[0]);
assertNotNull(testNode[0].getId());
}
Aggregations