This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There should exist capability to allow test developer to write log messages into files. Also golden files approach should be supported. I propose a solution merging ideas from java/test/unit/src/org/netbeans/test/java/LogTestCase.java and from org.netbeans.xtest.log.TestLog See attachment. All methods between "//XXXXXX " markers should go to NbTestCase class. Proposal expects that there will exist only one golden (pass) file for one test class. Also there will be only one log file. I am not sure if we want to support unique log/golden files for each test method.
Created attachment 3241 [details] Loggin capability implementation
In my opinion, golden fiels functionality should be contained in a new class, which would inherit from NbTestCase, because this type of tests is highly specialized. All testcases requiring work with golden files would have to inherit from this class. Merging this functionality to the original NbTestCase would make this class unneccessarily complex and and usage of methods like tearDown() would be more complicated. I also support using unique log/golden file for each test method, because there are many cases in which one test class can contain several testcases, each using its log and golden files. On the other hand, logging possibility (writing to *.log file) should be available in the original NbTestCase class, because this functionality might be used much more often than golden files.
Logging capability and golden files support was implemented to org.netbeans.junit.NbTestCase.java in junit module. So all classes inheriting from NbTestCase (recommended base class for Unit tests intended to be tested via XTest framework).
Verified.