コード例 #1
0
  @Override
  public int getRemovedCount() {
    int count = 0;
    for (final MockProcessSession session : sessionFactory.getCreatedSessions()) {
      count += session.getRemovedCount();
    }

    return count;
  }
コード例 #2
0
 @Override
 public void enqueue(final InputStream data, final Map<String, String> attributes) {
   final MockProcessSession session =
       new MockProcessSession(new SharedSessionState(processor, idGenerator), processor);
   MockFlowFile flowFile = session.create();
   flowFile = session.importFrom(data, flowFile);
   flowFile = session.putAllAttributes(flowFile, attributes);
   enqueue(flowFile);
 }
コード例 #3
0
  @Override
  public List<MockFlowFile> getPenalizedFlowFiles() {
    final List<MockFlowFile> flowFiles = new ArrayList<>();
    for (final MockProcessSession session : sessionFactory.getCreatedSessions()) {
      flowFiles.addAll(session.getPenalizedFlowFiles());
    }

    Collections.sort(
        flowFiles,
        new Comparator<MockFlowFile>() {
          @Override
          public int compare(final MockFlowFile o1, final MockFlowFile o2) {
            return Long.compare(o1.getCreationTime(), o2.getCreationTime());
          }
        });

    return flowFiles;
  }
コード例 #4
0
 @Override
 public void clearTransferState() {
   for (final MockProcessSession session : sessionFactory.getCreatedSessions()) {
     session.clearTransferState();
   }
 }
コード例 #5
0
 @Override
 public void assertAllFlowFiles(Relationship relationship, FlowFileValidator validator) {
   for (final MockProcessSession session : sessionFactory.getCreatedSessions()) {
     session.assertAllFlowFiles(relationship, validator);
   }
 }
コード例 #6
0
 @Override
 public void assertAllFlowFilesTransferred(final Relationship relationship) {
   for (final MockProcessSession session : sessionFactory.getCreatedSessions()) {
     session.assertAllFlowFilesTransferred(relationship);
   }
 }