/**
 * Copyright 2016-2017 Seznam.cz, a.s.
 *
 * Licensed 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 cz.seznam.euphoria.testing;

import cz.seznam.euphoria.core.client.dataset.Dataset;
import cz.seznam.euphoria.core.client.flow.Flow;
import cz.seznam.euphoria.core.client.io.ListDataSink;
import cz.seznam.euphoria.core.executor.Executor;
import cz.seznam.euphoria.executor.local.LocalExecutor;

import java.util.List;

public abstract class AbstractFlowTest<OUT> {

  protected abstract List<OUT> getOutput();

  protected abstract Dataset<OUT> buildFlow(Flow flow);

  public void execute() {
    final Flow flow = Flow.create("test");
    final ListDataSink<OUT> sink = ListDataSink.get();
    buildFlow(flow).persist(sink);
    final Executor executor = new LocalExecutor();
    executor.submit(flow).join();
    DatasetAssert.unorderedEquals(getOutput(), sink.getOutputs());
  }
}

@@ -929,99 +929,475 @@
 t;%0A%0A
-public abstract class AbstractFlowTest%3COUT%3E %7B%0A%0A  protected abstract List%3COUT%3E getOutput();%0A
+/**%0A * Abstract test class for user's %7B@link Flow%7D testing.%0A *%0A * @param %3COUT%3E type of output dataset%0A */%0Apublic abstract class AbstractFlowTest%3COUT%3E %7B%0A%0A  /**%0A   * This method describes how the final dataset should look like.%0A   *%0A   * @return expected output%0A   */%0A  protected abstract List%3COUT%3E getOutput();%0A%0A  /**%0A   * Creates input using provided %7B@link Flow%7D and creates output dataset.%0A   *%0A   * @param flow to lift inputs from%0A   * @return output dataset%0A   */
 %0A  p

Add comments.