本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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);
}
}
示例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);
}
}