<?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>Shaun Abram &#187; Testing</title>
	<atom:link href="http://www.shaunabram.com/tag/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shaunabram.com</link>
	<description>Java and Technology weblog</description>
	<lastBuildDate>Tue, 27 Jul 2010 23:14:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Selenium talk at SF JUG</title>
		<link>http://www.shaunabram.com/sfjug-selenium/</link>
		<comments>http://www.shaunabram.com/sfjug-selenium/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 07:26:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[JUG]]></category>
		<category><![CDATA[q]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[sfjug]]></category>
		<category><![CDATA[unittesting]]></category>

		<guid isPermaLink="false">http://www.shaunabram.com/?p=749</guid>
		<description><![CDATA[I attended another great San Francisco JUG meeting tonight, this time on How to use Selenium with Maven/Ant to automate testing of web apps. The talk was given by Chris Bedford, from Build Lackey Labs &#8211; &#8220;Automating the Monkey Work Out and the Quality In!&#8221;. Overall, I thought this was a great talk by Chris. [...]]]></description>
			<content:encoded><![CDATA[<p>I attended another great <a href="http://www.sfjava.org/calendar/10674274/">San Francisco JUG</a> meeting tonight, this time on <a href="http://www.sfjava.org/calendar/11982857/">How to use Selenium with Maven/Ant to automate testing of web apps</a>.</p>
<p>The talk was given by Chris Bedford, from <a href="http://buildlackey.com/">Build Lackey Labs</a> &#8211; &#8220;Automating the Monkey Work Out and the Quality In!&#8221;. Overall, I thought this was a great talk by Chris. He clearly has a huge amount of experience creating automated tests and integrating them with build tools and he gave a well structured, interesting, well delivered presentation. I have posted a copy of <a href="http://www.shaunabram.com/attachments/testing-java-web-apps-with-selenium5.ppt">Chris&#8217;s slides</a> and I think the video will be posted on the SF JUG site at some point, but I have also posted my notes from the presentation below&#8230;<br />
<span id="more-749"></span></p>
<h3>Selenium Overview</h3>
<p>Chris started off with an overview of <a href="http://seleniumhq.org/">Selenium</a> &#8211; a tool for automating tests for web based applications. He then introduced us to the Selenium IDE &#8211; a Firefox add-on that allows you to set up tests by recording clicks on a web page, or by manually entering commands. The tests can then be played back as part of your automated test suite.</p>
<h3>Creating Selenium Tests</h3>
<p>Chris showed us the process by both executing an existing test he had already setup, and by walking us through the creation of a new test, which loaded a page, waited for text to be present, clicked on a link, and confirmed that text was present. The test was a html file, but he showed how to export it as <a href="http://testng.org/doc/index.html">TestNG</a> and <a href="http://www.junit.org/">JUnit</a> tests  (although both exports resulted in kind of ugly java code!)</p>
<h3>Possible hiccups with Selenium</h3>
<p>One of the things I thought Chris did well was, in addition to pointing out all the many great things about Selenium, he also pointed out some of the slight issues with Selenium that he has encountered during his time using it, such as</p>
<ul>
<li>Difficulties getting the initial Open page to work</li>
<li>Issues with where the test files get saved</li>
<li>Making sure you have the tests run slow to start with (to avoid timing/loading issues)</li>
<li>The Selenium IDE may be difficult to get working with IE (Firefox is fine)</li>
</ul>
<h3>Selenium Components</h3>
<p>The main Selenium section then finished up with a quick over of the various Selenium Components:</p>
<ul>
<li>Selenium IDE</li>
<li>Selenese Commands</li>
<li>Selenium RC (Remote Control)</li>
</ul>
<p>Chris also had a section on the &#8216;<a href="http://en.wikipedia.org/wiki/Same_origin_policy">same origin</a>&#8216; JavaScript  policy that Selenium manages to circumvent by using the Selenium RC Server. He managed to explain the issue in simple terms.</p>
<h3>Other functional test alternatives</h3>
<p>Chris discussed other functional test alternatives by comparing <a href="http://webtest.canoo.com/webtest/manual/WebTestHome.html">Canoo</a> to Selenium (Canoo is also an automated web app testing framework).</p>
<p>Chris also mentionted <a href="http://code.google.com/p/umangite/">Umangite</a>, Chris Richardson&#8217;s open source testing framework that makes Selenium tests easier to write. I have used this before, and agree it is worth checking out&#8230;</p>
<h3>Using Selenium with Build Tools</h3>
<p>He then discussed using Maven with Selenium, including using <a href="http://cargo.codehaus.org/">Cargo</a> (e.g. using the <a href="http://cargo.codehaus.org/Maven2+plugin">cargo maven2 plugin</a>). Cargo is a set of APIs that assists in</p>
<ul>
<li>installing web containers, such as Tomcat, JBoss</li>
<li>booting and shutting them down</li>
<li>deploying web apps (.wars, .ears)</li>
</ul>
<p>Chris finished the Selenium &#038; build tools section with a quick run through of using Selenium with <a href="http://ant.apache.org/">Ant</a>.</p>
<h4>Continuous Integration</h4>
<p>The final section of the presentation was a talk on Continuous Integration (CI). Chris described CI as: </p>
<ul>
<li>A dedicated box (see my follow up question below!) that runs regular full builds (including tests) of your software</li>
<li>Build triggers when any developer checks into SCM</li>
<li>Team is notified of any issues</li>
</ul>
<p>And talked about how Selenium can be used with <a href="http://hudson-ci.org/">Hudson</a> &#8211; a very cool CI tool from Sun. This leads well into <a href="http://www.sfjava.org/calendar/12296161/">next month&#8217;s SF JUG talk</a>!</p>
<h3>Q&#038;A</h3>
<p>Q: Do you have any info on WebDriver merging with Selenium?<br />
A: No, but sounds interesting!</p>
<p>Q: How closely do test writers work with marketing people?<br />
A: Chris suggested checking out the <a href="http://www.easyb.org/">easyb</a> framework, a behavior driven development framework that allows you to write conditions in a very abstract level, using a DSL that marketers can use and understand. He also suggested looking at the <a href="http://www.fitnesse.org/">fitnesse</a> framework.</p>
<p>Q: I asked Chris via email after the talk what he meant by needing &#8216;dedicated&#8217; box/server for Continuous Integration.<br />
A: He clarified that by &#8216;dedicated&#8217;, he just meant that the build box  should not be a box that you are doing development on, and that there isn&#8217;t anything wrong with having a mix of services on one machine. e.g. having a qa box that has the CI server and maybe hosts the bug tracking system as well&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaunabram.com/sfjug-selenium/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running Hibernate unit tests with Maven</title>
		<link>http://www.shaunabram.com/hibernate-maven-unit-tests/</link>
		<comments>http://www.shaunabram.com/hibernate-maven-unit-tests/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 08:37:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.shaunabram.com/?p=42</guid>
		<description><![CDATA[I recently converted a project I have been working on to use Maven. After setting up all the dependencies in the pom, I got everything compiling fine but ran into problems getting the unit tests to pick up the hibernate config (hibernate.cfg.xml) and hibernate mapping (*.hbm.xml) files. With hindsight, it is straightforward, but it took [...]]]></description>
			<content:encoded><![CDATA[<p>I recently converted a project I have been working on to use <a href="http://maven.apache.org/">Maven</a>. After setting up all the dependencies in the pom, I got everything compiling fine but ran into problems getting the unit tests to pick up the hibernate config (hibernate.cfg.xml) and hibernate mapping (*.hbm.xml) files. With hindsight, it is straightforward, but it took me a while to figure it out so I thought I&#8217;d post the solution here.</p>
<p>Initially, I had my hibernate.cfg.xml file in the following directory</p>
<p style="padding-left: 30px;">my-app/src/main/java</p>
<p>And when I first tried to run my hibernate unit tests (mvn test), I got this error:</p>
<p style="padding-left: 30px;">SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found</p>
<p>Some checking of the maven docs and some forums revealed the following possible solutions:<br />
1) Copy the hibernate.cfg.xml file to</p>
<p style="padding-left: 30px;">my-app/target/classes</p>
<p>This works, however I think it is a hack as the target folder is generated rather than being somewhere you should actually manually create files.<br />
2) The next solution I found suggested moving the hibernate.cfg.xml to</p>
<p style="padding-left: 30px;">my-app/src/main/resources</p>
<p>This works well as the contents of this folder are copied to the base level of the my-app/target/classes folder so it is basically a &#8216;more correct&#8217; solution than the first.<br />
3) The next and I think best solution was to create a new, duplicate hibernate.cfg.xml inside</p>
<p style="padding-left: 30px;">my-app/src/test/resources</p>
<p>This allows a different hibernate.cfg.xml file to be used for testing and, for example, facilitates connecting to a different database (such as <a href="http://hsqldb.org/">hsqldb</a>) for testing while continuing to use your regular database (such as <a href="http://www.mysql.com/">MySQL</a>) for the app itself.</p>
<p>A couple of points to note:</p>
<p>1) The hibernate mapping files (i.e. the *.hbm.xml files) should also be in the resources folder (in whatever directory structure you choose) to ensure that these too are accessible by the unit tests.</p>
<p>2) I am not (yet) using Spring with the hibernate components, which would likely have changed the above setup.</p>
<p>Refs/links</p>
<p style="padding-left: 30px;"><a href="http://maven.apache.org/guides/getting-started/index.html#How_do_I_add_resources_to_my_JAR">http://maven.apache.org/guides/getting-started/index.html#How_do_I_add_resources_to_my_JAR</a></p>
<p style="padding-left: 30px;"><a href="http://www.mail-archive.com/users@maven.apache.org/msg54720.html">http://www.mail-archive.com/users@maven.apache.org/msg54720.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaunabram.com/hibernate-maven-unit-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Silicon Valley Code Camp Notes</title>
		<link>http://www.shaunabram.com/attending-silicon-valley-code-camp/</link>
		<comments>http://www.shaunabram.com/attending-silicon-valley-code-camp/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 19:58:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://www.shaunabram.com/?p=22</guid>
		<description><![CDATA[I am at the Silicon Valley Code Camp at the moment. I will try to post some notes on the various talks I attend below&#8230; Day 1: Session 1: JavaScript Session 2: Easing into Agile Session 3: Building Better Tests in Java Session 4: What is Python? Day 2: Session 1: Basics of Threading Session [...]]]></description>
			<content:encoded><![CDATA[<p>I am at the <a href="http://www.siliconvalley-codecamp.com/">Silicon Valley Code Camp</a> at the moment.</p>
<p>I will try to post some notes on the various talks I attend below&#8230;</p>
<p>Day 1:</p>
<ul>
<li>Session 1: <a href="http://shaunabram.com/code-camp-javascript">JavaScript</a></li>
<li>Session 2: <a href="http://www.shaunabram.com/code-camp-easing-into-agile">Easing into Agile</a></li>
<li>Session 3: <a href="http://www.shaunabram.com/code-camp-building-better-tests-in-java">Building Better Tests in Java</a></li>
<li>Session 4: <a href="http://www.shaunabram.com/code-camp-what-is-python">What is Python?</a></li>
</ul>
<p>Day 2:</p>
<ul>
<li>Session 1: <a href="http://www.shaunabram.com/?page_id=24">Basics of Threading </a></li>
<li>Session 2: Introduction to Grails</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.shaunabram.com/attending-silicon-valley-code-camp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FindBugs</title>
		<link>http://www.shaunabram.com/findbugs/</link>
		<comments>http://www.shaunabram.com/findbugs/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 19:46:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.shaunabram.com/?p=7</guid>
		<description><![CDATA[Came across this really neat tool that can actually find bugs in your code. It uses &#8216;static analysis&#8217; to find instances of bug patterns &#8211; code instances that are likely to be errors. I was pretty skeptical until I ran it on some code and was impressed by the results. It found loads of possible [...]]]></description>
			<content:encoded><![CDATA[<p>Came across this really neat tool that can actually find bugs in your code. It uses &#8216;static analysis&#8217; to find instances of bug patterns &#8211; code instances that are likely to be errors. I was pretty skeptical until I ran it on some code and was impressed by the results. It found loads of possible problems. I&#8217;ll definitely be using it again.</p>
<p>Check it out at <a href="http://findbugs.sourceforge.net/">http://findbugs.sourceforge.net/</a></p>
<p>Update: Found recommendations for another tool called JLint, which is supposed to be particularly good for spotting potential deadlocks so perhaps worth using when testing threaded code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaunabram.com/findbugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
