mil.dod.th.ose.test/src/mil/dod/th/ose/test/PropertyRetrieverMocker.java
public static PropertyRetriever mockIt(BundleContext context, String[] propertyFilename, Properties[] properties) 
        throws IOException
    {
        PropertyRetriever retriever = mock(PropertyRetriever.class);
        
        //mock getting the resources
        Bundle bundle = mock(Bundle.class);
        when(context.getBundle()).thenReturn(bundle);
        
        for (int i=0; i < propertyFilename.length; i++)
        {
            URL url = new URL("file:///file" + propertyFilename[i]);
            when(bundle.getResource(propertyFilename[i])).thenReturn(url);
            when(retriever.getPropertiesFromUrl(url)).thenReturn(properties[i]);
        }
        
        return retriever;
    }
/**
     * Create a mocked instance that will return the given <b>array</b> of properties instead of one properties map.
     * 
     * This assumes a 1 to 1 mapping for the filename and properties array, e.g., index 0 file is for index 0 properties
     * map.
     */
Create a mocked instance that will return the given array of properties instead of one properties map.

This assumes a 1 to 1 mapping for the filename and properties array, e.g., index 0 file is for index 0 properties
map.
Create a mocked instance that will return the given array of properties instead of one properties map . This assumes a 1 to 1 mapping for the filename and properties array e . g . index 0 file is for index 0 properties map .
public static PropertyRetriever mockIt(BundleContext context, String[] propertyFilename, Properties[] properties) 
        throws IOException
    {
        PropertyRetriever retriever = mock(PropertyRetriever.class);
        Bundle bundle = mock(Bundle.class);
        when(context.getBundle()).thenReturn(bundle);
        for (int i=0; i < propertyFilename.length; i++)
        {
            URL url = new URL("file:///file" + propertyFilename[i]);
            when(bundle.getResource(propertyFilename[i])).thenReturn(url);
            when(retriever.getPropertiesFromUrl(url)).thenReturn(properties[i]);
        }
        return retriever;
    }
public static PropertyRetriever mockIt ( BundleContext context , String [ ] propertyFilename , Properties [ ] properties ) throws IOException { PropertyRetriever retriever = mock ( PropertyRetriever . class ) ; Bundle bundle = mock ( Bundle . class ) ; when ( context . getBundle ( ) ) . thenReturn ( bundle ) ; for ( int i = 0 ; i < propertyFilename . length ; i ++ ) { URL url = new URL ( "file:///file" + propertyFilename [ i ] ) ; when ( bundle . getResource ( propertyFilename [ i ] ) ) . thenReturn ( url ) ; when ( retriever . getPropertiesFromUrl ( url ) ) . thenReturn ( properties [ i ] ) ; } return retriever ; }
Create a mocked instance that will return the given <b>array</b> of properties instead of one properties map.
Create a mocked instance that will return the given <b > array< / b > of properties instead of one properties map .
//mock getting the resources