// Path: src/main/java/jocket/impl/ClosedException.java
// @SuppressWarnings("serial")
// public class ClosedException extends RuntimeException {
// 
//   public ClosedException(String message) {
//     super(message);
//   }
// }


import static org.junit.Assert.*;
import java.io.DataInputStream;
import java.io.OutputStream;
import jocket.impl.ClosedException;
import org.junit.Test;
package jocket.test;





public class TestJocketSocket extends AbstractJocketSocketTest {

  @Test
  public void testWriteRead() throws Exception {
    OutputStream out = c.getOutputStream();
    out.write("hello".getBytes());
    out.flush();
    byte[] buf = new byte[100];
    int len = s.getInputStream().read(buf);
    assertEquals(5, len);
    assertEquals("hello", new String(buf, 0, 5));
  }

  @Test
  public void testCloseOutput() throws Exception {
    c.getOutputStream().close();
    assertEquals(-1, s.getInputStream().read());
  }

  @Test
  public void testCloseInput() throws Exception {
    c.getInputStream().close();
    try {
      s.getOutputStream().write(22);
      fail("");
// Path: src/main/java/jocket/impl/ClosedException.java
// @SuppressWarnings("serial")
// public class ClosedException extends RuntimeException {
// 
//   public ClosedException(String message) {
//     super(message);
//   }
// }


// Path: src/test/java/jocket/test/TestJocketSocket.java
import static org.junit.Assert.*;
import java.io.DataInputStream;
import java.io.OutputStream;
import jocket.impl.ClosedException;
import org.junit.Test;

package jocket.test;





public class TestJocketSocket extends AbstractJocketSocketTest {

  @Test
  public void testWriteRead() throws Exception {
    OutputStream out = c.getOutputStream();
    out.write("hello".getBytes());
    out.flush();
    byte[] buf = new byte[100];
    int len = s.getInputStream().read(buf);
    assertEquals(5, len);
    assertEquals("hello", new String(buf, 0, 5));
  }

  @Test
  public void testCloseOutput() throws Exception {
    c.getOutputStream().close();
    assertEquals(-1, s.getInputStream().read());
  }

  @Test
  public void testCloseInput() throws Exception {
    c.getInputStream().close();
    try {
      s.getOutputStream().write(22);
      fail("");
    } catch (ClosedException e) {