Details

    • Type: Wish Wish
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: JRuby 0.9.0
    • Fix Version/s: None
    • Component/s: Compiler, Java Integration
    • Labels:
      None
    • Environment:
      JRuby running on JDK1.5+
    • Number of attachments :
      0

      Description

      It would be very nice with support for writing junit4+ tests with JRuby. Besides being more productive
      it would also be a great way to introduce JRuby in Java organisations (since initially using JRuby for
      tests will be considered less risky).

      However for this to work, JRuby would first of all need to support JDK1.5+ annotations so code equal
      in behavior to the java code below can be written in JRuby:

      import org.junit.Test;
      import org.junit.Assert;

      public class AdditionTest {
      private int x = 1;
      private int y = 1;

      // Notice the annotation here:
      @Test public void addition()

      { int z = x + y; Assert.assertEquals(2, z); }

      }

      Example:

      I want to introduce jruby to the team so I suggest writing some of the remaining tests in jruby. It I could write jruby tests that present themselves as JUnit4 tests that would be no problem as the team would not have to do anything new to run the tests using normal eclipse 3.2 functionality. However, if the ruby test framework is used the tests written in jruby can no longer be tested using normal eclipse functionality and they will have to be run in a different way from the existing tests written in java. So we will have to use different test suites and different tools support to run the tests. Clearly a less attractive proposal.

      What would be needed is some way for a ruby class to present itself as a java class with some custom jruby specific way of adding java annotations.

      Note: This was orginally requested on the mailing list on 27.july 2006

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Downgrading to minor priority. Because no equivalent Java types are generated for Ruby types loaded from scripts, there's not currently any way to generate a full Java 5 type with annotations present. This may not be possible to do.

        Show
        Charles Oliver Nutter added a comment - Downgrading to minor priority. Because no equivalent Java types are generated for Ruby types loaded from scripts, there's not currently any way to generate a full Java 5 type with annotations present. This may not be possible to do.
        Hide
        Charles Oliver Nutter added a comment -

        We've come a long way with Java stuff, and we've got a few good tricks on the way that will potentially allow us to generate real Java types for Ruby classes in certain cases, but none of this will happen before 1.0. It's a good idea, but it's not going to be in 1.0.

        Show
        Charles Oliver Nutter added a comment - We've come a long way with Java stuff, and we've got a few good tricks on the way that will potentially allow us to generate real Java types for Ruby classes in certain cases, but none of this will happen before 1.0. It's a good idea, but it's not going to be in 1.0.
        Hide
        Charles Oliver Nutter added a comment -

        Definitely a post 1.1 bug, perhaps in concert with "Compiler #2".

        Show
        Charles Oliver Nutter added a comment - Definitely a post 1.1 bug, perhaps in concert with "Compiler #2".
        Hide
        Charles Oliver Nutter added a comment -

        I'm resolving this as "duplicate" because there are other bugs to track eventual development of a "compiler #2" that can create normal Java classes, at which time all annotation-based libraries should work fine. So there's not really a need to track JUnit4 independent of the larger task of building that compiler.

        Show
        Charles Oliver Nutter added a comment - I'm resolving this as "duplicate" because there are other bugs to track eventual development of a "compiler #2" that can create normal Java classes, at which time all annotation-based libraries should work fine. So there's not really a need to track JUnit4 independent of the larger task of building that compiler.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Morten Christensen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: