package org.apache.flink.tooling;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Unit test for simple App.
 */
public class AppTest 
    extends TestCase
{
    /**
     * Create the test case
     *
     * @param testName name of the test case
     */
    public AppTest( String testName )
    {
        super( testName );
    }

    /**
     * @return the suite of tests being tested
     */
    public static Test suite()
    {
        return new TestSuite( AppTest.class );
    }

    /**
     * Rigourous Test :-)
     */
    public void testApp()
    {
        assertTrue( true );
    }
}

@@ -125,16 +125,45 @@
 Suite;%0A%0A
+import java.io.IOException;%0A%0A
 /**%0A * U
@@ -213,20 +213,17 @@
 ppTest %0A
-    
+%09
 extends 
@@ -233,28 +233,22 @@
 tCase%0A%7B%0A
-    /**%0A    
+%09/**%0A%09
  * Creat
@@ -267,19 +267,13 @@
 ase%0A
-     *%0A    
+%09 *%0A%09
  * @
@@ -309,28 +309,22 @@
 st case%0A
-     */%0A    
+%09 */%0A%09
 public A
@@ -349,30 +349,21 @@
 tName )%0A
-    %7B%0A        
+%09%7B%0A%09%09
 super( t
@@ -373,35 +373,26 @@
 Name );%0A
-    %7D%0A%0A    /**%0A    
+%09%7D%0A%0A%09/**%0A%09
  * @retu
@@ -426,28 +426,22 @@
  tested%0A
-     */%0A    
+%09 */%0A%09
 public s
@@ -459,30 +459,21 @@
 suite()%0A
-    %7B%0A        
+%09%7B%0A%09%09
 return n
@@ -507,27 +507,18 @@
  );%0A
-    %7D%0A%0A    /**%0A    
+%09%7D%0A%0A%09/**%0A%09
  * R
@@ -539,20 +539,14 @@
 :-)%0A
-     */%0A    
+%09 */%0A%09
 publ
@@ -567,46 +567,539 @@
 p()%0A
-    %7B%0A        assertTrue( true );%0A    
+%09%7B%0A%09%7D%0A%0A%09public void testRunCommandStdout() %7B%0A%09%09String expected = %22testing%22;%0A%09%09String output = App.runCommand(%22echo%22, %22-n%22, expected);%0A%09%09assertEquals(expected, output);%0A%09%7D%0A%0A%09public void testRunCommandStderr() %7B%0A%09%09String className = %22ILLEGALCLASS%22;%0A%09%09String output = App.runCommand(%22java%22, className);%0A%09%09assertEquals(%22Error: Could not find or load main class %22 + className + %22%5Cn%22, output);%0A%09%7D%0A%0A%09public void testIllegalCommand() %7B%0A%09%09String output =%09App.runCommand(%22ILLEGALPROGRAM%22);%0A%09%09assertTrue(output.startsWith(%22Error running%22));%0A%09
 %7D%0A%7D%0A

add some simple tests for the command output