// Path: jflask/src/main/java/net/jflask/CustomResponse.java
// public interface CustomResponse {
//   CustomResponse INSTANCE = new CustomResponse() {};
// }
// 
// Path: jflask/src/main/java/net/jflask/Response.java
// public interface Response {
// 
//   void addHeader(String header, String value);
// 
//   /**
//    * Warning: must be called after addHeader().
//    *
//    * @param status
//    * @see java.net.HttpURLConnection
//    */
//   void setStatus(int status);
// 
//   OutputStream getOutputStream();
// 
// }


import java.io.IOException;
import net.jflask.CustomResponse;
import net.jflask.Response;
import net.jflask.Route;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
    resp.setStatus(200);
    resp.getOutputStream().write("foobar".getBytes());
    resp.getOutputStream().close();
  }

  @Route("/async")
  public CustomResponse replyAsync() throws IOException {
    final Response r = app.getResponse();
    new Thread() {
      @Override
      public void run() {
        try {
          reply(r);
        }
        catch (IOException e) {
          e.printStackTrace();
        }
      }
    }.start();
    return CustomResponse.INSTANCE;
  }

  @Test
  public void testSync() throws Exception {
    assertEquals("foobar", client.get("/sync"));
  }

  /**
   * HttpServer does not support replying asynchronously to requests.
   */
// Path: jflask/src/main/java/net/jflask/CustomResponse.java
// public interface CustomResponse {
//   CustomResponse INSTANCE = new CustomResponse() {};
// }
// 
// Path: jflask/src/main/java/net/jflask/Response.java
// public interface Response {
// 
//   void addHeader(String header, String value);
// 
//   /**
//    * Warning: must be called after addHeader().
//    *
//    * @param status
//    * @see java.net.HttpURLConnection
//    */
//   void setStatus(int status);
// 
//   OutputStream getOutputStream();
// 
// }


// Path: jflask/src/test/java/net/jflask/test/AsyncResponseTest.java
import java.io.IOException;
import net.jflask.CustomResponse;
import net.jflask.Response;
import net.jflask.Route;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;

    resp.setStatus(200);
    resp.getOutputStream().write("foobar".getBytes());
    resp.getOutputStream().close();
  }

  @Route("/async")
  public CustomResponse replyAsync() throws IOException {
    final Response r = app.getResponse();
    new Thread() {
      @Override
      public void run() {
        try {
          reply(r);
        }
        catch (IOException e) {
          e.printStackTrace();
        }
      }
    }.start();
    return CustomResponse.INSTANCE;
  }

  @Test
  public void testSync() throws Exception {
    assertEquals("foobar", client.get("/sync"));
  }

  /**
   * HttpServer does not support replying asynchronously to requests.
   */
  @Ignore