<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ketan&#039;s Musings &#187; cucumber</title>
	<atom:link href="http://ketan.padegaonkar.name/tag/cucumber/feed" rel="self" type="application/rss+xml" />
	<link>http://ketan.padegaonkar.name</link>
	<description>Where he blogs about his eclipse musings</description>
	<lastBuildDate>Sat, 26 Feb 2011 18:24:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Cucumber On JRuby inside Eclipse</title>
		<link>http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html</link>
		<comments>http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html#comments</comments>
		<pubDate>Fri, 10 Apr 2009 03:55:22 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[eclipse-meets-jruby]]></category>
		<category><![CDATA[jruby]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=293</guid>
		<description><![CDATA[Fredrick recently asked on the swtbot newsgroup: My goal is to be able to write some user acceptance tests (using Cucumber) to be able to tests some of my Eclipse plug-ins. Cucumber is a BDD framework written in (J)ruby. It executes plain text files as functional tests. As a first step, the goal was to [...]]]></description>
			<content:encoded><![CDATA[<p>Fredrick recently asked on the <a href="http://www.eclipse.org/newsportal/article.php?id=517&amp;group=eclipse.swtbot#517">swtbot newsgroup</a>:</p>
<blockquote><p>
My goal is to be able to write some user acceptance tests (using Cucumber) to be able to tests some of my Eclipse plug-ins.
</p></blockquote>
<p><a href="http://cukes.info">Cucumber</a> is a BDD framework written in (J)ruby. It executes plain text files as functional tests. As a first step, the goal was to be able to print a simple &#8216;hello world&#8217;:</p>
<p>This required being able to <a href="http://ketan.padegaonkar.name/2009/04/10/run-jruby-from-within-a-jar-and-package-your-own-gems-along.html">bundle jruby with the necessary gems</a>, the jruby jar is already OSGi-fied, so creating a manifest was not required.</p>
<p>First drop in the jruby-complete.jar that <a href="http://ketan.padegaonkar.name/2009/04/10/run-jruby-from-within-a-jar-and-package-your-own-gems-along.html">we just created</a> inside the target eclipse&#8217;s plugins directory.</p>
<p>Then create an eclipse application with the following in it:</p>
<pre>public class CucumberRunner implements IApplication {

    public Object start(IApplicationContext context) throws Exception {
        Bundle bundle = Platform.getBundle("org.jruby.jruby");

        URL jrubyHome = FileLocator.toFileURL(bundle.getEntry("/META-INF/jruby.home"));

        RubyInstanceConfig config = new RubyInstanceConfig();
        config.setJRubyHome(jrubyHome.toString());
        Ruby runtime = JavaEmbedUtils.initialize(new ArrayList(), config);
        RubyRuntimeAdapter evaler = JavaEmbedUtils.newRuntimeAdapter();
        evaler.eval(runtime, "p 'Hello, Eclipse World'");
        JavaEmbedUtils.terminate(runtime);

        return EXIT_OK;
    }

    public void stop() {
        // do nothing
    }
}
</pre>
<div id="attachment_302" class="wp-caption alignnone" style="width: 310px"><a href="http://ketan.padegaonkar.name/files/2009/04/jruby-hello-world.png"><img src="http://ketan.padegaonkar.name/files/2009/04/jruby-hello-world-300x204.png" alt="Hello, Eclipse World" width="300" height="204" class="size-medium wp-image-302" /></a><p class="wp-caption-text">Hello, Eclipse World</p></div>
<p>Now all we needed was to be able to execute the cucumber <a href="http://github.com/aslakhellesoy/cucumber/blob/bbce49bd66750b68418911f3294e07b0d8ed927b/bin/cucumber">executable</a> instead of printing hello world <img src='http://ketan.padegaonkar.name/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Import the <a href='http://ketan.padegaonkar.name/files/2009/04/orgeclipseswtbotcucumber.zip'>cucumber plugin</a> with a sample calculator to execute it:</p>
<div id="attachment_327" class="wp-caption alignnone" style="width: 310px"><a href="http://ketan.padegaonkar.name/files/2009/04/cucumber-calculator.png"><img src="http://ketan.padegaonkar.name/files/2009/04/cucumber-calculator-300x99.png" alt="Cucumber Output" width="300" height="99" class="size-medium wp-image-327" /></a><p class="wp-caption-text">Cucumber Output</p></div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Cucumber+On+JRuby+inside+Eclipse&amp;link=http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html&amp;notes=Fredrick%20recently%20asked%20on%20the%20swtbot%20newsgroup%3A%0A%0A%0AMy%20goal%20is%20to%20be%20able%20to%20write%20some%20user%20acceptance%20tests%20%28using%20Cucumber%29%20to%20be%20able%20to%20tests%20some%20of%20my%20Eclipse%20plug-ins.%0A%0A%0ACucumber%20is%20a%20BDD%20framework%20written%20in%20%28J%29ruby.%20It%20executes%20plain%20text%20files%20as%20functional%20tests.%20As%20a%20first%20step%2C%20the%20goal&amp;short_link=&amp;shortener=bitly&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Cucumber+On+JRuby+inside+Eclipse&amp;link=http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html&amp;notes=Fredrick%20recently%20asked%20on%20the%20swtbot%20newsgroup%3A%0A%0A%0AMy%20goal%20is%20to%20be%20able%20to%20write%20some%20user%20acceptance%20tests%20%28using%20Cucumber%29%20to%20be%20able%20to%20tests%20some%20of%20my%20Eclipse%20plug-ins.%0A%0A%0ACucumber%20is%20a%20BDD%20framework%20written%20in%20%28J%29ruby.%20It%20executes%20plain%20text%20files%20as%20functional%20tests.%20As%20a%20first%20step%2C%20the%20goal&amp;short_link=&amp;shortener=bitly&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Cucumber+On+JRuby+inside+Eclipse&amp;link=http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html&amp;notes=Fredrick%20recently%20asked%20on%20the%20swtbot%20newsgroup%3A%0A%0A%0AMy%20goal%20is%20to%20be%20able%20to%20write%20some%20user%20acceptance%20tests%20%28using%20Cucumber%29%20to%20be%20able%20to%20tests%20some%20of%20my%20Eclipse%20plug-ins.%0A%0A%0ACucumber%20is%20a%20BDD%20framework%20written%20in%20%28J%29ruby.%20It%20executes%20plain%20text%20files%20as%20functional%20tests.%20As%20a%20first%20step%2C%20the%20goal&amp;short_link=&amp;shortener=bitly&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=RT+%40ketanpkr+%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.shareaholic.com/api/share/?title=Cucumber+On+JRuby+inside+Eclipse&amp;link=http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html&amp;notes=Fredrick%20recently%20asked%20on%20the%20swtbot%20newsgroup%3A%0A%0A%0AMy%20goal%20is%20to%20be%20able%20to%20write%20some%20user%20acceptance%20tests%20%28using%20Cucumber%29%20to%20be%20able%20to%20tests%20some%20of%20my%20Eclipse%20plug-ins.%0A%0A%0ACucumber%20is%20a%20BDD%20framework%20written%20in%20%28J%29ruby.%20It%20executes%20plain%20text%20files%20as%20functional%20tests.%20As%20a%20first%20step%2C%20the%20goal&amp;short_link=&amp;shortener=bitly&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=5&amp;tags=&amp;ctype=" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Cucumber+On+JRuby+inside+Eclipse&amp;link=http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html&amp;notes=Fredrick%20recently%20asked%20on%20the%20swtbot%20newsgroup%3A%0A%0A%0AMy%20goal%20is%20to%20be%20able%20to%20write%20some%20user%20acceptance%20tests%20%28using%20Cucumber%29%20to%20be%20able%20to%20tests%20some%20of%20my%20Eclipse%20plug-ins.%0A%0A%0ACucumber%20is%20a%20BDD%20framework%20written%20in%20%28J%29ruby.%20It%20executes%20plain%20text%20files%20as%20functional%20tests.%20As%20a%20first%20step%2C%20the%20goal&amp;short_link=&amp;shortener=bitly&amp;shortener_key=&amp;v=1&amp;apitype=1&amp;apikey=8afa39428933be41f8afdb8ea21a495c&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul><div style="clear: both;"></div><div class="shr-getshr" style="visibility:hidden;font-size:10px !important"><a target="_blank" href="http://www.shareaholic.com/?src=pub">Get Shareaholic</a></div><div style="clear: both;"></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2009/04/10/cucumber-on-jruby-inside-eclipse.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

