ZeroTurnaround Support Forum » JRebel Support

Keep-alive mode for unit test development

(3 posts)
  • Started 7 months ago by andrew
  • Latest reply from David Booth

  1. andrew

    guest

    I've been using JavaRebel since 1.0. It makes my job much more fun than it would otherwise be. It also makes me mad crazy productive. JavaRebel is like crack to those of use who have to deal with legacy J2EE apps and maven.

    I have developed a harness that greatly speeds up test development for both JUnit and Selenium. It's incredibly simple, and I'd like JRebel to include it in some way in a future Intellij plugin. For instance, license the technology to IntelliJ so they can offer a product that dramatically speeds up JUnit test development.

    Here's how it works: I have a main() method that runs unit tests in an infinite loop, with a block on System.in() at the end of the loop so that I can tell the app "do it again without rebooting". Here's what's inside the loop:


    Request r = Request.method(TheClass.class,"testUpdateNGLDPropagation");
    JUnitCore core = new JUnitCore();
    core.addListener(new TheRunListener());
    Result testResult = core.run(r);

    Okay, there's a bit more--like parsing the test results, reporting pass/fail, etc. But that's pretty trivial stuff. The main() class is obviously started with the JavaRebel agent.

    The big benefit here is that I get to avoid huge startup penalties with things like Hibernate, Spring, whatever. Typically I spend very little time tweaking hibernate and SQL but I spend lots more time on the particulars of my test. So to when I slap myself in the head and say "That should have been < instead of >", now I don't have to waste 3 minutes of my life waiting for the whole honkin' Hibernate framework to startup just to run my unit test.

    Posted 7 months ago #
  2. toomasr

    CoreRebel
    Posts: 482

    Sounds like a great idea. I'll pitch it to the team. If you could send an email with a link to this post or just the contents of the post then it would be awesome and we would get your email address to discuss this further.

    The quickest solution that comes to mind is reading the jrebel location from the storage of our plugin. I'm no IDEA plugin expert but I presume your plugin can access that. See http://repos.zeroturnaround.com/svn/jr-ide-support/idea-plugin/trunk/src/com/zeroturnaround/javarebel/idea/plugin/PluginSettingsComponent.java for more details.

    Posted 7 months ago #
  3. David Booth

    guest

    Hi Andrew,

    Can you send me a quick email with your contact information?

    Thanks,

    David
    CEO ZeroTurnaround

    Posted 7 months ago #

RSS feed for this topic

Reply

(required)

(required)

(optional)

(required)

Allowed markup: a blockquote code em strong ul ol li.
Put code in between `backticks`.

Olark Livehelp