Details
-
Type:
Wish
-
Status:
Closed
-
Priority:
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 :
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()
}
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
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.