It works fine except that you have to explicitly add scalatest to your test
classpath.


      define 'scala-sample', :layout => server_layout do
        package :jar
        test.using :junit
        test.with
"org.scalatest:scalatest_#{Scala.version}:jar:#{Scala::ScalaTest.version}"
      end


I tried to have this done by the JUnit TestFramework but I don't see how to
get access to the project language from the "dependencies" method.
TestFramework don't know what project they are associated with.

It looks that this information should be pass from outside.
I gave a stab at a quick patch. Needs some polishing.
https://github.com/alexism/buildr/commit/a40964f3e10198fadd9b6ab089010dee007d6e6a



On Thu, May 26, 2011 at 4:03 PM, Alex Boisvert <[email protected]>wrote:

> On Thu, May 26, 2011 at 3:51 PM, Alexis Midon <[email protected]>
> wrote:
>
> > I've been using scala in some projects and wanted to use the latest 2.9
> > version.
> > I hit some incompatibilities with version 2.8.1 around the compiler
> options
> > and the scalatest version. A patch is already drafted at
> > https://github.com/alexism/buildr/commits/scala_29
> > I wanted to share it with you. I'm sure I missed other compatibility
> issues
> > that you guys will catch.
> >
>
> Cool, I have a similar patch locally so I'll merge both of our changes
> together and commit.
>
>
> > Also, I noticed that, in a same module, you can have sources in src/java
> > and
> > in src/scala. They will be compiled and packaged in the same jar. Pretty
> > cool.
> > However it does not seem possible to do similar things with the unit
> tests.
> > Only the scalatest are executed, my java unit tests are ignored.
> > Am I missing something here? If it's actually not supported, what is your
> > strategy to test both java and scala sources?
> >
>
> You can use JUnit to test both since ScalaTest can be wrapped as JUnit
> tests.
>
> http://www.scalatest.org/scaladoc-1.0/org/scalatest/junit/JUnitRunner.html
> <
> http://www.scalatest.org/scaladoc-1.0/org/scalatest/junit/JUnitRunner.html
> >
>
>
> > Can scalatest run both?
> >
>
> I don't believe so.
>
> alex
>

Reply via email to