Joe Kesselman created XALANJ-2652:
-------------------------------------

             Summary: Test driver issue: Java-based bugzilla tests not finding 
"golden" .out file by default
                 Key: XALANJ-2652
                 URL: https://issues.apache.org/jira/browse/XALANJ-2652
             Project: XalanJ2
          Issue Type: Bug
      Security Level: No security risk; visible to anyone (Ordinary problems in 
Xalan projects.  Anybody can view the issue.)
          Components: TestHarness-TestCase
    Affects Versions: 2.7.3
            Reporter: Joe Kesselman
            Assignee: Gary D. Gregory


In the bugzilla tests for issues 1251, 1266, and 5609, the "golden .out file"  
not being located automagically by the test framework. 

This appears to be because when running the tests from a build, the current 
directory is xalan-test/, and these java-based tests were written with the 
assumption that they would be invoked from the directory the test is running in.

I can work around this by using a "try both cases" block in the test code, as 
shown below. However, there is an argument that this ought to be handled by the 
BugzillaTestletDriver, either by executing the testlet with 
xalan-test/tests/bugzilla as the current directory or by performing the 
try-both for us.

NOTE: This issue may be subsumed under my other issue of this date, suggesting 
some reconsideration of the overall test driver framework.

Workaround code:

      // When run under the test frameword, current directory is usually
      // xalan-test/, whereas goldfile will be in tests/bugzilla/. Check
      // both if necessary. Yes, the test framework should be handling
      // this for us; I should open an issue, but there are arguments for
      // doing some general rework of the test framework.
      String[] goldLocations=new String[]\{".","tests/bugzilla"};
      String goldfileName="Bugzilla2925.out"; // As appropriate for this test
      File goldfile=null;
      for (String location : goldLocations) {
      goldfile=new File(location+"/"+goldfileName);
      if(goldfile.exists())
          break;
      }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to