Erik Husby wrote:
Omair-Inam Abdul-Matin wrote:

I'm facing a weird error. I have the following projects with the dependencies shown (a -> b means a depends on b)
storagemanager->util
stindex->util
stindex->storagemanager


I have made a unit test in the storagemanager project that uses a public static method in a class located in the util project. When I compile and run the test in Eclipse it works fine. Under maven, the source and unit test files compile fine, but if I run the tests the test cases invoking the method fail. If I copy the static method into the unit test itself, then the test passes.

Does anyone know what's going on? I don't want to duplicate utility methods in *all* my unit testcases because of this...


Sounds like a classpath problem to me.

Is the jar containing the class with the static method in your list of dependencies for the project whose tests fail?
Yes... I can run reactor and based on the inter-project dependencies it builds the individual subprojects correctly on the dependency tree (i.e. in the order util, storagemanager, stindex) In the pom for the storagemanager I have defined the util project as a dependency.


What is the exact error message you get?

This is a portion of the test output given by maven
test:test:
[junit] Running storagemanager.CommonsLRUBufferTest
[junit] Tests run: 7, Failures: 0, Errors: 3, Time elapsed: 1.402 sec
[junit] [ERROR] TEST storagemanager.CommonsLRUBufferTest FAILED
[junit] Running storagemanager.CommonsLRUBufferWithAppendTest
[junit] Tests run: 5, Failures: 0, Errors: 4, Time elapsed: 1.041 sec
[junit] [ERROR] TEST storagemanager.CommonsLRUBufferWithAppendTest FAILED
[junit] Running storagemanager.DiskStorageManagerTest
[junit] Tests run: 10, Failures: 0, Errors: 0, Time elapsed: 1.392 sec
[junit] Running storagemanager.MemoryStorageManagerTest
[junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 0.61 sec
[junit] Running storagemanager.TIntVirtualHashtableTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 1.321 sec
[junit] Running storagemanager.TLRUAppendBufferTest
[junit] Tests run: 5, Failures: 0, Errors: 4, Time elapsed: 1.171 sec
[junit] [ERROR] TEST storagemanager.TLRUAppendBufferTest FAILED
[junit] Running storagemanager.TLRUBufferTest
[junit] Tests run: 7, Failures: 0, Errors: 0, Time elapsed: 2.062 sec
[junit] Running storagemanager.TObjectVirtualHashtableTest
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 2.734 sec
[junit] Running storagemanager.TRandomEvictionsBufferTest
[junit] Tests run: 7, Failures: 0, Errors: 0, Time elapsed: 1.402 sec


The errors occur in those tests that invoke the static method... Again I reiterate... Dependencies have been set correctly... because otherwise the project would simply not compile... However I can't tell why the unit tests are giving an error...

Omair


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



Reply via email to