Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-6830525

Unreliable array operations in WriteReportCommand.run() may cause to inability to create report

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3
    • jt4.5
    • None
    • tools
    • x86
    • windows_xp

    Description

      Javatest 4.2_b16 (earlier versions as well)

      - Create a testsuite (or modify sample testsuite) with custom Interview class.
      - Create your own class as following:
      public class WrapperFilter extends TestFilter {
          private void TestFilter actualFilter;
          public WrapperFilter(TestFilter actualFilter) {
              this.actualFilter = actualFilter;
          }
          ... implement all necessary TestFilter methods using delegation
      }
      - Override com.sun.javatest.InterviewParameters.getFilters() in the following way:
      {
         TestFilter[] filters = super.getFilters();
         WrapperFilter[] wrappedFilters = new WrapperFilter[filters.length()];
         //do a simple for-each cycle to wrap original filters and add them to array
         return wrappedFilters;
      }

      Technically - this is possible solution and this will be compiled and executed well. You may try to run tests with such implementation of the interview. Everything is fine.

      However, then try following
      - Execute a batch mode command to generate any kind of report:
      >java -jar javatest.jar -workdir <...> -writeReport -filter currentConfig -type xml /usr/tmp/test_rep_batch

      You'll get
      java.lang.ArrayStoreException: com.sun.javatest.InitialUrlFilter
              at com.sun.javatest.util.DynamicArray.append(DynamicArray.java:66)
              at com.sun.javatest.util.DynamicArray.append(DynamicArray.java:91)
              at com.sun.javatest.report.ReportManager$WriteReportCommand.run(ReportMa
      nager.java:204)
              at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:
      175)
              at com.sun.javatest.tool.Main.run(Main.java:387)
              at com.sun.javatest.tool.Main.main0(Main.java:141)
              at com.sun.javatest.tool.Main.main(Main.java:121)

      Attachments

        Activity

          People

            afedorch Alexey Fedorchenko (Inactive)
            kromanovorcl Konstantin Romanovskiy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: