本文整理汇总了Java中org.hamcrest.beans.HasPropertyWithValue类的典型用法代码示例。如果您正苦于以下问题:Java HasPropertyWithValue类的具体用法?Java HasPropertyWithValue怎么用?Java HasPropertyWithValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HasPropertyWithValue类属于org.hamcrest.beans包,在下文中一共展示了HasPropertyWithValue类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: queryTextIndexRaw
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void queryTextIndexRaw() throws HodErrorException {
final QueryResults<HodSearchResult> mockedResults = mockResults();
when(queryTextIndexService.queryTextIndexWithText(anyString(), argThat(new HasPropertyWithValue<>("queryProfile", nullValue())))).thenReturn(mockedResults);
when(queryRequest.getQueryType()).thenReturn(QueryRequest.QueryType.RAW);
final Documents<HodSearchResult> results = documentsService.queryTextIndex(queryRequest);
validateResults(results);
}
开发者ID:hpe-idol,项目名称:haven-search-components,代码行数:10,代码来源:HodDocumentServiceTest.java
示例2: queryTextIndexForPromotions
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void queryTextIndexForPromotions() throws HodErrorException {
final QueryResults<HodSearchResult> mockedResults = mockResults();
when(queryTextIndexService.queryTextIndexWithText(anyString(), argThat(new HasPropertyWithValue<>("promotions", is(true))))).thenReturn(mockedResults);
when(queryRequest.getQueryType()).thenReturn(QueryRequest.QueryType.PROMOTIONS);
final Documents<HodSearchResult> results = documentsService.queryTextIndex(queryRequest);
validateResults(results);
}
开发者ID:hpe-idol,项目名称:haven-search-components,代码行数:10,代码来源:HodDocumentServiceTest.java
示例3: testMultipleBundlePropertiesFamilyLoading
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void testMultipleBundlePropertiesFamilyLoading() throws MojoExecutionException {
File directory = getFile("multi-bundle");
int nbErrors = validator.loadPropertiesFamily(directory, items, propertiesFamilies);
assertEquals(0, nbErrors);
assertEquals(3, propertiesFamilies.size());
assertThat(propertiesFamilies, hasItem(HasPropertyWithValue.<PropertiesFamily> hasProperty("baseName", is("1"))));
assertThat(propertiesFamilies, hasItem(HasPropertyWithValue.<PropertiesFamily> hasProperty("baseName", is("2"))));
assertThat(propertiesFamilies, hasItem(HasPropertyWithValue.<PropertiesFamily> hasProperty("baseName", is("3"))));
}
开发者ID:rquinio,项目名称:l10n-maven-plugin,代码行数:12,代码来源:DirectoryValidatorTest.java
示例4: serverErrorPageWithUUID
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void serverErrorPageWithUUID() {
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, mock(Exception.class));
assertNotNull(errorController.serverErrorPage(request, response));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("mainMessageCode", is(CustomErrorController.MESSAGE_CODE_INTERNAL_SERVER_ERROR_MAIN))));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("subMessageCode", is(CustomErrorController.MESSAGE_CODE_INTERNAL_SERVER_ERROR_SUB))));
}
开发者ID:hpe-idol,项目名称:find,代码行数:9,代码来源:AbstractErrorControllerTest.java
示例5: testWriteUnlockNotifiesListeners
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void testWriteUnlockNotifiesListeners() throws MessageCodecException {
ClientCommunicator communicator = mock(ClientCommunicator.class);
VoltronReadWriteLockActiveEntity entity = new VoltronReadWriteLockActiveEntity(communicator);
ClientDescriptor locker = mock(ClientDescriptor.class);
ClientDescriptor waiter = mock(ClientDescriptor.class);
entity.invoke(locker, LockMessaging.lock(WRITE));
entity.invoke(waiter, LockMessaging.lock(WRITE));
entity.invoke(locker, LockMessaging.unlock(WRITE));
verify(communicator).sendNoResponse(eq(waiter), argThat(
HasPropertyWithValue.<EntityResponse>hasProperty("released", is(true))));
}
开发者ID:ehcache,项目名称:ehcache3,代码行数:16,代码来源:VoltronReadWriteLockActiveEntityTest.java
示例6: testReadUnlockNotifiesListeners
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void testReadUnlockNotifiesListeners() throws MessageCodecException {
ClientCommunicator communicator = mock(ClientCommunicator.class);
VoltronReadWriteLockActiveEntity entity = new VoltronReadWriteLockActiveEntity(communicator);
ClientDescriptor locker = mock(ClientDescriptor.class);
ClientDescriptor waiter = mock(ClientDescriptor.class);
entity.invoke(locker, LockMessaging.lock(READ));
entity.invoke(waiter, LockMessaging.lock(WRITE));
entity.invoke(locker, LockMessaging.unlock(READ));
verify(communicator).sendNoResponse(eq(waiter), argThat(
HasPropertyWithValue.<EntityResponse>hasProperty("released", is(true))));
}
开发者ID:ehcache,项目名称:ehcache3,代码行数:16,代码来源:VoltronReadWriteLockActiveEntityTest.java
示例7: clientAuthenticationErrorPage
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void clientAuthenticationErrorPage() {
assertNotNull(errorController.clientAuthenticationErrorPage(request));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("mainMessageCode", is(HodErrorController.MESSAGE_CODE_CLIENT_AUTHENTICATION_ERROR_MAIN))));
}
开发者ID:hpe-idol,项目名称:find,代码行数:6,代码来源:HodErrorControllerTest.java
示例8: authenticationErrorPage
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void authenticationErrorPage() {
assertNotNull(errorController.authenticationErrorPage(request, response));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("mainMessageCode", is(CustomErrorController.MESSAGE_CODE_AUTHENTICATION_ERROR_MAIN))));
}
开发者ID:hpe-idol,项目名称:find,代码行数:6,代码来源:AbstractErrorControllerTest.java
示例9: serverErrorPageWithoutUUID
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void serverErrorPageWithoutUUID() {
assertNotNull(errorController.serverErrorPage(request, response));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("mainMessageCode", is(CustomErrorController.MESSAGE_CODE_INTERNAL_SERVER_ERROR_MAIN))));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("subMessageCode", is(CustomErrorController.MESSAGE_CODE_INTERNAL_SERVER_ERROR_SUB))));
}
开发者ID:hpe-idol,项目名称:find,代码行数:7,代码来源:AbstractErrorControllerTest.java
示例10: notFoundError
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
@Test
public void notFoundError() {
assertNotNull(errorController.notFoundError(request, response));
verify(controllerUtils).buildErrorModelAndView(argThat(new HasPropertyWithValue<>("mainMessageCode", is(CustomErrorController.MESSAGE_CODE_NOT_FOUND_MAIN))));
}
开发者ID:hpe-idol,项目名称:find,代码行数:6,代码来源:AbstractErrorControllerTest.java
示例11: IsTableColumn
import org.hamcrest.beans.HasPropertyWithValue; //导入依赖的package包/类
public IsTableColumn(ColumnIdentifierType identifierType,Matcher<?> identifierMatcher, String identifierDescription) {
this.identifierMatcher = identifierMatcher;
this.identifierType = identifierType;
this.columnMatcher = new HasPropertyWithValue<TableColumn>(identifierType.propertyName, identifierMatcher);
this.identifierDescription = identifierDescription;
}
开发者ID:jhc-systems,项目名称:redsniff,代码行数:7,代码来源:IsTableColumn.java
注:本文中的org.hamcrest.beans.HasPropertyWithValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论