Package jadex.base.test
Class ComponentTestSuite
- java.lang.Object
- 
- junit.framework.TestSuite
- 
- jadex.base.test.ComponentTestSuite
 
 
- 
- All Implemented Interfaces:
- IAbortableTestSuite,- junit.framework.Test
 
 public class ComponentTestSuite extends junit.framework.TestSuite implements IAbortableTestSuite Execute multiple component tests in a test suite.
- 
- 
Field SummaryFields Modifier and Type Field Description booleanabortedIndicate when the suite is aborted due to excessive run time.protected java.lang.ClassLoaderclassloaderThe class loader.protected IExternalAccessplatformThe platform.static booleanSAME_PLATFORMRun all tests on the same platform.protected longtimeoutThe timeout (if any).protected java.util.TimertimerThe timeout timer (if any).
 - 
Constructor SummaryConstructors Constructor Description ComponentTestSuite(java.io.File[][] roots, java.lang.String[] tests, java.lang.String[] excludes)Create a component test suite for components contained in a given path.ComponentTestSuite(java.io.File[][] roots, java.lang.String[] tests, java.lang.String[] excludes, boolean test, boolean load, boolean start)Create a component test suite for components contained in a given path.ComponentTestSuite(java.lang.String[] excludes)Create a component test suite for components contained in class directories on the class path (i.e.ComponentTestSuite(java.lang.String[] args, java.io.File[][] roots, java.lang.String[] tests, java.lang.String[] excludes, boolean runtests, boolean load, boolean start)Create a component test suite for components contained in a given path.ComponentTestSuite(java.lang.String projectDir, java.lang.String[] excludes, boolean includeTestClasses)Create a component test suite for components contained in a given path.ComponentTestSuite(java.lang.String projectDir, java.lang.String[] tests, java.lang.String[] excludes, boolean includeTestClasses)Create a component test suite for components contained in a given path.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanup(junit.framework.TestResult result)Called after test suite is finished.static voidclearAWT()Workaround for AWT/Swing memory leaks.protected static voidcollectClasspathDirectories(java.lang.ClassLoader classloader, java.util.Set<java.io.File> set)Collect all directory URLs belonging to a class loader.static java.io.File[][]findClassDirectories()Find class directories on classpath.protected java.util.List<java.lang.String>getAllFiles(java.io.File root)java.lang.ClassLoadergetClassLoader()Get the class loader.booleanisAborted()Indicate when the suite is aborted due to excessive run time.voidrun(junit.framework.TestResult result)Overridden for pre and post code.protected voidstartTimer()protected voidstopTimer()
 
- 
- 
- 
Field Detail- 
SAME_PLATFORMpublic static final boolean SAME_PLATFORM Run all tests on the same platform.- See Also:
- Constant Field Values
 
 - 
abortedpublic boolean aborted Indicate when the suite is aborted due to excessive run time.
 - 
platformprotected IExternalAccess platform The platform.
 - 
classloaderprotected java.lang.ClassLoader classloader The class loader.
 - 
timeoutprotected long timeout The timeout (if any).
 - 
timerprotected java.util.Timer timer The timeout timer (if any).
 
- 
 - 
Constructor Detail- 
ComponentTestSuitepublic ComponentTestSuite(java.lang.String[] excludes) throws java.lang.ExceptionCreate a component test suite for components contained in class directories on the class path (i.e. not jars).- Parameters:
- excludes- Files to exclude (if a pattern is contained in file path).
- Throws:
- java.lang.Exception
 
 - 
ComponentTestSuitepublic ComponentTestSuite(java.lang.String projectDir, java.lang.String[] excludes, boolean includeTestClasses) throws java.lang.ExceptionCreate a component test suite for components contained in a given path.- Parameters:
- projectDir- The project directory.
- excludes- Files to exclude (if a pattern is contained in file path).
- Throws:
- java.lang.Exception
 
 - 
ComponentTestSuitepublic ComponentTestSuite(java.lang.String projectDir, java.lang.String[] tests, java.lang.String[] excludes, boolean includeTestClasses) throws java.lang.ExceptionCreate a component test suite for components contained in a given path.- Parameters:
- projectDir- The project directory.
- tests- The tests (full qualified names) to include. Includes all, if null.
- excludes- Files to exclude (if a pattern is contained in file path).
- Throws:
- java.lang.Exception
 
 - 
ComponentTestSuitepublic ComponentTestSuite(java.io.File[][] roots, java.lang.String[] tests, java.lang.String[] excludes) throws java.lang.ExceptionCreate a component test suite for components contained in a given path.- Parameters:
- roots- The paths to search for testcases in and to load classes from.
- tests- The tests (full qualified names) to include. Includes all, if null.
- excludes- Files to exclude (if a pattern is contained in file path).
- Throws:
- java.lang.Exception
 
 - 
ComponentTestSuitepublic ComponentTestSuite(java.io.File[][] roots, java.lang.String[] tests, java.lang.String[] excludes, boolean test, boolean load, boolean start) throws java.lang.ExceptionCreate a component test suite for components contained in a given path.- Parameters:
- roots- The paths to search for testcases in and to load classes from.
- tests- The tests (full qualified names) to include. Includes all, if null.
- excludes- Files to exclude (if a pattern is contained in file path).
- test- Run test components.
- load- Include broken components (will cause test failure if any). Also shows loadable, but not startable components as succeeded tests.
- start- Try starting components, which are no test cases.
- Throws:
- java.lang.Exception
 
 - 
ComponentTestSuitepublic ComponentTestSuite(java.lang.String[] args, java.io.File[][] roots, java.lang.String[] tests, java.lang.String[] excludes, boolean runtests, boolean load, boolean start) throws java.lang.ExceptionCreate a component test suite for components contained in a given path.- Parameters:
- args- The platform arguments.
- roots- The paths to search for testcases in and to load classes from. Grouped by project, e.g. proj1/build/classes and proj1/build/resources should be both at index [0] of this array.
- tests- The tests (full qualified names) to include. Includes all, if null.
- excludes- Files to exclude (if a pattern is contained in file path).
- runtests- Run test components.
- load- Include broken components (will cause test failure if any).
- start- Try starting components, which are no test cases.
- Throws:
- java.lang.Exception
 
 
- 
 - 
Method Detail- 
startTimerprotected void startTimer() 
 - 
stopTimerprotected void stopTimer() 
 - 
getAllFilesprotected java.util.List<java.lang.String> getAllFiles(java.io.File root) 
 - 
isAbortedpublic boolean isAborted() Indicate when the suite is aborted due to excessive run time.- Specified by:
- isAbortedin interface- IAbortableTestSuite
 
 - 
runpublic void run(junit.framework.TestResult result) Overridden for pre and post code.- Specified by:
- runin interface- junit.framework.Test
- Overrides:
- runin class- junit.framework.TestSuite
 
 - 
cleanupprotected void cleanup(junit.framework.TestResult result) Called after test suite is finished.
 - 
clearAWTpublic static void clearAWT() Workaround for AWT/Swing memory leaks.
 - 
getClassLoaderpublic java.lang.ClassLoader getClassLoader() Get the class loader.
 - 
findClassDirectoriespublic static java.io.File[][] findClassDirectories() Find class directories on classpath.
 - 
collectClasspathDirectoriesprotected static void collectClasspathDirectories(java.lang.ClassLoader classloader, java.util.Set<java.io.File> set)Collect all directory URLs belonging to a class loader.
 
- 
 
-