//
// ResourceManager.java
// Open XAL 
//
// Created by Tom Pelaia on 9/13/11
// Copyright 2011 Oak Ridge National Lab. All rights reserved.
//

package xal.test;

import java.net.URL;

import xal.smf.Accelerator;
import xal.smf.data.XMLDataManager;


/** ResourceManager is not a test suite, but rather it is a utility used by test suites to load recources from the common test resources package. */
public class ResourceManager {
    /** 
     * Get the URL to the specified resource in the common test resources package.
     * @param resourcePath full modified package path (see the notes for the getResource() method of java.lang.Class) relative to the resources location
     * @return URL to the resource or null if there is none found
     */
    static public URL getResourceURL( final String resourcePath ) {
        return ResourceManager.class.getResource( resourcePath );
    }
    
    
    /** Load and get the default test accelerator */
    static public Accelerator getTestAccelerator() {
        return getAcceleratorForResource( "/config/main.xal" );
    }
    
    
    /** 
     * Load and get the accelerator at the specified resource path
     * @param resourcePath fully qualified modified package path to the resource (see the notes for the getResource() method of java.lang.Class)
     */
    static public Accelerator getAcceleratorForResource( final String resourcePath ) {
        final URL opticsURL = getResourceURL( resourcePath );
        return opticsURL != null ? XMLDataManager.getInstance( opticsURL ).getAccelerator() : null;
    }
}

@@ -889,194 +889,407 @@
   %7D%0A
+%0A%0A
     
-%0A    %0A    /** Load and get the default test accelerator */%0A    static public Accelerator getTestAccelerator() %7B%0A        return getAcceleratorForResource( %22/config/main.xal%22 )
+/** Load and get the default test accelerator */%0A    static public URL getTestAcceleratorURL() %7B%0A        return getResourceURL( %22/config/main.xal%22 );%0A    %7D%0A%0A    %0A    /** Load and get the default test accelerator */%0A    static public Accelerator getTestAccelerator() %7B%0A%09%09final URL opticsURL = getTestAcceleratorURL();%0A%09%09return opticsURL != null ? getAcceleratorAtURL( opticsURL ) : null
 ;%0A    %7D%0A
     
@@ -1284,20 +1284,16 @@
 ;%0A    %7D%0A
-    
 %0A    %0A  
@@ -1664,24 +1664,275 @@
 urcePath );%0A
+%09%09return getAcceleratorAtURL( opticsURL );%0A    %7D%0A%0A%0A    /**%0A     * Load and get the accelerator at the specified resource path%0A     * @param opticsURL URL to the optics%0A     */%0A    static public Accelerator getAcceleratorAtURL( final URL opticsURL ) %7B%0A
         retu

Add methods to get the URL to the Test Accelerator.