Search in sources :

Example 1 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class DefaultMarketplaceServiceTest method recent.

@Test
@org.junit.experimental.categories.Category(RemoteTests.class)
public void recent() throws CoreException {
    ISearchResult result = marketplaceService.recent(new NullProgressMonitor());
    assertSearchResultSanity(result);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) Test(org.junit.Test)

Example 2 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class DefaultMarketplaceServiceTest method search.

private ISearchResult search(String marketName, String categoryName, String queryText) throws CoreException {
    IMarket toolsMarket = marketName == null ? null : findMarket(marketName);
    ICategory mylynCategory = categoryName == null ? null : findCategory(toolsMarket, categoryName);
    ISearchResult result = marketplaceService.search(toolsMarket, mylynCategory, queryText, new NullProgressMonitor());
    return result;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) ICategory(org.eclipse.epp.mpc.core.model.ICategory) IMarket(org.eclipse.epp.mpc.core.model.IMarket)

Example 3 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class DefaultMarketplaceServiceTest method popular.

@Test
@org.junit.experimental.categories.Category(RemoteTests.class)
public void popular() throws CoreException {
    ISearchResult result = marketplaceService.popular(new NullProgressMonitor());
    assertSearchResultSanity(result);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) Test(org.junit.Test)

Example 4 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult 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;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) INode(org.eclipse.epp.mpc.core.model.INode)

Example 5 with ISearchResult

use of org.eclipse.epp.mpc.core.model.ISearchResult in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method tagged.

public void tagged(String tag, IProgressMonitor monitor) throws CoreException {
    final int totalWork = 1000;
    SubMonitor progress = SubMonitor.convert(monitor, Messages.MarketplaceDiscoveryStrategy_searchingMarketplace, totalWork);
    try {
        ISearchResult result;
        MarketplaceCategory catalogCategory = findMarketplaceCategory(progress.newChild(1));
        catalogCategory.setContents(Contents.QUERY);
        // resolve market and category if necessary
        result = marketplaceService.tagged(tag, progress.newChild(500));
        handleSearchResult(catalogCategory, result, progress.newChild(500));
        if (result.getNodes().isEmpty()) {
            catalogCategory.setMatchCount(0);
            addCatalogItem(catalogCategory);
        }
    } finally {
        progress.done();
    }
}
Also used : ISearchResult(org.eclipse.epp.mpc.core.model.ISearchResult) SubMonitor(org.eclipse.core.runtime.SubMonitor)

Aggregations

ISearchResult (org.eclipse.epp.mpc.core.model.ISearchResult)21 SubMonitor (org.eclipse.core.runtime.SubMonitor)8 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)6 Test (org.junit.Test)6 CoreException (org.eclipse.core.runtime.CoreException)5 INode (org.eclipse.epp.mpc.core.model.INode)5 NoSuchElementException (java.util.NoSuchElementException)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 Node (org.eclipse.epp.internal.mpc.core.model.Node)2 SearchResult (org.eclipse.epp.internal.mpc.core.model.SearchResult)2 ICategory (org.eclipse.epp.mpc.core.model.ICategory)2 IMarket (org.eclipse.epp.mpc.core.model.IMarket)2 IMarketplaceService (org.eclipse.epp.mpc.core.service.IMarketplaceService)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 Callable (java.util.concurrent.Callable)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1