Java Doc for NbTestCase.java in  » IDE-Netbeans » nbjunit » org » netbeans » junit » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » nbjunit » org.netbeans.junit 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.netbeans.junit.NbTestCase

All known Subclasses:   org.netbeans.junit.StdOutTest,  org.netbeans.junit.AssertInstancesTest,  org.netbeans.junit.diff.LineDiffTest,  org.netbeans.junit.LinearSpeedTest,  org.netbeans.junit.FlowControlTest,  org.netbeans.junit.LoggingTest,  org.netbeans.junit.NbPerformanceTestCase,  org.netbeans.junit.NbTestCaseTest,  org.netbeans.junit.RunInEventQueueTest,  org.netbeans.junit.TimeOutTest,  org.netbeans.junit.LoggingExceptionTest,  org.netbeans.junit.MultiTestCase,  org.netbeans.junit.NbTestCasePreferencesTest,  org.netbeans.junit.ide.ProjectSupportTest,  org.netbeans.junit.FlowCountingTest,  org.netbeans.junit.TimeOutHasToPrintLogTest,
NbTestCase
abstract public class NbTestCase extends TestCase implements NbTest(Code)
NetBeans extension to JUnit's TestCase . Adds various abilities such as comparing golden files, getting a working directory for test files, testing memory usage, etc.


Field Summary
 PrintStreamsystemOutPSWrapper
    

Constructor Summary
public  NbTestCase(String name)
     Constructs a test case with the given name.

Method Summary
public static  voidassertFile(String message, String test, String pass, String diff, Diff externalDiff)
     Asserts that two files are the same (their content is identical), when files differ org.netbeans.junit.AssertionFileFailedError AssertionFileFailedError exception is thrown. Depending on the Diff implementation additional output can be generated to the file/dir specified by the diff param.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which definesthe correct content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(String test, String pass, String diff, Diff externalDiff)
     Asserts that two files are the same, it uses specific org.netbeans.junit.diff.Diff Diff implementation to compare two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(String message, String test, String pass, String diff)
     Asserts that two files are the same, it compares two files and stores possible differencies in the output file, the message is displayed when assertion fails.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(String test, String pass, String diff)
     Asserts that two files are the same, it compares two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(String test, String pass)
     Asserts that two files are the same, it just compares two files and doesn't produce any additional output.
public static  voidassertFile(String message, File test, File pass, File diff, Diff externalDiff)
     Asserts that two files are the same (their content is identical), when files differ org.netbeans.junit.AssertionFileFailedError AssertionFileFailedError exception is thrown. Depending on the Diff implementation additional output can be generated to the file/dir specified by the diff param.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which definesthe correct content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(File test, File pass, File diff, Diff externalDiff)
     Asserts that two files are the same, it uses specific org.netbeans.junit.diff.Diff Diff implementation to compare two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(String message, File test, File pass, File diff)
     Asserts that two files are the same, it compares two files and stores possible differencies in the output file, the message is displayed when assertion fails.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(File test, File pass, File diff)
     Asserts that two files are the same, it compares two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored.
public static  voidassertFile(File test, File pass)
     Asserts that two files are the same, it just compares two files and doesn't produce any additional output.
public static  voidassertGC(String text, Reference ref)
     Asserts that the object can be garbage collected.
public static  voidassertGC(String text, Reference ref, Set rootsHint)
     Asserts that the object can be garbage collected.
public static  voidassertSize(String message, int limit, Object root)
     Assert size of some structure.
public static  voidassertSize(String message, Collection roots, int limit)
     Assert size of some structure.
public static  voidassertSize(String message, Collection roots, int limit, Object[] skip)
     Assert size of some structure.
public static  intassertSize(String message, Collection roots, int limit, MemoryFilter skip)
     Assert size of some structure.
public  booleancanRun()
     Checks if a test isn't filtered out by the active filter.
public  voidclearWorkDir()
     Deletes all files including subdirectories in test's working directory.
public  voidcompareReferenceFiles(String testFilename, String goldenFilename, String diffFilename)
     Compares golden file and reference log.
public  voidcompareReferenceFiles()
     Compares default golden file and default reference log.
public static  StringconvertNBFSURL(URL url)
     Converts NetBeans filesystem URL to absolute path.
static  voiddeleteSubFiles(File file)
    
public static  voidfailByBug(int bugID)
     Fails a test with known bug ID.
public static  voidfailByBug(int bugID, String message)
     Fails a test with known bug ID and with the given message.
public  FilegetDataDir()
     Returns pointer to directory with test data (golden files, sample files, ...).
final  longgetExecutionTime()
    
public  StringgetExpectedFail()
     Returns expected fail message.
public  FilegetGoldenFile(String filename)
     Get the test method specific golden file from ${xtest.data}/goldenfiles/${classname} directory.
public  FilegetGoldenFile()
    
public  PrintStreamgetLog(String logName)
     Returns named log stream.
public  PrintStreamgetLog()
     Return default log named as ${testmethod}.log.
public  PrintStreamgetRef()
     Get PrintStream to log inteded for reference files comparision.
final protected  intgetTestNumber()
     Parses the test name to find out whether it encodes a number.
public  FilegetWorkDir()
     Returns unique working directory for a test (each test method has a unique dir). If not available, method tries to create it.
public  StringgetWorkDirPath()
     Returns path to test method working directory as a String.
public  voidlog(String message)
    
public  voidlog(String log, String message)
    
protected  LevellogLevel()
     Allows easy collecting of log messages send thru java.util.logging API. Overwrite and return the log level to collect logs to logging file.
public  voidref(String message)
     Easy to use logging method for printing a message to a reference log.
public  voidrun(TestResult result)
     Runs the test case, while conditionally skip some according to result of NbTestCase.canRun method.
public  voidrunBare()
     Runs the bare test sequence.
protected  booleanrunInEQ()
     Provide ability for tests, setUp and tearDown to request that they run only in the AWT event queue.
public  voidsetFilter(Filter filter)
     Sets active filter.
protected  inttimeOut()
     Provides support for tests that can have problems with terminating.

Field Detail
systemOutPSWrapper
PrintStream systemOutPSWrapper(Code)




Constructor Detail
NbTestCase
public NbTestCase(String name)(Code)
Constructs a test case with the given name.
Parameters:
  name - name of the testcase




Method Detail
assertFile
public static void assertFile(String message, String test, String pass, String diff, Diff externalDiff)(Code)
Asserts that two files are the same (their content is identical), when files differ org.netbeans.junit.AssertionFileFailedError AssertionFileFailedError exception is thrown. Depending on the Diff implementation additional output can be generated to the file/dir specified by the diff param.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which definesthe correct content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.
Parameters:
  externalDiff - instance of class implementing the org.netbeans.junit.diff.Diff interface, it has to bealready initialized, when passed in this assertFile function.



assertFile
public static void assertFile(String test, String pass, String diff, Diff externalDiff)(Code)
Asserts that two files are the same, it uses specific org.netbeans.junit.diff.Diff Diff implementation to compare two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.
Parameters:
  externalDiff - instance of class implementing the org.netbeans.junit.diff.Diff interface, it has to bealready initialized, when passed in this assertFile function.



assertFile
public static void assertFile(String message, String test, String pass, String diff)(Code)
Asserts that two files are the same, it compares two files and stores possible differencies in the output file, the message is displayed when assertion fails.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.



assertFile
public static void assertFile(String test, String pass, String diff)(Code)
Asserts that two files are the same, it compares two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.



assertFile
public static void assertFile(String test, String pass)(Code)
Asserts that two files are the same, it just compares two files and doesn't produce any additional output.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.



assertFile
public static void assertFile(String message, File test, File pass, File diff, Diff externalDiff)(Code)
Asserts that two files are the same (their content is identical), when files differ org.netbeans.junit.AssertionFileFailedError AssertionFileFailedError exception is thrown. Depending on the Diff implementation additional output can be generated to the file/dir specified by the diff param.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which definesthe correct content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.
Parameters:
  externalDiff - instance of class implementing the org.netbeans.junit.diff.Diff interface, it has to bealready initialized, when passed in this assertFile function.



assertFile
public static void assertFile(File test, File pass, File diff, Diff externalDiff)(Code)
Asserts that two files are the same, it uses specific org.netbeans.junit.diff.Diff Diff implementation to compare two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.
Parameters:
  externalDiff - instance of class implementing the org.netbeans.junit.diff.Diff interface, it has to bealready initialized, when passed in this assertFile function.



assertFile
public static void assertFile(String message, File test, File pass, File diff)(Code)
Asserts that two files are the same, it compares two files and stores possible differencies in the output file, the message is displayed when assertion fails.
Parameters:
  message - the detail message for this assertion
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.



assertFile
public static void assertFile(File test, File pass, File diff)(Code)
Asserts that two files are the same, it compares two files and stores possible differencies in the output file.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.
Parameters:
  diff - file, where differences will be stored, when null differences will not be stored. In caseit points to directory the result file name is constructed from the pass argument and placed to thatdirectory. Constructed file name consists from the name of pass file (without extension and path) appendedby the '.diff'.



assertFile
public static void assertFile(File test, File pass)(Code)
Asserts that two files are the same, it just compares two files and doesn't produce any additional output.
Parameters:
  test - first file to be compared, by the convention this should be the test-generated file
Parameters:
  pass - second file to be comapred, it should be so called 'golden' file, which defines thecorrect content for the test-generated file.



assertGC
public static void assertGC(String text, Reference ref)(Code)
Asserts that the object can be garbage collected. Tries to GC ref's referent.
Parameters:
  text - the text to show when test fails.
Parameters:
  ref - the referent to object thatshould be GCed



assertGC
public static void assertGC(String text, Reference ref, Set rootsHint)(Code)
Asserts that the object can be garbage collected. Tries to GC ref's referent.
Parameters:
  text - the text to show when test fails.
Parameters:
  ref - the referent to object that should be GCed
Parameters:
  rootsHint - a set of objects that should be considered part of therootset for this scan. This is useful if you want to verify that one structure(usually long living in real application) is not holding another structurein memory, without setting a static reference to the former structure.

Example:

// test bodyWeakHashMap map = new WeakHashMap();Object target = new Object();map.put(target, "Val");// verification stepReference ref = new WeakReference(target);target = null;assertGC("WeakMap does not hold the key", ref, Collections.singleton(map));



assertSize
public static void assertSize(String message, int limit, Object root)(Code)
Assert size of some structure. Traverses the whole reference graph of objects accessible from given root object and check its size against the limit.
Parameters:
  message - the text to show when test fails.
Parameters:
  limit - maximal allowed heap size of the structure
Parameters:
  root - the root object from which to traverse



assertSize
public static void assertSize(String message, Collection roots, int limit)(Code)
Assert size of some structure. Traverses the whole reference graph of objects accessible from given roots and check its size against the limit.
Parameters:
  message - the text to show when test fails.
Parameters:
  roots - the collection of root objects from which to traverse
Parameters:
  limit - maximal allowed heap size of the structure



assertSize
public static void assertSize(String message, Collection roots, int limit, Object[] skip)(Code)
Assert size of some structure. Traverses the whole reference graph of objects accessible from given roots and check its size against the limit.
Parameters:
  message - the text to show when test fails.
Parameters:
  roots - the collection of root objects from which to traverse
Parameters:
  limit - maximal allowed heap size of the structure
Parameters:
  skip - Array of objects used as a boundary during heap scanning,neither these objects nor references from these objectsare counted.



assertSize
public static int assertSize(String message, Collection roots, int limit, MemoryFilter skip)(Code)
Assert size of some structure. Traverses the whole reference graph of objects accessible from given roots and check its size against the limit.
Parameters:
  message - the text to show when test fails.
Parameters:
  roots - the collection of root objects from which to traverse
Parameters:
  limit - maximal allowed heap size of the structure
Parameters:
  skip - custom filter for counted objects actual size or -1 on internal error.



canRun
public boolean canRun()(Code)
Checks if a test isn't filtered out by the active filter. true if the test can run



clearWorkDir
public void clearWorkDir() throws IOException(Code)
Deletes all files including subdirectories in test's working directory.
throws:
  IOException - if any problem has occured during deleting files/directories



compareReferenceFiles
public void compareReferenceFiles(String testFilename, String goldenFilename, String diffFilename)(Code)
Compares golden file and reference log. If both files are the same, test passes. If files differ, test fails and diff file is created (diff is created only when using native diff, for details see JUnit module documentation)
Parameters:
  testFilename - reference log file name
Parameters:
  goldenFilename - golden file name
Parameters:
  diffFilename - diff file name (optional, if null, then no diff is created)



compareReferenceFiles
public void compareReferenceFiles()(Code)
Compares default golden file and default reference log. If both files are the same, test passes. If files differ, test fails and default diff (${methodname}.diff) file is created (diff is created only when using native diff, for details see JUnit module documentation)



convertNBFSURL
public static String convertNBFSURL(URL url)(Code)
Converts NetBeans filesystem URL to absolute path.
Parameters:
  url - URL to convert absolute path



deleteSubFiles
static void deleteSubFiles(File file) throws IOException(Code)



failByBug
public static void failByBug(int bugID)(Code)
Fails a test with known bug ID.
Parameters:
  bugID - the bug number according bug report system.



failByBug
public static void failByBug(int bugID, String message)(Code)
Fails a test with known bug ID and with the given message.
Parameters:
  bugID - the bug number according bug report system.
Parameters:
  message - the text to show when test fails.



getDataDir
public File getDataDir()(Code)
Returns pointer to directory with test data (golden files, sample files, ...). It is the same from xtest.data property. data directory



getExecutionTime
final long getExecutionTime()(Code)
in nanoseconds



getExpectedFail
public String getExpectedFail()(Code)
Returns expected fail message. expected fail message if it's expected this test fail, null otherwise.



getGoldenFile
public File getGoldenFile(String filename)(Code)
Get the test method specific golden file from ${xtest.data}/goldenfiles/${classname} directory. If not found, try also deprecated src/data/goldenfiles/${classname} resource directory.
Parameters:
  filename - filename to get from golden files directory golden file



getGoldenFile
public File getGoldenFile()(Code)
Get the default testmethod specific golden file from data/goldenfiles/${classname}/${testmethodname}.pass filename to get from golden files resource directory



getLog
public PrintStream getLog(String logName)(Code)
Returns named log stream. If log cannot be created as a file in the testmethod working directory, PrintStream created from System.out is used. Please note, that tests shoudn't call log.close() method, unless they really don't want to use this log anymore.
Parameters:
  logName - name of the log - file in the working directory Log PrintStream



getLog
public PrintStream getLog()(Code)
Return default log named as ${testmethod}.log. If the log cannot be created as a file in testmethod working directory, PrinterStream to System.out is returned log



getRef
public PrintStream getRef()(Code)
Get PrintStream to log inteded for reference files comparision. Reference log is stored as a file named ${testmethod}.ref in test method working directory. If the file cannot be created, the testcase will automatically fail. PrintStream to referencing log



getTestNumber
final protected int getTestNumber()(Code)
Parses the test name to find out whether it encodes a number. The testSomeName1343 represents nubmer 1343. the number
exception:
  may - throw AssertionFailedError if the number is not found in the test name



getWorkDir
public File getWorkDir() throws IOException(Code)
Returns unique working directory for a test (each test method has a unique dir). If not available, method tries to create it. This method uses NbTestCase.getWorkDirPath method to determine the unique path.

Warning: the working directory is not guaranteed to be empty when you get it, so if this is being called in NbTestCase.setUp you are strongly advised to first call NbTestCase.clearWorkDir to ensure that each test run starts with a clean slate.


throws:
  IOException - if the directory cannot be created file to the working directory directory



getWorkDirPath
public String getWorkDirPath()(Code)
Returns path to test method working directory as a String. Path is constructed as ${nbjunit.workdir}/${package}.${classname}/${testmethodname}. (The nbjunit.workdir property should be set in junit.properties; otherwise the default is ${java.io.tmpdir}/tests.) Please note that this method does not guarantee that the working directory really exists. a path to a test method working directory



log
public void log(String message)(Code)
Simple and easy to use method for printing a message to a default log
Parameters:
  message - meesage to log



log
public void log(String log, String message)(Code)
Easy to use method for logging a message to a named log
Parameters:
  log - which log to use
Parameters:
  message - message to log



logLevel
protected Level logLevel()(Code)
Allows easy collecting of log messages send thru java.util.logging API. Overwrite and return the log level to collect logs to logging file. If the method returns non-null level, then the level is assigned to the Logger.getLogger("") and the messages reported to it are then send into regular log file (which is accessible thru NbTestCase.getLog ) and in case of failure the last few messages is also included in failure.getMessage(). default implementation returns null which disables any loggingsupport in test
since:
   1.27
See Also:   Log.enable



ref
public void ref(String message)(Code)
Easy to use logging method for printing a message to a reference log.
Parameters:
  message - message to log



run
public void run(TestResult result)(Code)
Runs the test case, while conditionally skip some according to result of NbTestCase.canRun method.



runBare
public void runBare() throws Throwable(Code)
Runs the bare test sequence. It checks NbTestCase.runInEQ and possibly schedules the call of setUp, runTest and tearDown to AWT event thread. It also consults NbTestCase.timeOut and if so, it starts a count down and aborts the runTest if the time out expires.
exception:
  Throwable - if any exception is thrown



runInEQ
protected boolean runInEQ()(Code)
Provide ability for tests, setUp and tearDown to request that they run only in the AWT event queue. By default, false. true to run all test methods, setUp and tearDown in the EQ, false to run in whatever thread



setFilter
public void setFilter(Filter filter)(Code)
Sets active filter.
Parameters:
  filter - Filter to be set as active for current test, null will reset filtering.



timeOut
protected int timeOut()(Code)
Provides support for tests that can have problems with terminating. Runs the test in a "watchdog" that measures the time the test shall take and if it does not terminate it reports a failure. amount ms to give one test to finish or 0 (default) to disable time outs
since:
   1.20



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.