• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LogicalOperator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KeyProviderDelegationTokenExtension类代码示例发布时间:2022-05-23
下一篇:
Java CourseDbLoader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap