本文整理汇总了Java中org.easymock.LogicalOperator类的典型用法代码示例。如果您正苦于以下问题:Java LogicalOperator类的具体用法?Java LogicalOperator怎么用?Java LogicalOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogicalOperator类属于org.easymock包,在下文中一共展示了LogicalOperator类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testWriteToStream
import org.easymock.LogicalOperator; //导入依赖的package包/类
@Test
public void testWriteToStream() throws IOException {
AdGroupNegativeSites apiAdGroupNegativeSites = new AdGroupNegativeSites();
apiAdGroupNegativeSites.setAdGroupId(123L);
ArrayOfstring arrayOfBulkAdGroupNegativeSites = new ArrayOfstring();
List<String> bulkAdGroupNegativeSites = arrayOfBulkAdGroupNegativeSites.getStrings();
bulkAdGroupNegativeSites.add("Site 1");
bulkAdGroupNegativeSites.add("Site 2");
apiAdGroupNegativeSites.setNegativeSites(arrayOfBulkAdGroupNegativeSites);
BulkAdGroupNegativeSites adGroupNegativeSites = new BulkAdGroupNegativeSites();
adGroupNegativeSites.setAdGroupName("Test Ad Group");
adGroupNegativeSites.setAdGroupNegativeSites(apiAdGroupNegativeSites);
BulkAdGroupNegativeSitesIdentifier identifier = new BulkAdGroupNegativeSitesIdentifier();
identifier.setAdGroupId(123L);
identifier.setStatus(Status.DELETED);
BulkAdGroupNegativeSite bulkAdGroupNegativeSite1 = new BulkAdGroupNegativeSite();
bulkAdGroupNegativeSite1.setAdGroupId(123L);
bulkAdGroupNegativeSite1.setWebsite(apiAdGroupNegativeSites.getNegativeSites().getStrings().get(0));
BulkAdGroupNegativeSite bulkAdGroupNegativeSite2 = new BulkAdGroupNegativeSite();
bulkAdGroupNegativeSite2.setAdGroupId(123L);
bulkAdGroupNegativeSite2.setWebsite(apiAdGroupNegativeSites.getNegativeSites().getStrings().get(1));
rowWriter.writeObjectRow(and(anyObject(BulkAdGroupNegativeSitesIdentifier.class), cmp(identifier, IDENTIFIER_COMPARATOR, LogicalOperator.EQUAL)), eq(false));
rowWriter.writeObjectRow(and(anyObject(BulkAdGroupNegativeSite.class), cmp(bulkAdGroupNegativeSite1, BULK_NEGATIVE_SITE_COMPARATOR, LogicalOperator.EQUAL)), eq(false));
rowWriter.writeObjectRow(and(anyObject(BulkAdGroupNegativeSite.class), cmp(bulkAdGroupNegativeSite2, BULK_NEGATIVE_SITE_COMPARATOR, LogicalOperator.EQUAL)), eq(false));
replayAll();
adGroupNegativeSites.writeToStream(rowWriter, false);
}
开发者ID:BingAds,项目名称:BingAds-Java-SDK,代码行数:33,代码来源:BulkAdGroupNegativeSitesWriteTest.java
示例2: test
import org.easymock.LogicalOperator; //导入依赖的package包/类
@Test
public void test() throws IOException {
SiteLinksAdExtension apiAdExtension = new SiteLinksAdExtension();
apiAdExtension.setId(10L);
ArrayOfSiteLink arrayOfSiteLinks = new ArrayOfSiteLink();
List<SiteLink> siteLinks = arrayOfSiteLinks.getSiteLinks();
siteLinks.add(new SiteLink());
siteLinks.add(new SiteLink());
apiAdExtension.setSiteLinks(arrayOfSiteLinks);
BulkSiteLinkAdExtension adExtension = new BulkSiteLinkAdExtension();
adExtension.setAccountId(123L);
adExtension.setSiteLinksAdExtension(apiAdExtension);
SiteLinkAdExtensionIdentifier identifier = new SiteLinkAdExtensionIdentifier();
identifier.setAccountId(123L);
identifier.setAdExtensionId(10L);
identifier.setStatus(AdExtensionStatus.DELETED);
BulkSiteLink siteLink1 = new BulkSiteLink();
siteLink1.setAccountId(123L);
siteLink1.setSiteLink(apiAdExtension.getSiteLinks().getSiteLinks().get(0));
BulkSiteLink siteLink2 = new BulkSiteLink();
siteLink2.setAccountId(123L);
siteLink2.setSiteLink(apiAdExtension.getSiteLinks().getSiteLinks().get(1));
rowWriter.writeObjectRow(and(anyObject(SiteLinkAdExtensionIdentifier.class), cmp(identifier, IDENTIFIER_COMPARATOR, LogicalOperator.EQUAL)), eq(false));
rowWriter.writeObjectRow(and(anyObject(BulkSiteLink.class), cmp(siteLink1, BULK_SITE_LINK_COMPARATOR, LogicalOperator.EQUAL)), eq(false));
rowWriter.writeObjectRow(and(anyObject(BulkSiteLink.class), cmp(siteLink2, BULK_SITE_LINK_COMPARATOR, LogicalOperator.EQUAL)), eq(false));
replayAll();
adExtension.writeToStream(rowWriter, false);
}
开发者ID:BingAds,项目名称:BingAds-Java-SDK,代码行数:34,代码来源:BulkSiteLinkAdExtensionWriteToStreamTest.java
示例3: testCmp
import org.easymock.LogicalOperator; //导入依赖的package包/类
public void testCmp() {
Map<?, ?> mockMap = AndroidMock.createMock(Map.class);
AndroidMock.expect(
mockMap.get(AndroidMock.cmp("hi", String.CASE_INSENSITIVE_ORDER, LogicalOperator.EQUAL)))
.andReturn(null);
AndroidMock.replay(mockMap);
}
开发者ID:lshain-android-source,项目名称:external-android-mock,代码行数:8,代码来源:AndroidMockTest.java
示例4: setupProjectsParser
import org.easymock.LogicalOperator; //导入依赖的package包/类
public ProjectsParser setupProjectsParser() throws Exception {
projectsParser = EasyMock.createMock(ProjectsParser.class);
EasyMock.expect(projectsParser.generateProjectInput(
EasyMock.cmp(mockProjectInput,
new SameName(),
LogicalOperator.EQUAL)))
.andReturn(mockJsonString)
.once();
EasyMock.expect(projectsParser.parseSingleProjectInfo(mockJsonElement))
.andReturn(mockProjectInfo)
.once();
EasyMock.replay(projectsParser);
return projectsParser;
}
开发者ID:uwolfer,项目名称:gerrit-rest-java-client,代码行数:15,代码来源:ProjectsRestClientTest.java
示例5: cmp
import org.easymock.LogicalOperator; //导入依赖的package包/类
/**
* Expects an argument that will be compared using the provided {@link java.util.Comparator}, the
* result of which will then be applied to the provided {@link org.easymock.LogicalOperator}
* (e.g. {@link org.easymock.LogicalOperator#LESS_THAN},
* {@link org.easymock.LogicalOperator#EQUAL},
* {@link org.easymock.LogicalOperator#GREATER_OR_EQUAL}).
*
* The following comparison will take place:
* {@code comparator.compare(actual, expected) operator 0}
*
* E.g.
* For illustration purposes (using static imports):
*
* {@code
* expect(mockObject.getString(cmp("hi", CASE_INSENSITIVE_ORDER, LESS_THAN))).andReturn("hello");}
*
* {@code
* AndroidMock.expect(mockObject.getString(AndroidMock.cmp("hi", String.CASE_INSENSITIVE_ORDER,
* LogicalOperator.LESS_THAN))).andReturn("hello");}
*
*
* The above invocation indicates that the call to {@code mockObject.getString(String)} is
* expecting any String which is lexically before "hi" (in a case insensitive ordering).
*
* If this method is used for anything other than to set a parameter expectation as part of a
* mock object's recording phase, then an {@code IllegalStateException} will be thrown.
*
* @param expectedValue the expected value against which the incoming method parameter will be
* compared.
* @param comparator {@link java.util.Comparator} used to perform the comparison between the
* expected value and the incoming parameter to the mocked method.
* @param operator The comparison operator, usually one of
* {@link org.easymock.LogicalOperator#LESS_THAN},
* {@link org.easymock.LogicalOperator#LESS_OR_EQUAL},
* {@link org.easymock.LogicalOperator#EQUAL}, {@link org.easymock.LogicalOperator#GREATER},
* {@link org.easymock.LogicalOperator#GREATER_OR_EQUAL}
* @return {@code null}. The return value is always ignored.
*/
public static <T> T cmp(T expectedValue, Comparator<? super T> comparator,
LogicalOperator operator) {
return EasyMock.cmp(expectedValue, comparator, operator);
}
开发者ID:lshain-android-source,项目名称:external-android-mock,代码行数:43,代码来源:AndroidMock.java
示例6: cmp
import org.easymock.LogicalOperator; //导入依赖的package包/类
/**
* Expects an argument that will be compared using the provided comparator.
* The following comparison will take place:
* <p>
* <code>comparator.compare(actual, expected) operator 0</code>
* </p>
* For details, see the EasyMock documentation.
*
* @param <T>
* type of the method argument to match
* @param value
* the given value.
* @param comparator
* Comparator used to compare the actual with expected value.
* @param operator
* The comparison operator.
* @return <code>null</code>
*/
protected final <T> T cmp(final T value, final Comparator<? super T> comparator,
final LogicalOperator operator) {
return EasyMock.cmp(value, comparator, operator);
}
开发者ID:panifex,项目名称:panifex-platform,代码行数:23,代码来源:TestSupport.java
注:本文中的org.easymock.LogicalOperator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论