Пример #1
0
  /**
   * applies an {@link IArgumentMatcher} to a {@link VectorWritable} that checks whether all
   * elements are included
   */
  public static VectorWritable vectorMatches(final Vector.Element... elements) {
    EasyMock.reportMatcher(
        new IArgumentMatcher() {
          @Override
          public boolean matches(Object argument) {
            if (argument instanceof VectorWritable) {
              Vector v = ((VectorWritable) argument).get();
              return consistsOf(v, elements);
            }
            return false;
          }

          @Override
          public void appendTo(StringBuffer buffer) {}
        });
    return null;
  }
  public static Exception classEq(final Class<? extends Exception> in) {
    reportMatcher(
        new IArgumentMatcher() {

          @Override
          public void appendTo(StringBuffer buffer) {
            buffer.append("classEq(");
            buffer.append(in);
            buffer.append(")");
          }

          @Override
          public boolean matches(Object arg) {
            return arg.getClass() == in;
          }
        });
    return null;
  }
  public static Iterable<NodeMetadata> containsNodeMetadata(final NodeMetadata in) {
    reportMatcher(
        new IArgumentMatcher() {

          @Override
          public void appendTo(StringBuffer buffer) {
            buffer.append("contains(");
            buffer.append(in);
            buffer.append(")");
          }

          @Override
          public boolean matches(Object arg) {
            return Iterables.contains((Iterable<?>) arg, in);
          }
        });
    return null;
  }
 public static Event eqEvent(Event in) {
   EasyMock.reportMatcher(new EventEquals(in));
   return null;
 }
 /** Match a batch with the specified count of social and HTTP data items */
 private PipelinedData.Batch eqBatch(int socialCount, int httpCount) {
   reportMatcher(new BatchMatcher(socialCount, httpCount));
   return null;
 }
Пример #6
0
 static Object capture(Capture capture) {
   EasyMock.reportMatcher(new Captures(capture));
   return null;
 }
 public static HereIsFileInfoMessageHandle eqMatcher(
     TransferHandle transferHandle, FileInfo fileInfo) {
   EasyMock.reportMatcher(new HereIsFileInfoMessageHandleMatcher(transferHandle, fileInfo));
   return null;
 }
Пример #8
0
 static CommandJob eqCommandJob(CommandJob in) {
   EasyMock.reportMatcher(new CommandJobMatcher(in));
   return null;
 }
Пример #9
0
 public static String eqMatcher(String string) {
   EasyMock.reportMatcher(new MessageStartsWithMatcher(string));
   return null;
 }
 public static <T extends Info> ConfigChangeEvent configChangeEvent(
     Object source, String id, String name, String workspaceId, Class<T> clazz, Type type) {
   EasyMock.reportMatcher(
       new ConfigChangeEventMatcher(source, id, name, workspaceId, clazz, type));
   return null;
 }
Пример #11
0
 public static Cookie eqCookie(Cookie ck) {
   EasyMock.reportMatcher(new CookieMatcher(ck));
   return null;
 }
Пример #12
0
 private ServicePollStateChangedEvent eq(ServicePollStateChangedEvent e) {
   EasyMock.reportMatcher(new PolledServiceChangeEventEquals(e));
   return null;
 }
Пример #13
0
 private PropertyChangeEvent eq(PropertyChangeEvent e) {
   EasyMock.reportMatcher(new PropertyChangeEventEquals(e));
   return null;
 }