<?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>maxheapsize.com &#187; Java</title>
	<atom:link href="http://maxheapsize.com/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxheapsize.com</link>
	<description>Oliver Wehrens on Programming and Agile</description>
	<lastBuildDate>Tue, 14 Jun 2011 20:41:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Spring 3 MVC, Ajax and jQuery Magic (or better: simplicity)</title>
		<link>http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/</link>
		<comments>http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 04:00:09 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[spring 3]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=595</guid>
		<description><![CDATA[I&#8217;m playing around with some web frameworks lately and to see what&#8217;s in store with Spring 3 MVC (never did too much with it) I gave it a try to see how it handles Ajax. According to ajax simplification announcement it should be possible to get up and running in (almost) no time. We will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2010%2F07%2F20%2Fspring-3-mvc-ajax-and-jquery-magic-or-better-simplicity%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2010%2F07%2F20%2Fspring-3-mvc-ajax-and-jquery-magic-or-better-simplicity%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;m playing around with some web frameworks lately and to see what&#8217;s in store with Spring 3 MVC (never did too much with it) I gave it a try to see how it handles Ajax. According to <a href="http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/">ajax simplification announcement</a> it should be possible to get up and running in (almost) no time.</p>
<p>We will do a simple web application which will show the current time via Ajax. </p>
<p>The directory layout (using maven) should look like this:</p>
<div class="wp-caption aligncenter" style="width: 339px"><img alt="Directory Layout" src="http://maxheapsize.com/static/Spring3MVCFiles.png" title="Ajax result" width="329" height="308" /><p class="wp-caption-text">Directory Layout</p></div>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
	xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
	xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;
	id=&quot;WebApp_ID&quot; version=&quot;2.5&quot;&gt;
	&lt;display-name&gt;Spring3MVC&lt;/display-name&gt;
	&lt;welcome-file-list&gt;
		&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
	&lt;/welcome-file-list&gt;

	&lt;servlet&gt;
		&lt;servlet-name&gt;spring&lt;/servlet-name&gt;
		&lt;servlet-class&gt;
			org.springframework.web.servlet.DispatcherServlet
		&lt;/servlet-class&gt;
		&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
	&lt;/servlet&gt;
	&lt;servlet-mapping&gt;
		&lt;servlet-name&gt;spring&lt;/servlet-name&gt;
		&lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
	&lt;/servlet-mapping&gt;
&lt;/web-app&gt;
</pre>
<p>The web.xml holds no secrets. The Dispatcher servlet is defined and it should react on everything *.html.</p>
<p>Since we named our Servlet &#8216;spring&#8217; we need to add a servlet configuration for that. It goes in WEB-INF as well.</p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns:p=&quot;http://www.springframework.org/schema/p&quot;
	xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
	xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-3.0.xsd&quot;&gt;

	&lt;context:component-scan base-package=&quot;com.maxheapsize.springmvc3.controller&quot; /&gt;

	&lt;bean id=&quot;viewResolver&quot;
		class=&quot;org.springframework.web.servlet.view.UrlBasedViewResolver&quot;&gt;
		&lt;property name=&quot;viewClass&quot; value=&quot;org.springframework.web.servlet.view.JstlView&quot; /&gt;
		&lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/jsp/&quot; /&gt;
		&lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot; /&gt;
	&lt;/bean&gt;
&lt;/beans&gt;
</pre>
<p>It uses the component scanning feature of spring and instructs spring to check the package &#8216;com.maxheapsize.springmvc3.controller&#8217; for controllers. Furthermore a url based view resolver is defined which uses Jstl and looks into /WEB-INF/jsp for jsp with the ending &#8216;.jsp&#8217;. </p>
<p>In  WEB-INF/jsp/hello.jsp we define a jQuery snippet for the Ajax request and provide a button which we should push if we want to know the time.</p>
<pre class="brush: xml; title: ;">
&lt;jsp:useBean id=&quot;message&quot; scope=&quot;request&quot; type=&quot;java.lang.String&quot;/&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Spring MVC Ajax Demo&lt;/title&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;scripts/jquery.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
    function doAjax() {
      $.ajax({
        url: 'time.html',
        data: ({name : &quot;me&quot;}),
        success: function(data) {
          $('#time').html(data);
        }
      });
    }
  &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
${message}
&lt;button id=&quot;demo&quot; onclick=&quot;doAjax()&quot; title=&quot;Button&quot;&gt;Get the time!&lt;/button&gt;
&lt;div id=&quot;time&quot;&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>How does Spring now know which classes or methods to call? Here comes the nice part about it.</p>
<pre class="brush: java; title: ;">
package com.maxheapsize.springmvc3.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.Date;

@Controller
public class HelloWorldController {

  @RequestMapping(&quot;/hello&quot;)
  public ModelAndView helloWorld() {
    return new ModelAndView(&quot;hello&quot;, &quot;message&quot;, &quot;Spring MVC Demo&quot;);
  }

  @RequestMapping(value = &quot;/time&quot;, method = RequestMethod.GET)
  public @ResponseBody String getTime(@RequestParam String name) {
    String result = &quot;Time for &quot; + name + &quot; is &quot; + new Date().toString();
    return result;
  }
}
</pre>
<p>The RequestMappings define the Url&#8217;s which can be called to reach that code. So the helloWorld method is available with &#8216;hello.html&#8217; in the web app. Why hello.html and not just hello ? Because we said so in the web.xml. I included a sample message which will be shown at the web  page when this method is called.</p>
<p> If you now push the button on the webpage, &#8216;time.html&#8217; with a parameter &#8216;name&#8217; is called. This will go directly to the second method. Spring will also check if a string parameter &#8216;name&#8217; (@RequestParam) is present in the original request. The @ResponseBody annotation  indicates that a method return value should be bound to the web response body.</p>
<p>The result will be returned and shown in the webpage.</p>
<div class="wp-caption aligncenter" style="width: 564px"><img alt="Ajax Result" src="http://maxheapsize.com/static/Spring3MVCAjax.png" title="Ajax result" width="554" height="83" /><p class="wp-caption-text">Ajax Result</p></div>
<p>Overall this is a pretty nice integration. I tend to use Spring for many projects and this makes it even easier to write some nice web apps in it. If you have a single page application and all you do is sending ajax request back and forth this might be a solution. </p>
<p><strong>JSON response Update</strong></p>
<p>To get a JSON response from your Controller you need to:</p>
<ol>
<li>Make sure the jackson mapper is present in your classpath. Maven users use:
<pre class="brush: xml; title: ;">
    &lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
      &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
      &lt;version&gt;1.5.3&lt;/version&gt;
    &lt;/dependency&gt;
</pre>
<p>in their pom.xml.
</li>
<li>MySimpleDataObject is a Pojo</li>
<li>The method you are calling has a signature like:
<pre class="brush: java; title: ;">
@RequestMapping(value = &quot;/demo&quot;, method= RequestMethod.GET)
public @ResponseBody MySimpleDataObject doSomething(@RequestParam name, @RequestParam email)
</pre>
</li>
<li>You are returning MySimpleDataObject at the end</li>
<li>Your calling javascript looks like this:
<pre class="brush: jscript; title: ;">
jQuery.getJSON(&quot;demo.html&quot;, {name: name, email: email}, function (data) {
        alert(data.someValueInMySimpleDataObject);
      });
</pre>
</li>
</ol>
<p>See also <a href="http://rwehner.wordpress.com/2010/06/09/2-ways-to-create-json-response-for-ajax-request-in-spring3/">Ralf&#8217;s post about Json and Spring MVC</a>. </p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29&amp;url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;bm_description=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/&amp;title=Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Spring+3+MVC%2C+Ajax+and+jQuery+Magic+%28or+better%3A+simplicity%29+@+http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2010/07/20/spring-3-mvc-ajax-and-jquery-magic-or-better-simplicity/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Getting started with JSF 2 (and Maven)</title>
		<link>http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/</link>
		<comments>http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 21:21:39 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[jsf2]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=270</guid>
		<description><![CDATA[I use Apache Trinidad at work and since JSF 2 is now final I decided to play with it a bit. Of course this is going to be the classic Hello World example (as there are many other like this around the web). First you need to setup a simple Maven project. The file layout [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F07%2F03%2Fgetting-started-with-jsf-2-and-maven%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F07%2F03%2Fgetting-started-with-jsf-2-and-maven%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I use Apache Trinidad at work and since JSF 2 is now final I decided to play with it a bit.</p>
<p>Of course this is going to be the classic Hello World example (as there are many other like this around the web).</p>
<p>First you need to setup a simple Maven project. </p>
<p>The file layout should be something like that.</p>
<div class="wp-caption alignnone" style="width: 300px"><img alt="Directory Layout for JSF 2 Ajax Demo" src="http://maxheapsize.com/static/JSF2AjaxDemoFileLayout.png" title="Directory Layout for JSF 2 Ajax Demo" width="290" height="234" /><p class="wp-caption-text">Directory Layout for JSF 2 Ajax Demo</p></div>
<p>After that change your pom.xml to include the servlet and jsf2 libs.</p>
<pre class="brush: xml; title: ;">
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.maxheapsize&lt;/groupId&gt;
  &lt;artifactId&gt;jsf2demo&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;jsf2demo Maven Webapp&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
      &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
      &lt;version&gt;2.0.0-b13&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;com.sun.faces&lt;/groupId&gt;
      &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt;
      &lt;version&gt;2.0.0-b13&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;jstl&lt;/artifactId&gt;
      &lt;version&gt;1.2&lt;/version&gt;
    &lt;/dependency&gt;

    &lt;dependency&gt;
      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
      &lt;version&gt;2.5&lt;/version&gt;
    &lt;/dependency&gt;

  &lt;/dependencies&gt;
  &lt;build&gt;
    &lt;finalName&gt;jsf2demo&lt;/finalName&gt;
  &lt;/build&gt;

  &lt;repositories&gt;
    &lt;repository&gt;
      &lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;
      &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
      &lt;url&gt;http://download.java.net/maven/2&lt;/url&gt;
    &lt;/repository&gt;
  &lt;/repositories&gt;

&lt;/project&gt;
</pre>
<p>First we are going to create the managed bean to hold the name we are going to enter.</p>
<pre class="brush: java; title: ;">
package com.maxheapsize.jsf2demo;

import javax.faces.bean.*;
import java.io.Serializable;

@ManagedBean
@SessionScoped
public class HelloWorldBean implements Serializable {

  private String name = &quot;&quot;;

  @ManagedProperty(value = &quot;#{demoService}&quot;)
  private Service service;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setService(Service service) {
    this.service = service;
  }

  public String getReverseName() {
    return service.reverse(name);
  }
}
</pre>
<p>To demonstrate the dependency injection with JSF 2 I use a service to reverse the name. Simply add the @ManagedProperty with the name of the service and it will get injected. Of course we need the service. Here it is:</p>
<pre class="brush: java; title: ;">
package com.maxheapsize.jsf2demo;

import javax.faces.bean.*;

@ManagedBean(name=&quot;demoService&quot;)
@ApplicationScoped
public class Service {

  public String reverse(String name) {
    return new StringBuffer(name).reverse().toString().toLowerCase();
  }
}
</pre>
<p>Very simple&#8230;isn&#8217;t it ?</p>
<p>The only thing what&#8217;s missing is the web.xml and the webpage itself.</p>
<p>The web.xml is pretty straight forward and should not show any surprises.</p>
<pre class="brush: xml; title: ;">
&lt;!DOCTYPE web-app PUBLIC
    &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
    &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot; &gt;
&lt;web-app&gt;
  &lt;display-name&gt;Web Application&lt;/display-name&gt;

  &lt;servlet&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;

  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;

  &lt;context-param&gt;
    &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
    &lt;param-value&gt;Development&lt;/param-value&gt;
  &lt;/context-param&gt;
&lt;/web-app&gt;
</pre>
<p>The index.xhtml has some differences from earlier versions of JSF. First, JSF now supports Ajax out of the box. To have this enabled you need to load the jsf.js javascript library. The inputText tag binds to our managed bean and includes an f:ajax tag. This tag determines which part should be rerendered (in this case the element with the id reverseName). F:ajax will execute on value holding components always with an &#8216;onchange&#8217; event and on action components (like commandButtons) with an &#8216;onclick&#8217; event.<br />
The output will trigger the injected service in our managed bean and return the reversed input string.</p>
<pre class="brush: xml; title: ;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
        &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
      xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
      xmlns:h=&quot;http://java.sun.com/jsf/html&quot;&gt;

&lt;h:head&gt;
  &lt;title&gt;JSF Demo&lt;/title&gt;
&lt;/h:head&gt;
&lt;h:body&gt;
  &lt;h:outputScript name=&quot;jsf.js&quot; library=&quot;javax.faces&quot; target=&quot;body&quot;&gt;
&lt;/h:outputScript&gt;
  &lt;h1&gt;Ajax JSF 2 Demo&lt;/h1&gt;
  &lt;h:form&gt;

    &lt;h:inputText id=&quot;name&quot; value=&quot;#{helloWorldBean.name}&quot;&gt;
      &lt;f:ajax render=&quot;reverseName&quot;/&gt;
    &lt;/h:inputText&gt;

    &lt;h:commandButton value=&quot;Say reverse Hi via Ajax&quot;&gt;
      &lt;f:ajax execute=&quot;name&quot; render=&quot;reverseName&quot;/&gt;
    &lt;/h:commandButton&gt;
    &lt;h:outputText id=&quot;reverseName&quot; value=&quot;#{helloWorldBean.reverseName}&quot;/&gt;
  &lt;/h:form&gt;

&lt;/h:body&gt;
&lt;/html&gt;
</pre>
<div class="wp-caption alignnone" style="width: 406px"><img alt="JSF 2 Ajax Demo" src="http://maxheapsize.com/static/JSF2AjaxDemo.png" title="JSF 2 Ajax Demo" width="396" height="107" /><p class="wp-caption-text">JSF 2 Ajax Demo</p></div>
<p>And that&#8217;s it. Sure it&#8217;s a simple example, but so far I do like the minimal configuration and the ajax integration.</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Getting+started+with+JSF+2+%28and+Maven%29&amp;url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;bm_description=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/&amp;title=Getting+started+with+JSF+2+%28and+Maven%29" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Getting+started+with+JSF+2+%28and+Maven%29+@+http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/07/03/getting-started-with-jsf-2-and-maven/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Update on Quant TestTester</title>
		<link>http://maxheapsize.com/2009/06/25/update-on-quant-testtester/</link>
		<comments>http://maxheapsize.com/2009/06/25/update-on-quant-testtester/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 20:31:23 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[quant]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testng]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=258</guid>
		<description><![CDATA[Here is a small update on my little fun project. I released version 0.2 of quant. Now it will recognize all TestNG annotations which do not have a TestNG group (like @BeforeMethod, @BeforeClass etc.). The method &#8216;reportViolation&#8217; on ClassTester will now report whats wrong with the examined class. [/java] assertFalse(classTester.isInvalidTestClass(), classTester.reportViolation()); [java] Above code will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F06%2F25%2Fupdate-on-quant-testtester%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F06%2F25%2Fupdate-on-quant-testtester%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Here is a small update on my little fun project.</p>
<p>I released version 0.2 of quant. Now it will recognize all TestNG annotations which do not have a TestNG group (like @BeforeMethod, @BeforeClass etc.). The method &#8216;reportViolation&#8217; on ClassTester will now report whats wrong with the examined class.</p>
<pre class="brush: java; title: ;">[/java]
 assertFalse(classTester.isInvalidTestClass(),
    classTester.reportViolation());
[java]</pre>
<p>Above code will now report:</p>
<pre>
java.lang.AssertionError:
Report for Class com.maxheapsize.quant.testclasses.SetupMethodWithoutTestGroup
Ignore abstract classes: true
Specified TestGroups :  + testUnitTest
* Methods with wrong test group:
  - testSetUp
</pre>
<p>In this way you know what went wrong and where to look for it.</p>
<p>Quant is now also available in my <a href="http://maxheapsize.com/maven2/com/maxheapsize/quant/">repository</a>. To include it add the following code to your pom.xml.</p>
<pre class="brush: xml; title: ;">
&lt;dependency&gt;
    &lt;groupId&gt;com.maxheapsize&lt;/groupId&gt;
    &lt;artifactId&gt;quant&lt;/artifactId&gt;
    &lt;version&gt;0.2&lt;/version&gt;
&lt;/dependency&gt;
</pre>
<p>For now you need to add my mvn repository to your pom. I&#8217;m about to have it mirrored to the official servers. </p>
<p>Have fun.</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/06/25/update-on-quant-testtester/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Update+on+Quant+TestTester&amp;url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;bm_description=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/06/25/update-on-quant-testtester/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/&amp;title=Update+on+Quant+TestTester" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/06/25/update-on-quant-testtester/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Update+on+Quant+TestTester+@+http://maxheapsize.com/2009/06/25/update-on-quant-testtester/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/06/25/update-on-quant-testtester/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quant &#8211; Check your Tests</title>
		<link>http://maxheapsize.com/2009/05/30/quant-check-your-tests/</link>
		<comments>http://maxheapsize.com/2009/05/30/quant-check-your-tests/#comments</comments>
		<pubDate>Sat, 30 May 2009 20:06:47 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[quant]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testng]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=229</guid>
		<description><![CDATA[Did you ever wondered if all tests your team wrote are really running ? How many disabled tests does your code base have? How many public void methods do not have a @Test annotation (or at the class) ? I saw all of that in the last years. To overcome this situation I wrote a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F05%2F30%2Fquant-check-your-tests%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F05%2F30%2Fquant-check-your-tests%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://maxheapsize.com/static/QuantLogo.png" class="alignleft"/>Did you ever wondered if all tests your team wrote are <strong>really running</strong> ? How many <strong>disabled tests</strong> does your code base have? How many public void methods <strong>do not have a @Test</strong> annotation (or at the class) ? </p>
<p>I saw all of that in the last years.  </p>
<p>To overcome this situation I wrote a couple of java classes which will scan your java test sources and will examine the annotations (for TestNG, sorry JUnit). The code will detect if all public void methods do have a<code> @Test</code> annotation (either direct on the method or on the class) or if there are disabled tests. Both signals are most likely a sign of rotten code. </p>
<p>If you have different test groups defined like &#8216;unitTest&#8217; or &#8216;integrationTest&#8217; you want to make sure all tests are in at least one test group. This ensures if you run all test groups all tests are executed. </p>
<p>The usage is really <strong>simple</strong>. To make sure all your tests are ok is to <strong>write just another test</strong> which will check all tests.</p>
<pre class="brush: java; title: ;">
ClassFinder classFinder =
   new ClassFinder.Builder(sourceDirectory).build();
for (Class klass : classFinder.getClassList()) {
  TestClassTester testClassTester =
    new TestNGTestClassTester.Builder(klass).build();
  Assert.assertTrue(testClassTester.allTestMethodsHaveValidTestGroup());
}
</pre>
<p>You need to specify the source files of your code so that all java files can be scanned. It is possible to exclude certain packages to be checked (via <code>TestNGTestClassTester.Builder(klass).addExcludedPackage("testclasses").build()</code>). After gathering all class names from the sources the code will check for <code>@Test</code> annotations in the test classes. You can also specify the test groups which all test should belong to (via <code>addTestGroup("unitTest")</code> in the builder).</p>
<p>Finding disabled test methods is very simple too (one of the unit tests)</p>
<pre class="brush: java; title: ;">
@Test
public void testNoDisabledTest() {
  DisabledTestFinder unitUnderTest =
    new TestNGDisabledTestFinder.Builder(TwoTestGroups.class).build();
  assertFalse(unitUnderTest.hasDisabledTests());
}
</pre>
<p>This would test a single class (but you can of course feed it with the results of the ClassFinder).</p>
<p>If you combine the possibility to break your build because of defect test classes and a  <strong>continuous integration system</strong>, you can make sure everybody will annotate their classes correctly or never disables tests (or even better use a CI with delayed check in and personal build like Jetbrains Teamcity). Of course you can define your own thresholds for e.g. 30 disabled tests are allowed (I know sometimes you just can&#8217;t avoid it).</p>
<p>The code depends on testng and commons-io and is released under the Apache v2 license.</p>
<p>I still need to figure out where to put the maven2 sources. Either Google code or GitHub ? Any ideas? </p>
<p><strong>Update:</strong> Code is available at <a href="http://code.google.com/p/quant/source/checkout">Google Code Hosting</a>.</p>
<p>Things to implement:</p>
<ul>
<li>A more flexible exclude patterm, like Apache ant maybe</li>
<li>Make sure to check @BeforeXXX and @AfterXXX methods as well</li>
<li>Implement JUnit (maybe <img src='http://maxheapsize.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  )</li>
</ul>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/05/30/quant-check-your-tests/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Quant+%26%238211%3B+Check+your+Tests&amp;url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/05/30/quant-check-your-tests/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;bm_description=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/05/30/quant-check-your-tests/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/05/30/quant-check-your-tests/&amp;title=Quant+%26%238211%3B+Check+your+Tests" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/05/30/quant-check-your-tests/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Quant+%26%238211%3B+Check+your+Tests+@+http://maxheapsize.com/2009/05/30/quant-check-your-tests/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/05/30/quant-check-your-tests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Jetbrains released a Google App Engine plugin for IntelliJ</title>
		<link>http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/</link>
		<comments>http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/#comments</comments>
		<pubDate>Fri, 08 May 2009 21:35:38 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[app engine]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[gaej]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[intellij idea]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=222</guid>
		<description><![CDATA[Jetbrains released a Google App Engine plugin for their IntelliJ IDE. I did not see any announcement about this at all. You will have a new option when creating a new project. After supplying the path to the local app engine SDK your almost good to go. I needed to add the app engine jars [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F05%2F08%2Fjetbrains-released-a-google-app-engine-plugin-for-intellij%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F05%2F08%2Fjetbrains-released-a-google-app-engine-plugin-for-intellij%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Jetbrains <a href="http://plugins.intellij.net/plugin/?id=4254">released a Google App Engine plugin</a> for their IntelliJ IDE. I did not see any announcement about this at all.</p>
<div class="wp-caption alignnone" style="width: 543px"><img alt="New project inside IntelliJ for Google App Engine" src="http://maxheapsize.com/static/intellijgaej.png" title="New project inside IntelliJ for Google App Engine" width="533" height="93" /><p class="wp-caption-text">New project inside IntelliJ for Google App Engine</p></div>
<p>You will have a new option when creating a new project. After supplying the path to the local app engine SDK your almost good to go. I needed to add the app engine jars as libraries to my project. That being out of the way you can start coding, run you local server (a pre configured run configuration is supplied) and also deploy it to Google all from within IntelliJ. I tested it with a very basic example with local development and remote deployment and this works really nice. </p>
<p>Thanks Jetbrains.</p>
<p>From the release notes:</p>
<p>This plugin provides the following features:</p>
<ul>
<li>option on &#8220;Technologies&#8221; page of the module wizard to quickly create:
</li>
<ul>
<li>appengine-web.xml descriptor
</li>
<li>App Engine Facet
</li>
<li>App Engine Dev server run configuration
</li>
</ul>
<li>inspection to report forbidden code in App Engine application
</li>
<li>run configuration for Google App Engine Dev server
</li>
<li>action for uploading an application to Google (Tools | Upload App Engine Application)
</li>
</ul>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ&amp;url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;bm_description=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/&amp;title=Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Jetbrains+released+a+Google+App+Engine+plugin+for+IntelliJ+@+http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/05/08/jetbrains-released-a-google-app-engine-plugin-for-intellij/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Quick Look at Google App Engine for Java</title>
		<link>http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/</link>
		<comments>http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 20:52:51 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=182</guid>
		<description><![CDATA[At Campfire One Google announced their App Engine for Java (this was in the rumor mill for a couple of days already). The first 10,000 developers would get an early look at App Engine&#8217;s Java language support. I would have almost missed it. Some tweets reminded me of registering with Google. I heard of AppEngine [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F04%2F08%2Fa-quick-look-at-google-app-engine-for-java%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F04%2F08%2Fa-quick-look-at-google-app-engine-for-java%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img alt="" src="http://maxheapsize.com/static/appengine.gif" class="alignleft" width="145" height="111" />At <a href="http://code.google.com/campfire/">Campfire One</a> Google <a href="http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html">announced</a> their App Engine for Java (this was in the rumor mill for a couple of days already). The first 10,000 developers would get an early look at App Engine&#8217;s Java language support. I would have almost missed it. Some tweets reminded me of registering with Google. I heard of AppEngine before but the fact that it was only available for Python did not make it very attractive to me. Now the game changed a bit with introducing Java (and <a href="http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine">other JVM languages</a> (JRuby, partial Scala &#8230;), well <a href="http://blog.springsource.com/2009/04/07/write-your-google-app-engine-applications-in-groovy/">Groovy</a> for sure, <a href="http://olabini.com/blog/2009/04/dynamic-languages-on-google-app-engine-an-overview/">Ola Bini</a> has more on that).</p>
<p>After <a href="http://appengine.google.com/">registering</a> with my Google ID they wanted to verify my account with a sms text message. Google is just listing  3 countries and then &#8216;Other&#8217; for sms verification and I expected it would not work with a german cellphone. But it did <img src='http://maxheapsize.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p>The <a href="http://code.google.com/appengine/docs/java/gettingstarted/">Tutorials</a> on their site are working nicely (even if you don&#8217;t have Eclipse which they are always referring to). Just follow the instructions step by step, use ant and the command line to get through the examples. Don&#8217;t copy the template project, this is not in line with the documentation.</p>
<p>In the last hour or so I went from nothing to a running <a href="http://maxheapsize.appspot.com/">Guestbook App at Google (try it!)</a>. Once you get the environment right, the code is pretty straight forward.</p>
<p>I see a couple of things which I do like about the App Engine.</p>
<p><strong>Support for Google Id and Sign In</strong><br />
AppEngine support sign in with an Google ID with 2! lines of code. Great. I don&#8217;t want to worry about that (this generates the Google login page and redirects).</p>
<pre name="code" class="java">
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
</pre>
<p><strong>Automagic Persistence</strong><br />
With simple annotation you persist your objects. No mapping, no nothing. You can configure if you want to be using JDO or JPA. No database hassle or whatsoever. Of course it needs to be seen how this work with more complex domain models. </p>
<pre class="brush: java; title: ;">
@PersistenceCapable(identityType = IdentityType.APPLICATION)
..
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;

    @Persistent
    private User author;

    @Persistent
    private String content;

    @Persistent
    private Date date;
...
</pre>
<p><strong>Local Development &#8211; Remote Depolyment</strong><br />
Everything works locally. If you deploy it to Google it uses the Google facilities. I don&#8217;t have to worry (deployment is one ant command).</p>
<p><strong>Scalability and free Use</strong><br />
If your application is successful you can grow with Google. More Resources at your fingertips. Of course this costs money (but you should make money at this point right?). If you are beyond the <strong>free</strong> 10 GB bandwidth in/day, 10 GB bandwidth out/day, 5 million pageviews a month, 46.3 cpu h/day and 1000 emails/day you pay:</p>
<ul>
<li>CPU Time 	$0.10/CPU hour </li>
<li>Bandwidth Out $0.12/GByte </li>
<li>Bandwidth In $0.10/GByte </li>
<li>Stored Data $0.005/GByte-day</li>
<li>Recipients Emailed $0.0001/Email </li>
</ul>
<p><strong>Monitoring</strong><br />
You get nice and detailed overview of the status of you application. You can upload new version any time and go live on demand.<br />
<div class="wp-caption alignnone" style="width: 460px"><img alt="Google AppEngine Dashboard" src="http://maxheapsize.com/static/GoogleAppEngineDashboard.jpg" title="Google AppEngine Dashboard" width="450" height="303" /><p class="wp-caption-text">Google AppEngine Dashboard</p></div></p>
<p>This this is limited access and Google titles it &#8216;early look&#8217; there must be some gotchas but I hope they will get worked out. Of course you will depend on Google&#8217;s code but I could imagine with a good abstraction layer you can minimize the dependencies to the AppEngine (although replacing some services you might need to use could be hard).</p>
<p>The downside of using it are (gathered from various sources)</p>
<ul>
<li>No own threads</li>
<li>Restrictions of java.io.File</li>
<li>Restrictions on reflection</li>
<li>Maximum of 30 seconds per request</li>
<li>An application may not open sockets</li>
</ul>
<p>For sure there are some more benefits in hosting with Google (I guess the same goes for Amazon with S3/EC2). In the past I heard from a couple of startups using those kind of services but I never imagined that it would be that easy.  As I said, I was up and running in under one hour.</p>
<p>I certainly will use AppEngine for a small application in the near future.</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=A+Quick+Look+at+Google+App+Engine+for+Java&amp;url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;bm_description=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/&amp;title=A+Quick+Look+at+Google+App+Engine+for+Java" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+A+Quick+Look+at+Google+App+Engine+for+Java+@+http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/04/08/a-quick-look-at-google-app-engine-for-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using TestNG with DataProviders to cover more test cases</title>
		<link>http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/</link>
		<comments>http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:51:44 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testng]]></category>
		<category><![CDATA[unit]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=150</guid>
		<description><![CDATA[A couple of days ago I had the case that I needed to test a method with different parameters. I ended up writing a couple of test methods differing only in passing various arguments to the unit under test. Tonight I was at a TestNG talk and while I knew most of the stuff already [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F03%2F23%2Fusing-testng-with-dataproviders-to-cover-more-test-cases%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F03%2F23%2Fusing-testng-with-dataproviders-to-cover-more-test-cases%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A couple of days ago I had the case that I needed to test a method with different parameters. I ended up writing a couple of test methods <strong>differing only in passing various arguments</strong> to the unit under test. </p>
<p>Tonight I was at a <a href="http://newthinking-store.de/stammtisch/javausergroup/20090310">TestNG</a> talk and while I knew most of the stuff already the DataProviders (which I heard of before but unfortunately never really payed attention to) really caught me.</p>
<p>Now I can create a<strong> DataProvider which generates test data</strong>. Each of these data sets will result in call of the test method with the corresponding arguments. </p>
<p>The following code will test a String to Property Converter if it works correctly. It takes two parameters, first the string to be converted, second the result which I will assert.</p>
<pre class="brush: java; title: ;">
@Test(dataProvider = &quot;convertTestDataProvider&quot;)
public void testConvert(String property, String result)
{
    Properties properties =
      stringPropertyConverter.convertString(property);
    Assert.assertTrue(properties.get(&quot;A&quot;).equals(result));
  }
</pre>
<p>Now the DataProvider must return an array of array of objects. TestNG will cast the return values to the method signature of all the tests with the corresponding annotation.</p>
<pre class="brush: java; title: ;">
    @DataProvider(name = &quot;convertTestDataProvider&quot;)
    public Object[][] convertTestDataProvider()
    {
        return new Object[][]{
                {&quot;A=&quot;, &quot;&quot;},
                {&quot;A=1&quot;, &quot;1&quot;},
                {&quot;A=2=3&quot;, &quot;2=3&quot;},
                {&quot;A=2&quot; + StringPropertyConverter.ideaLineSeperator +
                 &quot;# Comment&quot; +
                 StringPropertyConverter.ideaLineSeperator + &quot;C=1&quot;, &quot;2&quot;},
        };
    }
</pre>
<p>Here I cover 4 test cases. It is very easy to add more tests just by adding one more line with the values to test and the expected result.</p>
<div class="wp-caption alignnone" style="width: 473px"><img alt="TestNG results with DataProvider" src="http://maxheapsize.com/static/TestNGWithDataProvider.jpg" title="TestNG results with DataProvider" width="463" height="312" /><p class="wp-caption-text">TestNG results with DataProvider</p></div>
<p>This will save me some amount of time.</p>
<p>Good Job <a href="http://beust.com/weblog/">Cedrik</a> &#038; friends.</p>
<p>Next step: How to make sure you cover all the relevant test cases (and having a systematic way of getting there). Anybody has an Idea?</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Using+TestNG+with+DataProviders+to+cover+more+test+cases&amp;url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;bm_description=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/&amp;title=Using+TestNG+with+DataProviders+to+cover+more+test+cases" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Using+TestNG+with+DataProviders+to+cover+more+test+cases+@+http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/03/23/using-testng-with-dataproviders-to-cover-more-test-cases/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Three reasons why you don&#8217;t want to use a Spring context in unit tests</title>
		<link>http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/</link>
		<comments>http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 21:52:58 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[solid]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=90</guid>
		<description><![CDATA[You use Spring in your application everywhere. You love it. Everything gets injected and is configured by Spring. Great. Why not use the same technology to wire up your tests? The bottom line is: Starting the Spring Context all the time in your tests drags you down at the costs of development time. Here is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F02%2F25%2Fthree-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F02%2F25%2Fthree-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>You use Spring in  your application everywhere. You love it. Everything gets injected and is configured by Spring. Great. Why not use the same technology to wire up your tests?</p>
<p>The bottom line is: Starting the Spring Context all the time in your tests drags you down at the costs of development time.</p>
<p>Here is why:</p>
<p><strong>1. Turnaround times are much faster</strong></p>
<p>When you discover a bug which might have not been covered by tests yet (this happens to me all the time) you are much faster rerunning your tests without the application context. In the application I&#8217;m working on it takes about 20-25 seconds to run a test with application context, whereas a pure unit test just takes 1 second. Now imagine this: changing some code and rerunning tests like 100 times saves you a lot of time. The <strong>tests run faster</strong>, you <strong>don&#8217;t get distracted</strong> because you could do something else in those 20-25 seconds, like browsing some web pages (you want to be efficient and use the &#8216;spare&#8217; time to read up the newest stories on infoq.com). But then you need to switch windows, read something, switch back, wonder what you did, rethink the problem and so on. In the end it costs you much more time than it  seems.</p>
<p><strong>2. Enables you pratice Test Driven Development</strong></p>
<p>Since you can run test faster without the Spring context, you can start doing Test Driven Development. Before any line of production code gets typed into your IDE, write the test. That the code does not compile is the first test, go fix it by writing the actual stub for the class which you want to test. Now onto the next test. It fails, you implement the feature and rerun the test. This goes on and on and on until you fully implemented the requirements. It forces you <strong>only to implements the things needed</strong> and not more.</p>
<p>Uncle Bob&#8217;s three rules of Test Driven Development</p>
<blockquote><p>
1. You are not allowed to write any production code unless it is to make a failing unit test pass.<br />
2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.<br />
3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
</p></blockquote>
<p>Learn more about <a title="Uncle Bob about Test Driven Development" href="http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd">Test Driven Development</a> with Uncle Bob.</p>
<p>Without fast unit tests you just can&#8217;t do TDD.</p>
<p><strong>3. No corrupt test configuration<br />
</strong></p>
<p>Depending on the setup of the project you might have an extra Spring application context configuration for tests. You have to configure and keep it up to date. Things can go wrong here and will be detected very late.<br />
If you use the application context in tests you get the beans injected but sometimes you need to mock them, because you depend on an application server, a database or an external service which you don&#8217;t want to start up every time you run tests. You must be very careful with that. Using <strong>mocks</strong> with Spring application context can be <strong>very powerful but also very dangerous</strong>. You have to make sure that you remove the mocks after you are done with your tests (and reinject the right ones) or mark the methods which are injecting mocks with the DirtiesContext annotation so Spring can reload them.  I did debug forgotten DirtiesContext annotations one too many times. The mock object lives on in your context and 282 test later an exception occurs for no reason and you start debugging at a  wrong place.<br />
You will not discover those mock problems until you run the full suite of tests. Since your <strong>tests are slow</strong> you not very likely to run all the on a regular basis to see if everything  plays well together.  No, you run all tests <strong>right before checkin</strong> and then start to wonder why some tests somewhere <strong>fail</strong>. Depending on the size of the changes and the project it will require some substantial amount of time to find and fix the problem.</p>
<p>You might say: &#8220;But I need my application context in the tests. My Service which I want to test has so many dependencies, I just can&#8217;t mock them all!&#8221;</p>
<p>While this happened to me as well it might turn out that this service is maybe doing too much. Split the functionality  into smaller packages and test them individually (that&#8217;s the S in <a title="Solid Principles" href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">SOLID</a> principles). The danger in testing a complex service with mocks only is also that you might end up mocking everything and you don&#8217;t do any real tests anymore (happened to me, I threw hours of coding away).</p>
<p>There is one reason to run tests with a Spring application context. It&#8217;s just not in unit tests. If you want to test the integration with external services (like databases or webservices) you need to use it  of course. Just make sure you really just test the interaction between your service and the external interface and not more (but even that is debatable in some cases). That&#8217;s what I call an integration test.</p>
<p>Do you use Spring in your unit tests? What experiences did you make?</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests&amp;url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;bm_description=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/&amp;title=Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Three+reasons+why+you+don%26%238217%3Bt+want+to+use+a+Spring+context+in+unit+tests+@+http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/02/25/three-reasons-why-you-dont-want-to-use-a-spring-context-in-unit-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sorting your properties files in IntelliJ Idea</title>
		<link>http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/</link>
		<comments>http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 07:00:38 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[properties]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=74</guid>
		<description><![CDATA[I do work with language property files pretty much every day (since I&#8217;m the GUI guy in the team). The files are updated on different branches copied up to the trunk and merged down to new branches, sometimes even updated by our product owner. We got a couple of times into not so funny merge [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F02%2F23%2Fsorting-your-properties-files-in-idea%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F02%2F23%2Fsorting-your-properties-files-in-idea%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I do work with language property files pretty much every day (since I&#8217;m the GUI guy in the team). The files are updated on different branches copied up to the trunk and merged down to new branches, sometimes even updated by our product owner. We got a couple of times into not so funny merge conflicts since people did not sort the property files in the same way. To get around that we used an external tool to sort the files just before committing them. </p>
<p>Right, we can do better than this. </p>
<p>I wrote a small plugin for IntelliJ IDEA (and turns out my colleague too) for sorting these inside IDEA. I took the easy approach to sort them in the editor window. Simply open a properties file and choose <em>Code</em> &#8211; <em>Sort Properties</em>. It detects if this is  a real properties file (e.g. all lines do  have a # at the start or do follow the pattern key=value) and sorts them. If things go boom you always can undo <img src='http://maxheapsize.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p><img alt="" src="http://maxheapsize.com/static/ideapropertysorter_small.gif" title="Idea Property File Sorter" class="alignnone" width="300" height="240" />  </p>
<p>You can get it from <a href="/static/IdeaPropertySorter.zip">here</a>. It&#8217;s just 7KB since I did not include the testng jars. </p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Sorting+your+properties+files+in+IntelliJ+Idea&amp;url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;bm_description=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/&amp;title=Sorting+your+properties+files+in+IntelliJ+Idea" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Sorting+your+properties+files+in+IntelliJ+Idea+@+http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/02/23/sorting-your-properties-files-in-idea/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>IntelliJ IDEA Rulezzz with code completion</title>
		<link>http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/</link>
		<comments>http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 09:00:49 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[easteregg]]></category>
		<category><![CDATA[intellij]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=29</guid>
		<description><![CDATA[Today I got an interesting ctrl+space code completion in IDEA 8.1. Easteregg anyone ? Update: Seems like this is part of IDEA since at least release 4.0.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F02%2F14%2Fintellij-idea-rulezzz-with-code-completion%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F02%2F14%2Fintellij-idea-rulezzz-with-code-completion%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Today I got an interesting ctrl+space code completion in IDEA 8.1. Easteregg anyone ? <img src='http://maxheapsize.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="alignnone" title="IntelliJ IDEA Rulezzz" src="http://maxheapsize.com/static/IntellijRulez.gif" alt="" width="649" height="275" /></p>
<p>Update: Seems like this is part of IDEA since at least release 4.0.</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=IntelliJ+IDEA+Rulezzz+with+code+completion&amp;url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;bm_description=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/&amp;title=IntelliJ+IDEA+Rulezzz+with+code+completion" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+IntelliJ+IDEA+Rulezzz+with+code+completion+@+http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/02/14/intellij-idea-rulezzz-with-code-completion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

