当前位置: 首页>>代码示例>>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;未经允许,请勿转载。