cheeseng/scala-ide — pull request #5 by rlegendi (2012-06-14 11:06:22+00:00)
Title: Updated package running

Hi All,Chee Seng,

I found a [minor issue here](https://github.com/cheeseng/scala-ide/blob/master/org.scala-ide.sdt.scalatest/src/scala/tools/eclipse/scalatest/launching/ScalaTestLaunchDelegate.scala#L217). The basic problem is that package tests wont run for e.g. imported external projects, because the test package is located with a relative URL to the workspace.

Another issue is that `JavaRuntime.getProjectOutputDirectory(configuration)` might return `null` in some specific projects, e.g., when it was mateiralized from a Maven POM, or created by `sbt eclipse`.

The problem is that the project won't have a default output directory. For instance, a project may have different source folders (even for tests, like unit and integration tests in different Eclipse source folders) and output folders. For example, sbt puts the classes under `target/scala-2.9.1/classes` and the test classes under `target/scala-2.9.1/test-classes`.

The result is that when the user right-clicks on a package, it cannot be run with the `Run As -> ScalaTest - Package` action.

It took me quite a while to find and make an initial fix for the issue, probably you can make it better, but thought you might find my fix useful.

Also, I'm a bit unsure if I've done the addition of PowerMock properly to the project, and as I've noted in the code, it would be great if someone could verify the `escapeScalaTestClasspathComponent()` function I wrote.

Thanks in advance for any feedback!