• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Writing JUnit 4 tests in JRuby

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
I'm considering writing JUnit 4 tests in JRuby instead of Java.
I might missed it but I googled it and found nothing about writing JUnit 4 tests in JRuby.
Is it possible to do this?
Thanks.
 
blacksmith
Posts: 979
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,

You might want to have a look at the comments on this page

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.


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends. No annotations in JRuby (last I checked), since that would be a syntactical extension. But you can extend Java classes.

I guess I'd ask why, if you're using JRuby anyway, you wouldn't just write something using a Ruby test framework--much cleaner.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to use RSpec and Cucumber to test Java code?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course; why wouldn't it be? JRuby allows unfettered access to Java classes.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, this looks really powerful and useful.
So if I wrote my tests with JRuby and Ruby testing libraries, how to run them? with Rake or Ant?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The same way you'd run them in Ruby. JRuby *is* Ruby, on the JVM. Modulo some JNI libraries, anything you can do in Ruby you can do with JRuby. Gems work. Libraries work. Ruby works.
reply
    Bookmark Topic Watch Topic
  • New Topic