Thanks Emmanuel. I knew it was something simple like that.

Wayne


On 2/22/06, Emmanuel Venisse <[EMAIL PROTECTED]> wrote:
> test resources must be in src/test/resources
>
> You can load your resources with this code :
>
> getClass().getResource( "com/myproject/util/test.txt" );
> or
> getClass().getResourceAsStream( "com/myproject/util/test.txt" );
> or
>
>     public static File getTestFile( String path )
>     {
>         return new File( getBasedir(), path );
>     }
>
>     public static String getBasedir()
>     {
>         if ( basedirPath != null )
>         {
>             return basedirPath;
>         }
>
>         basedirPath = System.getProperty( "basedir" );
>
>         if ( basedirPath == null )
>         {
>             basedirPath = new File( "" ).getAbsolutePath();
>         }
>
>         return basedirPath;
>     }
>
> and File f = getTestFile("com/myproject/util/test.txt");
>
> Emmanuel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to