<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>non-random ramble</title>
	
	<link>http://jimbarritt.com/non-random</link>
	<description>adventures in code</description>
	<lastBuildDate>Fri, 23 Jul 2010 13:42:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/jimbarritt" /><feedburner:info uri="jimbarritt" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Hibernate Proxy InstantiationException</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/ZjXO2Hgw9ic/</link>
		<comments>http://jimbarritt.com/non-random/2010/07/23/hibernate-proxy-instantiationexception/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 13:39:31 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[hibernate]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=602</guid>
		<description><![CDATA[Changing entities to be lazy loaded led me to the following problem: Thanks to Kristian I jumped straight to the problem. From the Hibernate docs: Cat has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using Constructor.newInstance(). It is recommended that you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/facade.jpg" rel="lightbox[602]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/facade.jpg" alt="" title="facade" width="500" height="375" class="aligncenter size-full wp-image-603" /></a></p>
<p>Changing entities to be lazy loaded led me to the following problem:</p>
<pre name='code' class='java:nogutter:nocontrols'>
@OneToMany(fetch = FetchType.LAZY)
</pre>
<pre name='code' class='java:nogutter:nocontrols'>
Caused by: org.hibernate.HibernateException: Javassist Enhancement failed: Thing
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:142)
	at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:72)
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:402)
	at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3483)
&#8230;.
Caused by: java.lang.InstantiationException: Thing_$$_javassist_38
	at java.lang.Class.newInstance0(Class.java:340)
	at java.lang.Class.newInstance(Class.java:308)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:139)
</pre>
<p>Thanks to <a href="http://kristian-domagala.blogspot.com/2008/10/proxy-instantiation-problem-from.html">Kristian</a> I jumped straight to the problem. From the <a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/persistent-classes.html#persistent-classes-pojo-constructor">Hibernate docs</a>:</p>
<blockquote><p>Cat has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using Constructor.newInstance(). It is recommended that you have a default constructor with <strong>at least</strong> package visibility for runtime proxy generation in Hibernate.</p></blockquote>
<p>This should probably read &#8220;It is essential&#8230;.&#8221;</p>
<p>Anyway now everything is real lazy so happy days.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/07/23/hibernate-proxy-instantiationexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/07/23/hibernate-proxy-instantiationexception/</feedburner:origLink></item>
		<item>
		<title>Add a proxy to subversion configuration</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/8rk-HkjlFmw/</link>
		<comments>http://jimbarritt.com/non-random/2010/07/23/add-a-proxy-to-subversion-configuration/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 12:50:33 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=597</guid>
		<description><![CDATA[If you need to access subversion from outside a proxy, you need to edit ~/.subversion/servers and add this: Since Intellij 9.0.3 you now also need to set this information in the svn settings.]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/subversion.jpg" rel="lightbox[597]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/subversion.jpg" alt="" title="subversion" width="500" /></a></p>
<p>If you need to access subversion from outside a proxy, you need to edit <code>~/.subversion/servers and add this:</p>
<pre name='code' class='java:nogutter:nocontrols'>
[groups]
mySubversionGroup = *.some.domain
[mySubversionGroup]
http-proxy-host = my.proxy.server
http-proxy-port = 8080
</pre>
<p>Since Intellij 9.0.3 you now also need to set this information in the svn settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/07/23/add-a-proxy-to-subversion-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/07/23/add-a-proxy-to-subversion-configuration/</feedburner:origLink></item>
		<item>
		<title>Log4J settings for working with Hibernate</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/0h43mBi1JKI/</link>
		<comments>http://jimbarritt.com/non-random/2010/07/23/log4j-settings-for-working-with-hibernate/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 12:28:37 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[hibernate]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=588</guid>
		<description />
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/hibernate.png" rel="lightbox[588]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/hibernate.png" alt="" title="hibernate" width="600" /></a><br />
<pre name='code' class='xml:nogutter:nocontrols'>
	<!--
		These  hibernate values are quite tuned to provide a clear output of SQL and what parameters are bound
		org.hibernate should be on WARN so you don't see loads or random stuff
		org.hibernate.jdbc.ConnectionManager on DEBUG to show open and closing of connections
		org.hibernate.SQL on DEBUG to see the actual SQL statements (also need to turn it on in HibernateSessionFactory (show_sql=true)
		org.hibernate.type on TRACE	so that you can see which parameters are bound to the statements
		Any custom type mappers should also be put on trace so that you see them binding (of course you need to add the logging statements yourself)
		Please be careful when checking in this file to not check in local changes for specific debugging purposes
	-->
	<logger name="org.hibernate">
  		<level value="warn"/>
	</logger>
	<logger name="org.hibernate.jdbc.ConnectionManager">
  		<level value="debug"/>
	</logger>
	<logger name="org.hibernate.SQL">
  		<level value="debug"/>
	</logger>
	<category name="org.hibernate.type">
<priority value="trace"/>
	</category>
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/07/23/log4j-settings-for-working-with-hibernate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/07/23/log4j-settings-for-working-with-hibernate/</feedburner:origLink></item>
		<item>
		<title>Installing JRuby with Intellij (OS X)</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/EinmfMn7i1g/</link>
		<comments>http://jimbarritt.com/non-random/2010/07/03/installing-jruby-with-intellij-os-x/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 09:14:25 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=573</guid>
		<description><![CDATA[GET it from http://jruby.org/ There is a download page, download and exract the tar file somehwere. I put it in /System/Library/Frameworks/JRuby.framework/jruby-1.5.1 I then created a symbolic link to jruby_current And then simply add it to my ~/.bash_profile Now you can add the JRuby SDK to your Java Module in Intellij: Now you can have ruby [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby.png" rel="lightbox[573]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby.png" alt="" title="jruby" width="235" height="232" class="aligncenter size-full wp-image-574" /></a></p>
<p>GET it from <a href="http://jruby.org/#2">http://jruby.org/</a></p>
<p>There is a download page, download and exract the tar file somehwere.</p>
<p>I put it in <code>/System/Library/Frameworks/JRuby.framework/jruby-1.5.1</code></p>
<p>I then created a symbolic link to <code>jruby_current</code><br />
<pre name='code' class='java:nogutter:nocontrols'>
ln -s jruby-1.5.1/ jruby_current
</pre></p>
<p>And then simply add it to my <code>~/.bash_profile</code></p>
<pre name='code' class='java:nogutter:nocontrols'>
$vi ~/.bash_profile
export PATH=/System/Library/Frameworks/JRuby.framework/jruby_current/bin:$PATH
#Reload the profile&#8230;
$. ~/.bash_profile
#Try out jruby&#8230;
$jruby -v
jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
</pre>
<p>Now you can add the JRuby SDK to your Java Module in Intellij:</p>
<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby_sdk.png" rel="lightbox[573]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/jruby_sdk.png" alt="" title="jruby_sdk" width="600" /></a></p>
<p>Now you can have ruby and Java in the same project. Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/07/03/installing-jruby-with-intellij-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/07/03/installing-jruby-with-intellij-os-x/</feedburner:origLink></item>
		<item>
		<title>Resources not available on classpath in Intellij</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/_0Avwcrp3h4/</link>
		<comments>http://jimbarritt.com/non-random/2010/07/02/intellij-compile-resources/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 15:15:13 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[intellij]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=569</guid>
		<description><![CDATA[Today I spent a while puzzling over why my StringTemplates weren&#8217;t available on the classpath in Intellij. I forgot that you have to specifically identify file types to copy into the classes folder, you do it in the project settings. Search for &#8220;resource&#8221; and look in the compiler settings.]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/intellij-resources.png" rel="lightbox[569]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/07/intellij-resources.png" alt="" title="intellij-resources" width="600" /></a></p>
<p>Today I spent a while puzzling over why my StringTemplates weren&#8217;t available on the classpath in Intellij.</p>
<p>I forgot that you have to specifically identify file types to copy into the classes folder, you do it in the project settings. Search for &#8220;resource&#8221; and look in the compiler settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/07/02/intellij-compile-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/07/02/intellij-compile-resources/</feedburner:origLink></item>
		<item>
		<title>Intellij svn history keeps “partial” commits</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/wkG5LAQytqk/</link>
		<comments>http://jimbarritt.com/non-random/2010/06/08/intellij-svn-history-keeps-partial-commits/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 10:42:25 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[ides]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=536</guid>
		<description><![CDATA[I found that after an update, I was still seeing some entries lying around. Thanks to this issue on the intellij community forum I was able to simply remove the contents svn cache and it works.]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/06/svn_incoming.gif" rel="lightbox[536]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/06/svn_incoming.gif" alt="" title="svn_incoming" width="573" height="72" class="aligncenter size-full wp-image-537" /></a></p>
<p>I found that after an update, I was still seeing some entries lying around. Thanks to this <a href="http://www.jetbrains.net/devnet/message/5215171#5215171">issue</a> on the intellij community forum I was able to simply remove the contents svn cache and it works.</p>
<pre name='code' class='java:nogutter:nocontrols'>
~/Library/Caches/IntelliJIdea90/vcsCache
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/06/08/intellij-svn-history-keeps-partial-commits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/06/08/intellij-svn-history-keeps-partial-commits/</feedburner:origLink></item>
		<item>
		<title>Google reader “shared items” plugin for wordpress</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/f9vCImp5Lb4/</link>
		<comments>http://jimbarritt.com/non-random/2010/06/06/google-reader-shared-items-plugin-for-wordpress/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 16:08:38 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[meta]]></category>
		<category><![CDATA[thoughtblog]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=517</guid>
		<description><![CDATA[I find google reader a useful way to aggregate information from many blogs. Particularly convenient is to be able to read these on my iPhone and then mark them as shared. That way I can build up a list of information I am interested in. This is then conveniently exposed as an RSS feed by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/06/googlereader1.png" rel="lightbox[517]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/06/googlereader1.png" alt="" title="googlereader" width="500" class="aligncenter size-full " /></a></p>
<p>I find google reader a useful way to aggregate information from many blogs. Particularly convenient is to be able to read these on my iPhone and then mark them as shared. That way I can build up a list of information I am interested in.</p>
<p>This is then conveniently exposed as an RSS feed by google. You can see my shared items at <a href="http://www.google.co.uk/reader/shared/jim.barritt">http://www.google.co.uk/reader/shared/jim.barritt</a> for example.</p>
<p>I used to have a sidebar on this site which had a snippet directly from google reader, but it was determined to have its own style. I wanted a wordpress plugin that would do it for me and found <a href="http://wordpress.org/extend/plugins/recommended-reading-google-reader-shared/">&#8220;Recommended Reading Google Reader&#8221; by C. Murray Consulting</a></p>
<p>Its the nice &#8220;READING&#8221; section on my sidebar. Thanks guys! You just saved me from writing my own!</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/06/06/google-reader-shared-items-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/06/06/google-reader-shared-items-plugin-for-wordpress/</feedburner:origLink></item>
		<item>
		<title>Agile North Keynote: Guiding Teams On Mt Agile</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/OaNWD_qT54c/</link>
		<comments>http://jimbarritt.com/non-random/2010/06/05/agile-north-keynote-guiding-teams-on-mt-agile/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 14:48:41 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=476</guid>
		<description><![CDATA[I recently (Friday 14th May 2010) gave the closing Keynote at Agile North, a one day conference held up in Preston. The talk was loosely based around a metaphor of mountain climbing and playing with the analogy of being a consultant on an agile project being like a mountain guide. The idea is that someone [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/05/agilenorth.gif" rel="lightbox[476]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/05/agilenorth.gif" alt="" title="agilenorth" width="228" height="117" class="aligncenter size-full wp-image-477" /></a></p>
<p>I recently (Friday 14th May 2010) gave the closing Keynote at <a href="http://www.agilenorth.org/">Agile North</a>, a one day conference held up in Preston.</p>
<p>The talk was loosely based around a metaphor of mountain climbing and playing with the analogy of being a consultant on an agile project being like a mountain guide. The idea is that someone who is a mountain guide has many years of experience climbing and coaching people on the mountain. </p>
<p>The talk I think was well recieved and generated quite a bit of interest from people, I think because we were talking about real experiences on our current project.</p>
<p>I co-presented with Mark Crossfield who is the Tech Lead on the team I am Coaching at our current client, AutoTrader, and I felt it was an interesting balance between my &#8220;Guide&#8221; view and his experience leading a team into an Agile project for the first time.</p>
<p>We covered five short stories about our experiences on the project.</p>
<ul>
<li>Safety First &#8211; going beyond CI to pipelines</li>
<li>The Walking Skeleton as a metaphor for iterative feature delivery</li>
<li>Evolution of the codebase</li>
<li>Collective Design</li>
<li>Telling the story of the code</li>
</ul>
<p>The Slide deck is up on <a href="http://www.slideshare.net/jimbarritt/jim-barritt-mark-crossfield-closing-keynote">slideshare</a> and the talk can be viewed here.</p>
<p>At some point they promise to put up the video of the event at which point I will update this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/06/05/agile-north-keynote-guiding-teams-on-mt-agile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/06/05/agile-north-keynote-guiding-teams-on-mt-agile/</feedburner:origLink></item>
		<item>
		<title>Make Fireworks IntelliJ Plugin Ignore Integration Tests</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/JBtqHfQxsPk/</link>
		<comments>http://jimbarritt.com/non-random/2010/05/28/make-fireworks-intellij-plugin-ignore-integration-tests/#comments</comments>
		<pubDate>Fri, 28 May 2010 10:37:00 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=497</guid>
		<description><![CDATA[http://www.wafermaneuver.com/nick/img/photo/fireworks2.jpg The Fireworks Plugin for IntelliJ allows you to automatically run all your unit tests when you make a change to the code. Its a well behaved plugin, it allows you to configure wether or not to do this so you can just turn it on or off. Whilst using it I made a detour [...]]]></description>
			<content:encoded><![CDATA[<p><img width="400" src="http://www.wafermaneuver.com/nick/img/photo/fireworks2.jpg" /><br />
<code>http://www.wafermaneuver.com/nick/img/photo/fireworks2.jpg</code></p>
<p>The <a href="http://plugins.intellij.net/plugin/?id=1106">Fireworks</a> Plugin for IntelliJ allows you to automatically run all your unit tests when you make a change to the code. </p>
<p>Its a well behaved plugin, it allows you to configure wether or not to do this so you can just turn it on or off. </p>
<p>Whilst using it I made a detour to <a href="http://blog.gigoo.org/2010/05/26/how-can-pomodore-help-you-shave-a-yak/">Shave a couple of Yaks</a>. So thought I&#8217;d document it here.</p>
<p>I found it was also running some integration tests which relied on the file system and so didn&#8217;t work because there doesn&#8217;t appear to be a way to specify the working directory (you can specify JVM args so I could use that instead. I submitted an <a href="http://code.google.com/p/dontmakemetest/issues/detail?id=4">issue</a>. </p>
<p>In the mean time, actually I thought I would rather not run my integration tests. Fortunately Fireworks allows a regex pattern to decide which files are tests.</p>
<p>After some hunting, I found the <a href="http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word">following post</a> on stack overflow which gave me the clues i needed to include <code>Test</code> but <strong>not</strong> <code>IntegrationTest</code>.</p>
<p>The solution takes advantage of <a href="http://www.regular-expressions.info/lookaround.html">&#8220;lookaround&#8221;</a> features of regex. The syntax in question is:</p>
<pre name='code' class='java:nogutter:nocontrols'>
(?!Integration)
</pre>
<p>The <code>(?!  regex )</code> syntax means negative look ahead. You can put any regex in there. In our case, just &#8220;Integration&#8221;. This says, something not followed by &#8220;Integration&#8221;.</p>
<p>The code on stack overflow had some unnescessary syntax at the beginning (^) and I changed the ordering around a bit to make it read more logically.</p>
<pre name='code' class='java:nogutter:nocontrols'>
(.(?!Integration))*Test
</pre>
<p>The first &#8220;<code>^</code>&#8221; was unnescessary, and putting the &#8220;<code>.</code>&#8221; first made it read better i think. The parentheses are to provide some structure (regex groups) more than any functional reason. </p>
<p>So in words, the new expression reads &#8220;match any repeating character (<code>.*</code>) not followed by &#8220;Integration&#8221; <code>(?!Integration)</code>), then only match if &#8220;Test&#8221; is on the end.</p>
<p>Here is a test case for it (which along with some other regex stuff can be found on <a href="http://github.com/jimbarritt/spikes/tree/master/regex/src/test/unit/java/com/jimbarritt/spikes/regex/">Github</a> :</p>
<pre name='code' class='java:nogutter:nocontrols'>
    @Test
    public void matchesUnitTestsButNotIntegrationTests() {
        String expression = &#8220;(.(?!Integration))*Test&#8221;;
        Pattern pattern = Pattern.compile(expression);
        assertThat(pattern.matcher(&#8220;SomeUnitTest&#8221;).matches(), is(true));
        assertThat(pattern.matcher(&#8220;SomeIntegrationTest&#8221;).matches(), is(false));
        assertThat(pattern.matcher(&#8220;SomeNonTestClass&#8221;).matches(), is(false));
    }
</pre>
<p>I found it hard to get this to work on the command line with grep. But I&#8217;ve got too much YAK HAIR on my floor now!</p>
<p>Now the Yaks are shaved I can go back to putting a system property in to allow my integration test to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/05/28/make-fireworks-intellij-plugin-ignore-integration-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/05/28/make-fireworks-intellij-plugin-ignore-integration-tests/</feedburner:origLink></item>
		<item>
		<title>Link from log console output to a line of code in IntelliJ</title>
		<link>http://feedproxy.google.com/~r/jimbarritt/~3/sZ6tsvKSNfU/</link>
		<comments>http://jimbarritt.com/non-random/2010/05/16/link-from-log-console-output-to-a-line-of-code-in-intellij/#comments</comments>
		<pubDate>Sun, 16 May 2010 13:47:55 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[ides]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=480</guid>
		<description><![CDATA[Whilst playing around with some code analysis I thought it would be useful to be able to output a hyperlink back to a line of code in the IDE console. As it happens, you can &#8220;Trick&#8221; IntelliJ to do this with the following log statement: The pattern it seems to match is something like at [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimbarritt.com/non-random/wp-content/uploads/2010/05/clickfromconsole.gif" rel="lightbox[480]"><img src="http://jimbarritt.com/non-random/wp-content/uploads/2010/05/clickfromconsole.gif" alt="" title="clickfromconsole" width="800"  class="aligncenter size-full wp-image-481" /></a></p>
<p>Whilst playing around with some code analysis I thought it would be useful to be able to output a hyperlink back to a line of code in the IDE console. As it happens, you can &#8220;Trick&#8221; IntelliJ to do this with the following log statement:</p>
<pre name='code' class='java:nogutter:nocontrols'>
    @Test
    public void canClickOnAFileInTheConsoleAndGoToTheLineOfCode() {
        log.info(String.format(&#8220;Check it at %s. (%s.java:%d)&#8221;,
            getClass().getName(), getClass().getSimpleName(), 15));
    }
</pre>
<p>The pattern it seems to match is something like <code>at {classFullName}.{identifier}({classSimpleName}.java)</code></p>
<p><code>classFullName</code> has to be a valid class name.<br />
<code>identifier</code> is usually used for the method name, but it can be anything. The full stop is nescessary. So in the example above, I put a space in there and so it reads like a sentance.</p>
<p>Anyone know a another way to do this?</p>
<p>UPDATE: </p>
<p>Actually it seems that you can get something similar if you output a full path name, e.g.:</p>
<pre name='code' class='java:nogutter:nocontrols'>
    File f = new File(&#8220;./src/test/resource/testfiles/level_01/level_01_01/file_01_01_A.txt&#8221;);
    log.info(f.getAbsolutePath() + &#8220;:&#8221; + 34);
</pre>
<p>This will create a link in the output window to the line of the file. Nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/05/16/link-from-log-console-output-to-a-line-of-code-in-intellij/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://jimbarritt.com/non-random/2010/05/16/link-from-log-console-output-to-a-line-of-code-in-intellij/</feedburner:origLink></item>
	</channel>
</rss>
