org.hyphenType.unittesting
Class UnitTestingAppEngine

java.lang.Object
  extended by org.hyphenType.unittesting.UnitTestingAppEngine

public final class UnitTestingAppEngine
extends Object

Author:
Aurelio Akira M. Matsui

Constructor Summary
UnitTestingAppEngine(Class<?> appClass, String... arguments)
           
UnitTestingAppEngine(Class<?> appClass, UnitTestingUserInput input, String... arguments)
           
 
Method Summary
 String err()
           
 StackTraceElement exitCallPoint()
          Retrieves at which point the application under test called Options#exit(Enum) or Options#exit(int).
 boolean exitEnumCalled()
           
 boolean exitIntCalled()
           
 Enum<?> getStatusCodeEnum()
           
 int getStatusCodeInt()
           
 String out()
           
 void saveStdoutInteraction(String fileName)
          Writes the output written to stdout to a file.
 void saveStdoutInteractionHTML(String fileName)
          Writes the output written to stdout to a file using HTML snippet format.
 void saveStdoutInteractionHTML(String fileName, String prefix, String sufix)
          Writes the output written to stdout to a file using HTML snippet format.
 Throwable uncaughtThrowable()
          If the execution of the application under test threw any Throwable that was not caught by any exit status constant, this method will return this Throwable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitTestingAppEngine

public UnitTestingAppEngine(Class<?> appClass,
                            String... arguments)
                     throws InvalidOptionsInterfaceException
Parameters:
appClass -
arguments -
Throws:
InvalidOptionsInterfaceException
InvalidOptionException

UnitTestingAppEngine

public UnitTestingAppEngine(Class<?> appClass,
                            UnitTestingUserInput input,
                            String... arguments)
                     throws InvalidOptionsInterfaceException
Parameters:
appClass -
input -
arguments -
Throws:
InvalidOptionsInterfaceException
InvalidOptionException
Method Detail

err

public String err()
Returns:

out

public String out()
Returns:

getStatusCodeEnum

public Enum<?> getStatusCodeEnum()
Returns:

exitEnumCalled

public boolean exitEnumCalled()
Returns:
True means something called Options#exit(Enum).

getStatusCodeInt

public int getStatusCodeInt()
Returns:

exitIntCalled

public boolean exitIntCalled()
Returns:
True means something called Options#exit(int).

exitCallPoint

public StackTraceElement exitCallPoint()
Retrieves at which point the application under test called Options#exit(Enum) or Options#exit(int).

Returns:
The stack trace element that called Options#exit(Enum) or Options#exit(int).

saveStdoutInteraction

public void saveStdoutInteraction(String fileName)
Writes the output written to stdout to a file.

Parameters:
fileName - The file name to save output to.

saveStdoutInteractionHTML

public void saveStdoutInteractionHTML(String fileName)
Writes the output written to stdout to a file using HTML snippet format.

Parameters:
fileName - The file name to save output to.

saveStdoutInteractionHTML

public void saveStdoutInteractionHTML(String fileName,
                                      String prefix,
                                      String sufix)
Writes the output written to stdout to a file using HTML snippet format.

Parameters:
fileName - The file name to save output to.
prefix - The string to add at the beginning of the generated HTML
sufix - The string to add at the end of the generated HTML

uncaughtThrowable

public Throwable uncaughtThrowable()
If the execution of the application under test threw any Throwable that was not caught by any exit status constant, this method will return this Throwable.

Returns:
The Throwable that was possibly thrown during the execution of the application. Returns null if no throwable was thrown and uncaught.


Copyright © 2013. All Rights Reserved.