// Path: client_libs/java/test/helpers/ServerHelper.java
// public class ServerHelper {
//   public Process serverProcess;
//   public BufferedInputStream serverStdOut;
//   public Jarvis jarvis;
// 
//   @Before
//   public void setUp() {
//     try {
//       serverProcess = Runtime.getRuntime().exec("jarvis --testing");
//       serverStdOut  = new BufferedInputStream(serverProcess.getInputStream());
//       // Give the server some time to boot. Dirty, I know, but I can't
//       // think of any better way of doing this at the moment.
//       Thread.sleep(1000);
//       jarvis = new Jarvis();
//     } catch (SecurityException e) {
//       System.out.println("SecurityException in setUp: " + e.getMessage());
//     } catch (IOException e) {
//       System.out.println("IOException in setUp: " + e.getMessage());
//     } catch (JarvisException e) {
//       System.out.println("JarvisException in setUp: " + e.getMessage());
//     } catch (Exception e) {
//       System.out.println("Exception in setUp: " + e.getMessage());
//     }
// 
//     assumeNotNull(serverProcess);
//     assumeNotNull(jarvis);
//   }
// 
//   @After
//   public void tearDown() throws Exception {
//     if (jarvis != null)
//       jarvis.killServer();
// 
//     if (serverStdOut != null)
//       serverStdOut.close();
// 
//     if (serverProcess != null)
//       serverProcess = null;
//   }
// }
// 
// Path: client_libs/java/src/jarvis/exceptions/JarvisException.java
// public class JarvisException extends Exception {
//     public JarvisException(String message) {
//         super(message);
//     }
// 
//     public JarvisException(Throwable t) {
//         super(t);
//     }
// 
//     public JarvisException(String message, Throwable t) {
//         super(message, t);
//     }
// }


import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import helpers.ServerHelper;
import jarvis.exceptions.JarvisException;
    public void testVolumeUp() throws JarvisException {
        assertEquals(105, jarvis.volumeUp());
    }

    @Test
    public void testVolumeDown() throws JarvisException {
        assertEquals(95, jarvis.volumeDown());
    }

    @Test
    public void testTempo() throws JarvisException {
        assertEquals(80, jarvis.getTempo());
    }

    @Test
    public void testSetTempo() throws JarvisException {
        assertEquals(20, jarvis.setTempo(20));
    }

    @Test
    public void testTempoUp() throws JarvisException {
        assertEquals(85, jarvis.tempoUp());
    }

    @Test
    public void testTempoDown() throws JarvisException {
        assertEquals(75, jarvis.tempoDown());
    }

    @Test(expected = JarvisException.class)
// Path: client_libs/java/test/helpers/ServerHelper.java
// public class ServerHelper {
//   public Process serverProcess;
//   public BufferedInputStream serverStdOut;
//   public Jarvis jarvis;
// 
//   @Before
//   public void setUp() {
//     try {
//       serverProcess = Runtime.getRuntime().exec("jarvis --testing");
//       serverStdOut  = new BufferedInputStream(serverProcess.getInputStream());
//       // Give the server some time to boot. Dirty, I know, but I can't
//       // think of any better way of doing this at the moment.
//       Thread.sleep(1000);
//       jarvis = new Jarvis();
//     } catch (SecurityException e) {
//       System.out.println("SecurityException in setUp: " + e.getMessage());
//     } catch (IOException e) {
//       System.out.println("IOException in setUp: " + e.getMessage());
//     } catch (JarvisException e) {
//       System.out.println("JarvisException in setUp: " + e.getMessage());
//     } catch (Exception e) {
//       System.out.println("Exception in setUp: " + e.getMessage());
//     }
// 
//     assumeNotNull(serverProcess);
//     assumeNotNull(jarvis);
//   }
// 
//   @After
//   public void tearDown() throws Exception {
//     if (jarvis != null)
//       jarvis.killServer();
// 
//     if (serverStdOut != null)
//       serverStdOut.close();
// 
//     if (serverProcess != null)
//       serverProcess = null;
//   }
// }
// 
// Path: client_libs/java/src/jarvis/exceptions/JarvisException.java
// public class JarvisException extends Exception {
//     public JarvisException(String message) {
//         super(message);
//     }
// 
//     public JarvisException(Throwable t) {
//         super(t);
//     }
// 
//     public JarvisException(String message, Throwable t) {
//         super(message, t);
//     }
// }


// Path: client_libs/java/test/TestServer.java
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import helpers.ServerHelper;
import jarvis.exceptions.JarvisException;

    public void testVolumeUp() throws JarvisException {
        assertEquals(105, jarvis.volumeUp());
    }

    @Test
    public void testVolumeDown() throws JarvisException {
        assertEquals(95, jarvis.volumeDown());
    }

    @Test
    public void testTempo() throws JarvisException {
        assertEquals(80, jarvis.getTempo());
    }

    @Test
    public void testSetTempo() throws JarvisException {
        assertEquals(20, jarvis.setTempo(20));
    }

    @Test
    public void testTempoUp() throws JarvisException {
        assertEquals(85, jarvis.tempoUp());
    }

    @Test
    public void testTempoDown() throws JarvisException {
        assertEquals(75, jarvis.tempoDown());
    }

    @Test(expected = JarvisException.class)
    public void testNoCommandFound() throws JarvisException {