org.easymock.EasyMock.reportMatcher()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.easymock.EasyMock.reportMatcher()方法的一些代码示例,展示了EasyMock.reportMatcher()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.reportMatcher()方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:reportMatcher

EasyMock.reportMatcher介绍

[英]Reports an argument matcher. This method is needed to define own argument matchers. For details, see the EasyMock documentation.
[中]报告一个参数匹配器。定义自己的参数匹配器需要此方法。有关详细信息,请参阅EasyMock文档。

代码示例

代码示例来源:origin: org.easymock/easymock

/**
 * Expects any byte argument. For details, see the EasyMock documentation.
 *
 * @return {@code 0}.
 */
public static byte anyByte() {
  reportMatcher(Any.ANY);
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects any float argument. For details, see the EasyMock documentation.
 *
 * @return {@code 0}.
 */
public static float anyFloat() {
  reportMatcher(Any.ANY);
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects any int argument. For details, see the EasyMock documentation.
 *
 * @return {@code 0}.
 */
public static int anyInt() {
  reportMatcher(Any.ANY);
  return 0;
}

代码示例来源:origin: org.hamcrest/hamcrest-all

/**
 * Convenience factory method that will adapt a
 * Hamcrest {@link org.hamcrest.Matcher} to act as an
 * EasyMock {@link org.easymock.IArgumentMatcher} and
 * report it to EasyMock so it can be kept track of.
 */
public static IArgumentMatcher adapt(Matcher<?> matcher) {
  EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher);
  EasyMock.reportMatcher(easyMock2Matcher);
  return easyMock2Matcher;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a double argument greater than or equal to the given value. For
 * details, see the EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static double geq(double value) {
  reportMatcher(new GreaterOrEqual<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects an int argument less than or equal to the given value. For
 * details, see the EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static int leq(int value) {
  reportMatcher(new LessOrEqual<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a double argument greater than the given value. For details, see
 * the EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static double gt(double value) {
  reportMatcher(new GreaterThan<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a long argument greater than the given value. For details, see
 * the EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static long gt(long value) {
  reportMatcher(new GreaterThan<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a string that contains the given substring. For details, see the
 * EasyMock documentation.
 *
 * @param substring
 *            the substring.
 * @return {@code null}.
 */
public static String contains(String substring) {
  reportMatcher(new Contains(substring));
  return null;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a float array that is equal to the given array, i.e. it has to
 * have the same length, and each element has to be equal.
 *
 * @param value
 *            the given array.
 * @return {@code null}.
 */
public static float[] aryEq(float[] value) {
  reportMatcher(new ArrayEquals(value));
  return null;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a short array that is equal to the given array, i.e. it has to
 * have the same length, and each element has to be equal.
 *
 * @param value
 *            the given array.
 * @return {@code null}.
 */
public static short[] aryEq(short[] value) {
  reportMatcher(new ArrayEquals(value));
  return null;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a long argument less than or equal to the given value. For
 * details, see the EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static long leq(long value) {
  reportMatcher(new LessOrEqual<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a short argument greater than the given value. For details, see
 * the EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static short gt(short value) {
  reportMatcher(new GreaterThan<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a byte argument less than the given value. For details, see the
 * EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static byte lt(byte value) {
  reportMatcher(new LessThan<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a double argument less than the given value. For details, see the
 * EasyMock documentation.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static double lt(double value) {
  reportMatcher(new LessThan<>(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a byte that is equal to the given value.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static byte eq(byte value) {
  reportMatcher(new Equals(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects a short that is equal to the given value.
 *
 * @param value
 *            the given value.
 * @return {@code 0}.
 */
public static short eq(short value) {
  reportMatcher(new Equals(value));
  return 0;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expects an int array that is equal to the given array, i.e. it has to
 * have the same length, and each element has to be equal.
 *
 * @param value
 *            the given array.
 * @return {@code null}.
 */
public static int[] aryEq(int[] value) {
  reportMatcher(new ArrayEquals(value));
  return null;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expect any boolean but captures it for later use.
 *
 * @param captured
 *            Where the parameter is captured
 * @return {@code false}
 */
public static boolean captureBoolean(Capture<Boolean> captured) {
  reportMatcher(new Captures<>(captured));
  return false;
}

代码示例来源:origin: org.easymock/easymock

/**
 * Expect any char but captures it for later use.
 *
 * @param captured
 *            Where the parameter is captured
 * @return {@code 0}
 */
public static char captureChar(Capture<Character> captured) {
  reportMatcher(new Captures<>(captured));
  return 0;
}

相关文章