Loading ...
Sorry, an error occurred while loading the content.
 

Using @BeforeClass annotation from Scala

Expand Messages
  • Beatriz
    Hi all, I m newbie with Scala. I have an application written in Scala and integrated with JUnit. I need two methods annotated with @BeforeClass and
    Message 1 of 2 , Sep 15, 2010
      Hi all,

      I'm newbie with Scala. I have an application written in Scala and integrated with JUnit. I need two methods annotated with @BeforeClass and @AfterClass. As I know, I can't use these annotations because their methods must be static and Scala doesn't support it. I've tried to extract the methods to an object, but it doesn't work.

      Do you know any way of use those JUnit annotations from Scala?

      Thank you for your help,

      Beatriz Nombela.
    • David Saff
      Beatriz, I ve ran into the same problem, and it s driven me crazy. I m curious if the information in
      Message 2 of 2 , Sep 15, 2010
        Beatriz,

        I've ran into the same problem, and it's driven me crazy. I'm curious
        if the information in
        http://programming-scala.labs.oreilly.com/ch06.html#CompanionObjectsAndJavaStaticMethods
        leads to a viable work-around?

        David Saff

        On Wed, Sep 15, 2010 at 5:50 AM, Beatriz <bnombela@...> wrote:
        > Hi all,
        >
        > I'm newbie with Scala. I have an application written in Scala and integrated with JUnit. I need two methods annotated with @BeforeClass and @AfterClass. As I know, I can't use these annotations because their methods must be static and Scala doesn't support it. I've tried to extract the methods to an object, but it doesn't work.
        >
        > Do you know any way of use those JUnit annotations from Scala?
        >
        > Thank you for your help,
        >
        > Beatriz Nombela.
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.