< prev index next >

src/com/sun/javatest/finder/ReverseTestFinder.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


  59         this.delegate = delegate;
  60     }
  61 
  62     /**
  63      * Initialize the test finder.
  64      * @param args The first entry in the array should be the name
  65      *          of the test finder to be used to actually read the tests;
  66      *          subsequent entries in the array will be passed through to
  67      *          the init method for that class.
  68      * @param testSuiteRoot The root file of the test suite to be read.
  69      * @param env An environment for the test finder to use if required.
  70      *          The ReverseTestFinder does not use this value directly;
  71      *          it just passes it on to the test finder to which it
  72      *          delegates the reading.
  73      * @throws TestFinder.Fault if any problems occur during initialization.
  74      */
  75     public synchronized void init(String[] args, File testSuiteRoot,
  76                      TestEnvironment env) throws Fault {
  77          String delegateClassName = args[0];
  78          try {
  79              Class  delegateClass = Class.forName(delegateClassName, true, ClassLoader.getSystemClassLoader());
  80              delegate = (TestFinder)(delegateClass.newInstance());
  81              args = shift(args, 1);
  82              delegate.init(args, testSuiteRoot, env);
  83          }
  84          catch (Throwable t) {
  85              throw new Fault(i18n, "reverse.cantInitDelegate", t);
  86          }
  87     }
  88 
  89     public File getRoot() {
  90         return delegate.getRoot();
  91     }
  92 
  93     public File getRootDir() {
  94         return delegate.getRootDir();
  95     }
  96 
  97     public void read(File file) {
  98         delegate.read(file);
  99     }




  59         this.delegate = delegate;
  60     }
  61 
  62     /**
  63      * Initialize the test finder.
  64      * @param args The first entry in the array should be the name
  65      *          of the test finder to be used to actually read the tests;
  66      *          subsequent entries in the array will be passed through to
  67      *          the init method for that class.
  68      * @param testSuiteRoot The root file of the test suite to be read.
  69      * @param env An environment for the test finder to use if required.
  70      *          The ReverseTestFinder does not use this value directly;
  71      *          it just passes it on to the test finder to which it
  72      *          delegates the reading.
  73      * @throws TestFinder.Fault if any problems occur during initialization.
  74      */
  75     public synchronized void init(String[] args, File testSuiteRoot,
  76                      TestEnvironment env) throws Fault {
  77          String delegateClassName = args[0];
  78          try {
  79              Class<?>  delegateClass = Class.forName(delegateClassName, true, ClassLoader.getSystemClassLoader());
  80              delegate = (TestFinder)(delegateClass.newInstance());
  81              args = shift(args, 1);
  82              delegate.init(args, testSuiteRoot, env);
  83          }
  84          catch (Throwable t) {
  85              throw new Fault(i18n, "reverse.cantInitDelegate", t);
  86          }
  87     }
  88 
  89     public File getRoot() {
  90         return delegate.getRoot();
  91     }
  92 
  93     public File getRootDir() {
  94         return delegate.getRootDir();
  95     }
  96 
  97     public void read(File file) {
  98         delegate.read(file);
  99     }


< prev index next >