jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-48

Ability to write JUnit4+ tests in JRuby

  • Log In
  • Views
    • XML
    • Word
    • Printable

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+

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

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 27/Sep/06 7:17 PM

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 - 27/Sep/06 7:17 PM 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
Permalink
Charles Oliver Nutter added a comment - 18/Apr/07 3:44 AM

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 - 18/Apr/07 3:44 AM 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
Permalink
Charles Oliver Nutter added a comment - 23/Oct/07 3:46 PM

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

Show
Charles Oliver Nutter added a comment - 23/Oct/07 3:46 PM Definitely a post 1.1 bug, perhaps in concert with "Compiler #2".
Hide
Permalink
Charles Oliver Nutter added a comment - 03/Feb/09 9:58 PM

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 - 03/Feb/09 9:58 PM 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
Vote (0)
Watch (0)

Dates

  • Created:
    27/Jul/06 10:42 AM
    Updated:
    27/Oct/09 1:48 PM
    Resolved:
    03/Feb/09 9:58 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.