technology

Run JRuby From Within A Jar And Package Your Own Gems Along

Jruby-in a jar already bundles rspec and rake, so the goal was to find out where it gets packaged.

Download the jruby source zip, extract it and open the build.xml file, search for “rspec” (there’s two occurences) and you’ll find that it’s passed in as an argument to the gem installer, add in another line with “cucumber”:

<target name="install-gems">
  <property name="jruby.home" value="${basedir}"/>
  <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
    <classpath refid="build.classpath"/>
    <classpath path="${jruby.classes.dir}"/>
    <sysproperty key="jruby.home" value="${jruby.home}"/>
    <arg value="--command"/>
    <arg value="maybe_install_gems"/>
    <arg value="rspec"/>
    <arg value="rake"/>
    <arg value="cucumber"/> <!-- add cucumber -->
    <arg value="--env-shebang"/>
  </java>
</target>

Then run ant:

$ ant jar-complete

To verify that everything is fine:

$ java -jar lib/jruby-complete.jar -S gem list

*** LOCAL GEMS ***

builder (2.1.2)
cucumber (0.2.3)
diff-lcs (1.1.2)
polyglot (0.2.5)
rake (0.8.4)
rspec (1.2.2)
sources (0.0.1)
term-ansicolor (1.0.3)
treetop (1.2.5)

Great we’ve now managed to package jruby-in-a-jar with some additional gems. Now to run cucumber on jruby in eclipse.

SWTBot 1.2.0 released

For the impatient:
Direct download link: https://sourceforge.net/project/showfiles.php?group_id=188411&package_id=220519&release_id=622752

Update site: http://swtbot.sourceforge.net/latest/update-site/

SWTBot 1.2.0 is the 3rd of the 1.x releases of SWTBot was released last night, and there have already been about 200 downloads by the time of writing this blog post.

SWTBot has always believed in release early release often mantra, and pushes out nightly builds out of CruiseControl. From the download stats I’m looking at, there are more downloads of the nightly build than the ’stable’ available on the sourceforge mirrors.

The highlight of the release is support for view menus and view toolbar.

Thanks to the contributors and adoptors, for patches, criticism, and suggestions for improvement. The release has fixed about 42 issues.

Read more on the detailed release notes and the changelog.

Announcing SWTBot 1.0

I just made new release of SWTBot – 1.0

Direct download link: http://sourceforge.net/project/showfiles.php?group_id=188411&package_id=220519&release_id=601136

Update site: http://swtbot.sourceforge.net/latest/update-site/

Some features:

  • A recorder API — now you can record SWTBot scripts. Still in beta though.
  • Better SWTBot integration in eclipse — now you can run tests within eclipse.
  • More API — now you can use more SWT controls using an even richer API.
  • More stable than before.

For more details, you can read up on the release notes here.

SWTBot at EclipseCon

It is amazing how a talk at EclipseCon can get higher visibility to an otherwise unknown and unheard of project.

SWTBot.org was taking less than 10MB of web page views before, it now takes about 100MB, even before my talk is done with. I’ll let the graphs talk for themselves:

swtbot stats on sourceforge.net

SWTBot at EclipseCon

I’m sitting here at EclipseCon, and the coolest thing about this is getting to meet a lot of interesting people around.

A few folks spoke to me about SWTBot, and asked for a few feature requests. I promptly added those, and checked them into SVN, and my CruiseControl instance at ThoughtWorks says green. Hurray yet another build that can be pushed into production.

Catch hold of me if you are interested in knowing more about SWTBot.

Announcing SWTBot 0.2

I just made new release of SWTBot – 0.2.0.

Some features:

  • A recorder API — now you can record SWTBot scripts.
  • Better SWTBot integration in eclipse — now you can run tests within eclipse.
  • More API — now you can use more SWT controls using an even richer API.

For more details, you can read up on the release notes here.

I'm speaking at EclipseCon

I’ve held back on this post for quite a while now :) my visa was pending all this while, now that that’s out of the way –

I’ll be speaking at EclipseCon about SWT/Eclipse testing, and lessons learnt along the way.

The lack of a good functional testing tool about a year ago, and given that there’s no problem in ‘writing yet another calculator‘ I decided to roll out my own over a few weekends :)

SWTBot is a functional testing tool for SWT applications, that also works for eclipse plugins, and work is still underway. I would be talking about my experiences in dealing with the various functional testing tools, the various pain points of functional testing for SWT and where SWTBot compares to these.

See you at EclipseCon.

Controller Testing in Active Scaffold

I just started my adventure with rails a few nights ago. Figured that Active Scaffold based controllers do something that is different from the default controllers generated by the scaffold generator.

For one all controller tests broke when I moved to active scaffold. Here’s a blog post that talks about testing active scaffold based controllers.

Announcing SWTBot 0.1

I’d like to announce SWTBot a functional testing tool for SWT.

Here is a quick list of features supported by SWTBot.

Here is a link to some sample code and screencasts

Another sneak preview into SWTBot

Here’s yet another sneak preview into SWTBot.

This time SWTBot makes a profound statement “Hello World“, to demonstrate what SWTBot is able to do. Click here to view full screen.

SWTBot also runs on Linux, although the screencasts are all recorded in Windows. Click here, in case you wish to look at the script that executes this.

This preview was created using Wink.