Package gw.util
Class GosuTestUtil
java.lang.Object
gw.util.GosuTestUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertCausesPRE(String script, ResourceKey... keys) static voidassertHasErrors(IGosuClass gsClass, ResourceKey... expected) static voidassertHasErrors(String strClass, ResourceKey... expected) static voidassertOneError(IGosuClass gsClass, ResourceKey errorKey) static voidassertOneError(String strClass, ResourceKey errorKey) static voidassertOneWarning(IGosuClass gsClass, ResourceKey warningKey) static voidassertOneWarning(String strClass, ResourceKey warningKey) static IExpressioncompileExpression(String script) static IExpressioncompileExpression(String script, boolean bThrowOnWarning) static IExpressioncompileExpression(String script, ISymbolTable table) static IExpressioncompileExpression(String script, ISymbolTable table, boolean bThrowOnWarning) static IExpressioncompileExpression(String script, String varName, IType varType) static IExpressionstatic IProgramcompileProgram(String script, ISymbolTable table) static Objectstatic Objectstatic ObjectEvaluates the given Gosu.static ObjectevalGosu(String script, ISymbolTable table) static ObjectEvaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.static ObjectEvaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.static ObjectEvaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.static ObjectevalGosu(String script, String name1, Object val1, String name2, Object val2, String name3, Object val3) Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.static ObjectevalGosu(String script, String name1, Object val1, String name2, Object val2, String name3, Object val3, String name4, Object val4) Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.static ObjectevalGosu(String script, String name1, Object val1, String name2, Object val2, String name3, Object val3, String name4, Object val4, String name5, Object val5) Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.static ParseResultsExceptiongetParseResultsException(String script) Gets the parse results exception caused by the given program.private static IGosuClass
-
Field Details
-
EMPTY_OBJECT_ARR
-
-
Constructor Details
-
GosuTestUtil
public GosuTestUtil()
-
-
Method Details
-
eval
-
eval
-
evalGosu
Evaluates the given Gosu.- Parameters:
script- - Must be non-null- Throws:
ParseResultsException
-
evalGosu
public static Object evalGosu(String script, String name1, Object val1) throws ParseResultsException Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.- Parameters:
val1- - Must be non-null- Throws:
ParseResultsException
-
evalGosu
public static Object evalGosu(String script, String name1, Object val1, String name2, Object val2) throws ParseResultsException Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.- Parameters:
val1- cannot be null.val2- cannot be null.- Throws:
ParseResultsException
-
evalGosu
public static Object evalGosu(String script, String name1, Object val1, String name2, Object val2, String name3, Object val3) throws ParseResultsException Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.- Parameters:
val1- cannot be null.val2- cannot be null.val3- cannot be null.- Throws:
ParseResultsException
-
evalGosu
public static Object evalGosu(String script, String name1, Object val1, String name2, Object val2, String name3, Object val3, String name4, Object val4) throws ParseResultsException Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.- Parameters:
val1- cannot be null.val2- cannot be null.val3- cannot be null.val4- cannot be null.- Throws:
ParseResultsException
-
evalGosu
public static Object evalGosu(String script, String name1, Object val1, String name2, Object val2, String name3, Object val3, String name4, Object val4, String name5, Object val5) throws ParseResultsException Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.- Parameters:
val1- cannot be null.val2- cannot be null.val3- cannot be null.val4- cannot be null.val5- cannot be null.- Throws:
ParseResultsException
-
evalGosu
Evaluates the given Gosu, with variables of the given names that will be the dynamic (runtime) type of the values passed in.- Parameters:
args- must be an array of alternating non-null name/value pairs- Throws:
ParseResultsException
-
evalGosu
- Throws:
ParseResultsException
-
compileExpression
- Throws:
ParseResultsException
-
compileExpression
public static IExpression compileExpression(String script, String varName, IType varType) throws ParseResultsException - Throws:
ParseResultsException
-
compileExpression
public static IExpression compileExpression(String script, String varName, IType varType, String varName2, IType varType2) throws ParseResultsException - Throws:
ParseResultsException
-
compileExpression
public static IExpression compileExpression(String script, ISymbolTable table) throws ParseResultsException - Throws:
ParseResultsException
-
compileExpression
public static IExpression compileExpression(String script, ISymbolTable table, boolean bThrowOnWarning) throws ParseResultsException - Throws:
ParseResultsException
-
compileExpression
public static IExpression compileExpression(String script, boolean bThrowOnWarning) throws ParseResultsException - Throws:
ParseResultsException
-
compileProgram
public static IProgram compileProgram(String script, ISymbolTable table) throws ParseResultsException - Throws:
ParseResultsException
-
assertHasErrors
public static void assertHasErrors(String strClass, ResourceKey... expected) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
loadClass
-
assertHasErrors
public static void assertHasErrors(IGosuClass gsClass, ResourceKey... expected) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
assertOneError
public static void assertOneError(String strClass, ResourceKey errorKey) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
assertOneError
-
assertOneWarning
public static void assertOneWarning(String strClass, ResourceKey warningKey) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
assertOneWarning
-
getParseResultsException
Gets the parse results exception caused by the given program. Throws an IllegalArgumentException if no parse exceptions are found. -
assertCausesPRE
-