infinitest/infinitest — Issue #73: NoClassDefFoundError for Guava's com.google.common.base.Strings
Author: habuma
Created: 2012-01-11 23:06:29+00:00
State: open

After upgrading to the newest version of Infinitest recently, I noticed that if any of my tests fail (for any reason), the error in the Problems tab is "NoClassDefFoundError (com/google/common/base/String)". Note that in no way do any of my projects' code nor dependencies have a dependency (direct or otherwise) on Guava. But I can make the problem go away by adding Guava to my project's classpath. Also note that the correct test failure message is given when doing the build outside of the IDE with Maven or Gradle.

I've seen this happen on several projects since upgrading to the newest Infinitest, but here's are some details of one place where I know it to happen:

- I'm using SpringSource ToolSuite v2.8.1.RELEASE, with Infinitest 5.1.98 installed.
- I create a new Spring Utility Project (File->New->Spring Template Project and then choose "Simple Spring Utility Project").
- Initially all of the tests given in the template project pass, so there is no problem.
- I change any of the tests, forcing it to fail ("Assert.assertTrue(false);", for example)
- I see the aforementioned NoClassDefFoundError in the Problems tab.

Given the timing of when these errors started appearing (after upgrading Infinitest), I believe this to be a bug in Infinitest. I should not have to add Guava to my project's classpath in order for failed test messages to properly display.