Top Description Inners Fields Constructors Methods
org.glassfish.pfl.test

public Class TestBase

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, .Method, java.util.ArrayList, .Arrays, .Collection, .HashSet, .List, .Set, org.glassfish.pfl.basic.tools.argparser.ArgParser, .DefaultValue, .Help, .Separator

A VERY quick-and-dirty test framework.
Author
ken

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private final TestBase.Arguments
private String
private final List<String>
private final Set<String>
private Set<String>
private final Set<String>
private Set<String>
private final List<Method>
private final List<Method>
pack-priv JUnitReportHelper
private Set<String>
private final List<Method>
private final Object

Constructor Summary

AccessConstructor and Description
public
TestBase(String[] args)

public
TestBase(String[] args, Class<?> parserInterface)

public
TestBase(String[] args, Class<?> parserInterface, Object testObject)

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
public void
check(boolean result, String failMessage)

private void
display(String title, List<String> strs)

private void
public void
private void
public void
fail(String failMessage)

public <T> T
private String
private String
public void
public static void
main(String[] args)

private TestBase
msg(String str)

private TestBase
nl()

public void
note(String msg)

public int
run()

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argvalsback to summary
private final TestBase.Arguments argvals
currentback to summary
private String current
currentResultsback to summary
private final List<String> currentResults
excludesback to summary
private final Set<String> excludes
failback to summary
private Set<String> fail
includesback to summary
private final Set<String> includes
passback to summary
private Set<String> pass
postMethodsback to summary
private final List<Method> postMethods
preMethodsback to summary
private final List<Method> preMethods
reportHelperback to summary
pack-priv JUnitReportHelper reportHelper
skipback to summary
private Set<String> skip
testMethodsback to summary
private final List<Method> testMethods
testObjectback to summary
private final Object testObject

Constructor Detail

TestBaseback to summary
public TestBase(String[] args)
TestBaseback to summary
public TestBase(String[] args, Class<?> parserInterface)
TestBaseback to summary
public TestBase(String[] args, Class<?> parserInterface, Object testObject)

Method Detail

badReturnTypeback to summary
public boolean badReturnType()
Annotations
@TestCase
badTestback to summary
public void badTest()
Annotations
@TestCase:Bad
checkback to summary
public void check(boolean result, String failMessage)
displayback to summary
private void display(String title, List<String> strs)
displaySetback to summary
private void displaySet(Set<String> set)
exceptionback to summary
public void exception()
Annotations
@TestCase
executeback to summary
private void execute(Collection<Method> methods) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
failback to summary
public void fail(String failMessage)
getArgumentsback to summary
public <T> T getArguments(Class<T> cls)
getMessageback to summary
private String getMessage(List<String> strs)
getTestIdback to summary
private String getTestId(Method m)
hasParametersback to summary
public void hasParameters(String name)
Annotations
@TestCase
mainback to summary
public static void main(String[] args)
msgback to summary
private TestBase msg(String str)
nlback to summary
private TestBase nl()
noteback to summary
public void note(String msg)
runback to summary
public int run()
testGoodback to summary
public void testGood()
Annotations
@TestCase
testSimpleback to summary
public void testSimple()
Annotations
@TestCase
org.glassfish.pfl.test back to summary

private Interface TestBase.Arguments


Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
public List<String>
public boolean
public List<String>

Method Detail

casesback to summary
public boolean cases()
Annotations
@DefaultValue:false
@Help:Displays the valid test case identifiers
debugback to summary
public boolean debug()
Annotations
@DefaultValue:false
@Help:Control debugging mode
excludeback to summary
public List<String> exclude()
Annotations
@DefaultValue
@Help:A list of test cases to excelude: include everything if empty
@Separator:,
generateJunitReportback to summary
public boolean generateJunitReport()
Annotations
@DefaultValue:true
@Help:If true, generate a JUnit report for the tests
includeback to summary
public List<String> include()
Annotations
@DefaultValue
@Help:A list of test cases to include: includes everything if empty
@Separator:,