當前位置: 首頁>>代碼示例>>Java>>正文


Java EmptyResultSet類代碼示例

本文整理匯總了Java中org.alfresco.repo.search.EmptyResultSet的典型用法代碼示例。如果您正苦於以下問題:Java EmptyResultSet類的具體用法?Java EmptyResultSet怎麽用?Java EmptyResultSet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EmptyResultSet類屬於org.alfresco.repo.search包,在下文中一共展示了EmptyResultSet類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import org.alfresco.repo.search.EmptyResultSet; //導入依賴的package包/類
@Override
protected void setUp() throws Exception
{
    super.setUp();

    query = new VirtualQueryImpl(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE.toString(),
                                 SearchService.LANGUAGE_FTS_ALFRESCO,
                                 QUERY_TEST_STRING_QUERY);

    mockitoActualEnvironment = Mockito.mock(ActualEnvironment.class);
    Mockito.when(mockitoActualEnvironment.query(Mockito.any(SearchParameters.class)))
                    .thenReturn(new EmptyResultSet());

    mockitoPrefixResolver = Mockito.mock(NamespacePrefixResolver.class);
    Mockito.when(mockitoPrefixResolver.getNamespaceURI(TST_PREFIX)).thenReturn(TEST_URI);
    Mockito.when(mockitoPrefixResolver.getPrefixes(TEST_URI)).thenReturn(Arrays.asList(TST_PREFIX));

    Mockito.when(mockitoActualEnvironment.getNamespacePrefixResolver()).thenReturn(mockitoPrefixResolver);

    testQName1 = QName.createQName(TST_PREFIX,
                                   TEST_LOCAL_NAME_1,
                                   mockitoPrefixResolver);

    testQName2 = QName.createQName(TST_PREFIX,
                                   TEST_LOCAL_NAME_2,
                                   mockitoPrefixResolver);

    NodeRef n1 = new NodeRef("workspace://SpacesStore/17c8f11d-0936-4295-88a0-12b85764c76f");
    NodeRef n2 = new NodeRef("workspace://SpacesStore/27c8f11d-0936-4295-88a0-12b85764c76f");
    nodeOneReference = ((VirtualProtocol) Protocols.VIRTUAL.protocol).newReference(n1,
                                                                                   "/1",
                                                                                   n2);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:34,代碼來源:VirtualQueryImplTest.java

示例2: testNoResults

import org.alfresco.repo.search.EmptyResultSet; //導入依賴的package包/類
@Test
public void testNoResults() throws Exception
{
    SearchRequestContext searchRequest = SearchRequestContext.from(SearchQuery.EMPTY);
    CollectionWithPagingInfo<Node> collection =  mapper.toCollectionWithPagingInfo(EMPTY_PARAMS, searchRequest, null, new EmptyResultSet());
    assertNotNull(collection);
    assertFalse(collection.hasMoreItems());
    assertTrue(collection.getTotalItems() < 1);
    assertNull(collection.getContext());
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:11,代碼來源:ResultMapperTests.java

示例3: testNoResults

import org.alfresco.repo.search.EmptyResultSet; //導入依賴的package包/類
@Test
public void testNoResults() throws Exception
{
    CollectionWithPagingInfo<Node> collection =  mapper.toCollectionWithPagingInfo(SearchQuery.EMPTY,new EmptyResultSet());
    assertNotNull(collection);
    assertFalse(collection.hasMoreItems());
    assertTrue(collection.getTotalItems() < 1);
    assertNull(collection.getContext());
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:10,代碼來源:ResultMapperTests.java

示例4: perform

import org.alfresco.repo.search.EmptyResultSet; //導入依賴的package包/類
/**
 * @deprecated will be replaced by
 *             {@link #perform(ActualEnvironment, VirtualQueryConstraint,Reference)}
 *             once complex constrains are implemented
 */
@Override
public PagingResults<Reference> perform(ActualEnvironment environment, boolean files, boolean folders,
            String pattern, Set<QName> searchTypeQNames, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames,
            List<Pair<QName, Boolean>> sortProps, PagingRequest pagingRequest, Reference parentReference)
            throws VirtualizationException
{

    if (!files && !folders)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Deprecated query  will be skipped due do incompatible types request.");
        }

        return asPagingResults(environment,
                               pagingRequest,
                               new EmptyResultSet(),
                               parentReference);

    }
    else
    {
        VirtualQueryConstraint constraint = BasicConstraint.INSTANCE;
        constraint = new FilesFoldersConstraint(constraint,
                                                files,
                                                folders);
        if(pattern != null){
            constraint = new NamePatternPropertyValueConstraint(constraint,
                                        ContentModel.PROP_NAME,
                                        pattern,
                                        environment.getNamespacePrefixResolver());
        }
        constraint = new IgnoreConstraint(constraint,
                                          ignoreTypeQNames,
                                          ignoreAspectQNames);
        constraint = new PagingRequestConstraint(constraint,
                                                 pagingRequest);
        constraint = new SortConstraint(constraint,
                                        sortProps);

        return perform(environment,
                       constraint,
                       null,
                       parentReference);
    }

}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:53,代碼來源:VirtualQueryImpl.java

示例5: perform

import org.alfresco.repo.search.EmptyResultSet; //導入依賴的package包/類
/**
 * @deprecated will be replaced by
 *             {@link #perform(ActualEnvironment, VirtualQueryConstraint,Reference)}
 *             once complex constrains are implemented
 */
@Override
public PagingResults<Reference> perform(ActualEnvironment environment, boolean files, boolean folders,
            String pattern, Set<QName> ignoreTypeQNames, Set<QName> searchTypeQNames, Set<QName> ignoreAspectQNames,
            List<Pair<QName, Boolean>> sortProps, PagingRequest pagingRequest, Reference parentReference)
            throws VirtualizationException
{

    if (!files && !folders)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Deprecated query  will be skipped due do incompatible types request.");
        }

        return asPagingResults(environment,
                               pagingRequest,
                               new EmptyResultSet(),
                               parentReference);

    }
    else
    {
        VirtualQueryConstraint constraint = BasicConstraint.INSTANCE;
        constraint = new FilesFoldersConstraint(constraint,
                                                files,
                                                folders);
        if(pattern != null){
            constraint = new NamePatternPropertyValueConstraint(constraint,
                                        ContentModel.PROP_NAME,
                                        pattern,
                                        environment.getNamespacePrefixResolver());
        }
        constraint = new IgnoreConstraint(constraint,
                                          ignoreTypeQNames,
                                          ignoreAspectQNames);
        constraint = new PagingRequestConstraint(constraint,
                                                 pagingRequest);
        constraint = new SortConstraint(constraint,
                                        sortProps);

        return perform(environment,
                       constraint,
                       null,
                       parentReference);
    }

}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:53,代碼來源:VirtualQueryImpl.java


注:本文中的org.alfresco.repo.search.EmptyResultSet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。