/**
 * Licensed to DigitalPebble Ltd under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * DigitalPebble licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.digitalpebble.storm.crawler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import backtype.storm.task.IOutputCollector;
import backtype.storm.tuple.Tuple;

public class TestOutputCollector implements IOutputCollector {
    private List<Tuple> acked = new ArrayList<>();
    private List<Tuple> failed = new ArrayList<>();
    private List<List<Object>> emitted = new ArrayList<>();

    @Override
    public void reportError(Throwable error) {}

    @Override
    public List<Integer> emit(String streamId, Collection<Tuple> anchors, List<Object> tuples) {
        emitted.add(tuples);
        // No idea what to return
        return null;
    }

    @Override
    public void emitDirect(int taskId, String streamId, Collection<Tuple> anchors,
            List<Object> tuple) {}

    @Override
    public void ack(Tuple input) {
        acked.add(input);
    }

    @Override
    public void fail(Tuple input) {
        failed.add(input);
    }

    public List<List<Object>> getEmitted() {
        return emitted;
    }

    public List<Tuple> getAckedTuples() {
        return acked;
    }

    public List<Tuple> getFailedTuples() {
        return failed;
    }

}

@@ -907,16 +907,67 @@
 .List;%0A%0A
+import backtype.storm.spout.ISpoutOutputCollector;%0A
 import b
@@ -1099,16 +1099,39 @@
 ollector
+, ISpoutOutputCollector
  %7B%0A    p
@@ -2073,10 +2073,356 @@
 %0A    %7D%0A%0A
+    @Override%0A    public List%3CInteger%3E emit(String streamId, List%3CObject%3E tuple, Object messageId) %7B%0A        emitted.add(tuple);%0A        return null;%0A    %7D%0A%0A    @Override%0A    public void emitDirect(int taskId, String streamId, List%3CObject%3E tuple, Object messageId) %7B%0A        emitted.add(tuple);%0A        // TODO Auto-generated method stub%0A%0A    %7D%0A%0A
 %7D%0A

Add ISpoutOutputCollector to TestOutputCollector