package com.continuuity;

import com.continuuity.api.Application;
import com.continuuity.api.ApplicationSpecification;
import com.continuuity.api.annotation.ProcessInput;
import com.continuuity.api.data.stream.Stream;
import com.continuuity.api.flow.Flow;
import com.continuuity.api.flow.FlowSpecification;
import com.continuuity.api.flow.flowlet.AbstractFlowlet;
import com.continuuity.api.flow.flowlet.OutputEmitter;
import com.continuuity.api.flow.flowlet.StreamEvent;
import com.google.common.base.Charsets;

import java.util.Iterator;

/**
 * App that is not deployable. Since it has no Batch annotation in flowlet.
 * Designed for testing.
 */
public class AppWithNoBatchAnnotation implements Application {

  @Override
  public ApplicationSpecification configure() {
    return ApplicationSpecification.Builder.with()
      .setName("AppWithNoBatchAnnotation")
      .setDescription("Application with no batch annotation that cannot be deployed")
      .withStreams().add(new Stream("input"))
      .noDataSet()
      .withFlows().add(new FlowWithDeployError())
      .noProcedure()
      .noMapReduce()
      .noWorkflow()
      .build();
  }

  public static final class FlowWithDeployError implements Flow {
    @Override
    public FlowSpecification configure() {
      return FlowSpecification.Builder.with()
        .setName("ToyFlow")
        .setDescription("Complex Toy Flow")
        .withFlowlets()
        .add(new ParserFlowlet())
        .add(new BatchExecutionFlowlet())
        .connect()
        .fromStream("input").to("ParserFlowlet")
        .from("ParserFlowlet").to("BatchExecutionFlowlet")
        .build();
    }
  }

  public static final class ParserFlowlet extends AbstractFlowlet {
    private OutputEmitter<String> out;
    @ProcessInput
    public void process(StreamEvent event) {
      out.emit(Charsets.UTF_8.decode(event.getBody()).toString());
    }
  }

  public static final class BatchExecutionFlowlet extends AbstractFlowlet {
    @ProcessInput
    public void process(Iterator<String> datum) {
      while(datum.hasNext()) {
        datum.next();
        //no-op we are just testing the Batch execution mechanics here.
      }
    }
  }

}

@@ -1141,24 +1141,107 @@
 ild();%0A  %7D%0A%0A
+  /**%0A   * Flow that has a deployment error due to missing Batch annotation.%0A   */%0A
   public sta
@@ -1294,16 +1294,16 @@
  Flow %7B%0A
-
     @Ove
@@ -1717,32 +1717,65 @@
 d();%0A    %7D%0A  %7D%0A%0A
+  /**%0A   * Simple Flowlet.%0A   */%0A
   public static 
@@ -2006,16 +2006,69 @@
  %7D%0A  %7D%0A%0A
+  /**%0A   * Batch execution flowlet with error.%0A   */%0A
   public
@@ -2199,24 +2199,24 @@
 g%3E datum) %7B%0A
-
       while(
@@ -2214,16 +2214,17 @@
    while
+ 
 (datum.h

Fix check style issue