title: Tests succeed if run from eclipse (STS) but error if run from grails with ClassNotFoundException
body: <p>I'm getting different test results when run from eclipse (STS) and from grails. </p>
  
  <p>Under grails my tests error (ie dont even run) with a ClassNotFoundException</p>
  
  <p>In eclipse they run successfully. </p>
  
  <p>(And run-app still works fine when run from grails FWIW.)</p>
  
  <p>Tests had been working in both environments for several days.
  Then I deleted a number of files I didn't need (domains. controllers and the unit tests on them)
  Now I have a problem.</p>
  
  <p><strong>Versions:</strong></p>
  
  <pre><code>ubuntu 10.04
  eclipse
  eclipse / SpringToolSuite 3.4.0
   - groovy compiler: groovy 2.07
   - grails location: /home/nick/grails-2.3.6
   - JDK compliance level 1.6
   - JAVA_HOME=/usr/lib/jvm/java-6-openjdk
  grails 2.3.6
   - GRAILS_HOME=/home/nick/grails-2.3.6
   - JAVA_HOME=/usr/lib/jvm/java-6-openjdk
  </code></pre>
  
  <p><strong>eclipse / SpringToolSuite 3.4.0</strong></p>
  
  <p>Everything is still fine and dandy from inside eclipse / STS</p>
  
  <pre><code>select project
  run as &gt; junit test
  runs 24 tests in 3 test classes
  all succeed
  </code></pre>
  
  <p><strong>grails 2.3.6</strong></p>
  
  <p>But from inside grails in a terminal the tests no longer run.</p>
  
  <pre><code>grails&gt; test-app
  | Compiling 2 source files.
  | Error Fatal error running tests: Could not load class in test type 'unit' (Use --stacktrace to see the full trace)
  | Compiling 2 source files..
  | Tests FAILED  - view reports in /home/nick/grails-2.3.6-workspace/imca2/target/test-reports
  </code></pre>
  
  <p>Browsing the test-reports shows: No tests executed.</p>
  
  <p>Adding --stacktrace makes no difference, no stacktrace is provided and it still advises me to add --stacktrace.</p>
  
  <pre><code>grails test-app --stacktrace | tee /tmp/out
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>| Loading Grails 2.3.6
  | Configuring classpath
  | Configuring classpath.
  | Environment set to test
  | Environment set to test.
  | Environment set to test..
  | Environment set to test...
  | Environment set to test....
  | Environment set to test.....
  | Running without daemon...
  | Compiling 1 source files
  | Compiling 1 source files.
  | Error Fatal error running tests: Could not load class in test type 'unit' (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
  java.lang.RuntimeException: Could not load class in test type 'unit'
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
  Caused by: java.lang.ClassNotFoundException: com.ubergen.AdvocacyStaffSpec
      ... 5 more
  | Error Fatal error running tests: Could not load class in test type 'unit'
  | Compiling 1 source files..
  | Tests FAILED  - view reports in /home/nick/grails-2.3.6-workspace/imca2/target/test-reports
  | Error Error running forked test-app: Could not load class in test type 'unit' (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
  java.lang.RuntimeException: Could not load class in test type 'unit'
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
      at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
  Caused by: java.lang.ClassNotFoundException: com.ubergen.AdvocacyStaffSpec
      ... 5 more
  | Error Error running forked test-app: Could not load class in test type 'unit'
  | Error Forked Grails VM exited with error
  </code></pre>
  
  <p>I've tried grails clean and clean-all first. test-app then recompiles everything, but it makes no difference - eclipse still runs the tests successfully and grails still errors without running any of them; and it doesn't matter which order I run them in.</p>
  
  <p>Nor does it make any difference which order I run tests in.</p>
  
  <p>What should I do?</p>