Oh my my my my...classpath woes.

I'm constructing a JUnit class to specifically test ResourceBundles.  And I'm having 
problems with it.  I created other JUnit Test cases and those work (they only test 
java class functionality), so I know overall the JUnit framework within Maven is 
working.

My JUnit test method is simple, just load a resource bundle.  i.e.

ResourceBundle r = ResourceBundle.getBundle("mp.test.TestResources");
assertNull("The 'mp.test.TestResources' resource bundle cannot loaded.", r);

It is always failing, the bundle cannot be found.  My thought is it's a classpath 
issue.  Accordingly I modified my JUnit test to print out the CLASSPATH as defined by 
the System property "java.class.path".   So...here are the facts:

1)  Running "maven test:ui" via the swing gui:

    [java] Tokenizing System Property "java.class.path"
    [java] Found 24 token(s).
    [java] 1. C:\java\lib\hsqldb\jars\hsqldb-1.7.1.jar
    [java] 2. C:\java\lib\db-ojb\jars\db-ojb-1.0.rc3.jar
    [java] 3. .....    
    [java] 21. C:\java\lib\jcifs\jars\jcifs-0.7.3.jar
    [java] 22. C:\java\mpexpress\target\classes
    [java] 23. C:\java\mpexpress\target\test-classes
    [java] 24. 
C:\java\mpexpress\tools\maven-1.0-beta-9\repository\junit\jars\junit-3.8.1.jar

The key entry is #23 - C:\java\mpexpress\target\test-classes, because I know for a 
fact that the resource bundle I'm looking for "mp.test.TestResources" exists as a file 
as C:\java\mpexpress\target\test-classes\mp\test\TestResources.properties.

I don't know why this isn't working.

2)  Running "maven -Dtestcase=mp.util.i18n.ResourceManagerTest test:single" also 
doesn't work, but the classpath is completely different.  Now it's 

  Tokenizing System Property "java.class.path"
Found 1 token(s).
1. C:\java\mpexpress\tools\maven-1.0-beta-9\lib\forehead-1.0-beta-4.jar

What happened to the other 23 elements in my classpath???

I know the file exists, and it is supposedly in the right directory with the correct 
spelling.  Any ideas?

As an aside, I wish there was a really *easy* way to manipulate the classpath in 
Maven.  Maybe there is and I'm missing it now. I would love to be educated on it.

Thanks, Steve

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

Reply via email to