<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6376362364452929889</id><updated>2012-01-17T08:22:49.751-08:00</updated><title type='text'>The Green Bar</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-792722263412751740</id><published>2012-01-17T08:22:00.000-08:00</published><updated>2012-01-17T08:22:35.774-08:00</updated><title type='text'>A new role at Google</title><content type='html'>For the last four years, I've been working at Google, supporting the Google Books project as a Software Engineer in Test. &amp;nbsp;There's at least a blog post and a half to be written about how that role fits within Google's larger development practices, and the opportunities it provided to see what automated testing could do with Google-scale hardware and software behind it. &amp;nbsp;I enjoyed it, and loved the team; I've spent more time with the team of SET's behind Google Books than with any previous team in my career.&lt;br /&gt;&lt;br /&gt;This project also served as a capstone&amp;nbsp;of 10 years in which my primary professional focus has been building software that helps software builders build software: frameworks, code analysis, testing. &lt;br /&gt;&lt;br /&gt;Starting today, I'm excited to be shifting my focus back toward end users, as I join the team behind the Books app for Android, working on feature development. &amp;nbsp;This also marks the first time in 3 years that I go back to being a full-time user of JUnit, which I'm quite happy about.&lt;br /&gt;&lt;br /&gt;2012 should be exciting. &amp;nbsp;If there's something you've always wanted an eBook to do for you, let me know!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-792722263412751740?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/792722263412751740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2012/01/new-role-at-google.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/792722263412751740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/792722263412751740'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2012/01/new-role-at-google.html' title='A new role at Google'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-2798831681308813251</id><published>2011-09-29T12:55:00.000-07:00</published><updated>2011-09-29T12:55:12.520-07:00</updated><title type='text'>No new JUnit release announcements, period, here.</title><content type='html'>If by chance you've been following this blog in order to get announcements of new JUnit releases, whether beta or final, this is the last time they are likely to be posted here.  You can follow along at &lt;a href="http://junit.org"&gt;junit.org&lt;/a&gt;, or the &lt;a href="http://tech.groups.yahoo.com/group/junit/"&gt;junit@yahoogroups.com&lt;/a&gt; mailing list.I'll be keeping this blog for whatever comes to mind that is more exciting that JUnit releases, which are becoming more predictable and mundane.By the way, JUnit 4.10 is &lt;a href="http://tech.groups.yahoo.com/group/junit/message/23717"&gt;released&lt;/a&gt;.Share and Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-2798831681308813251?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/2798831681308813251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/09/no-new-junit-release-announcements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2798831681308813251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2798831681308813251'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/09/no-new-junit-release-announcements.html' title='No new JUnit release announcements, period, here.'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-2154256975093412566</id><published>2011-09-22T11:17:00.000-07:00</published><updated>2011-09-22T11:17:22.450-07:00</updated><title type='text'>No new beta-release announcements here</title><content type='html'>Hi, all.In order to reduce the noise until there's time to raise the signal here, I'm going to start only announcing JUnit beta releases on the main user's mailing list:http://tech.groups.yahoo.com/group/junit/If you are a devoted beta-tester, and that's a problem, let me know.  Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-2154256975093412566?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/2154256975093412566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/09/no-new-beta-release-announcements-here.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2154256975093412566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2154256975093412566'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/09/no-new-beta-release-announcements-here.html' title='No new beta-release announcements here'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-92663172190457415</id><published>2011-08-23T08:39:00.000-07:00</published><updated>2011-08-23T08:39:30.728-07:00</updated><title type='text'>JUnit 4.9 released</title><content type='html'>Over a year in the making, we are happy to announce the release of JUnit 4.9.&lt;br /&gt;&lt;br /&gt;This release's theme is Test-class and suite level Rules. The release notes are copied in part below, and can be read in full &lt;a href="https://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.9.txt"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Go ahead and &lt;a href="https://github.com/KentBeck/junit/downloads"&gt;download&lt;/a&gt;, or merely let maven do the work for you (as we are now directly releasing to sonatype's maven repository on the same day we release the jars).&lt;br /&gt;&lt;br /&gt;Following this release, work on JUnit and related code will continue on three fronts:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Bug fixes against existing functionality will be committed to the &lt;a href="https://github.com/KentBeck/junit/tree/4.9.1"&gt;4.9.1 branch&lt;/a&gt;.&lt;br /&gt;&lt;li&gt;New &lt;i&gt;core&lt;/i&gt; features will be committed on the &lt;a href="https://github.com/KentBeck/junit/tree/4.10"&gt;4.10 branch&lt;/a&gt;.&lt;br /&gt;&lt;li&gt;We have created a new &lt;a href="https://github.com/junit-team/junit.contrib"&gt;junit.contrib&lt;/a&gt; project to be a home to new &lt;i&gt;experimental&lt;/i&gt; features, features that use additional dependencies, and features that are outside of JUnit's core mission.  As a first example, Thomas Mueller has created &lt;a href="https://github.com/junit-team/junit.contrib/blob/master/assertthrows/README.txt"&gt;assertthrows&lt;/a&gt;, a package that uses all kinds of JDK trickery to allow direct assertions like this:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  List&amp;lt;String&amp;gt; emptyList = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;  assertThrows(emptyList).get(0);&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/ul&gt;We are excited that github allows extensive community participation and discussion in the ongoing development.  Please pitch in!  Remember, JUnit celebrates programmers testing their own software.  Let's build something.&lt;h2&gt;JUnit 4.9 release notes (highlights)&lt;/h2&gt;&lt;h3&gt;ClassRule&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;ClassRule&lt;/code&gt; annotation extends the idea of method-level Rules,adding static fields that can affect the operation of a whole class.  Anysubclass of &lt;code&gt;ParentRunner&lt;/code&gt;, including the standard &lt;code&gt;BlockJUnit4ClassRunner&lt;/code&gt; and &lt;code&gt;Suite&lt;/code&gt; classes, will support &lt;code&gt;ClassRule&lt;/code&gt;s.&lt;/p&gt;&lt;p&gt;For example, here is a test suite that connects to a server once beforeall the test classes run, and disconnects after they are finished:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;@RunWith(Suite.class)&lt;br /&gt;@SuiteClasses({A.class, B.class, C.class})&lt;br /&gt;public class UsesExternalResource {&lt;br /&gt;    public static Server myServer= new Server();&lt;br /&gt;&lt;br /&gt;    @ClassRule&lt;br /&gt;    public static ExternalResource resource= new ExternalResource() {&lt;br /&gt;        @Override&lt;br /&gt;        protected void before() throws Throwable {&lt;br /&gt;            myServer.connect();&lt;br /&gt;        };&lt;br /&gt;&lt;br /&gt;        @Override&lt;br /&gt;        protected void after() {&lt;br /&gt;            myServer.disconnect();&lt;br /&gt;        };&lt;br /&gt;    };&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;TestRule&lt;/h3&gt;&lt;p&gt;In JUnit 4.9, fields that can be annotated with either &lt;code&gt;@Rule&lt;/code&gt; or &lt;code&gt;@ClassRule&lt;/code&gt;should be of type &lt;code&gt;TestRule&lt;/code&gt;.  The old &lt;code&gt;MethodRule&lt;/code&gt; type, which only made sensefor method-level rules, will still work, but is deprecated.&lt;/p&gt;&lt;p&gt;Most built-in Rules have been moved to the new type already, in a way thatshould be transparent to most users.  &lt;code&gt;TestWatchman&lt;/code&gt; has been deprecated,and replaced by &lt;code&gt;TestWatcher&lt;/code&gt;, which has the same functionality, but implementsthe new type.&lt;/p&gt;&lt;h3&gt;Maven support&lt;/h3&gt;&lt;p&gt;Maven bundles have, in the past, been uploaded by kind volunteers.  Startingwith this release, the JUnit team is attempting to perform this task ourselves.&lt;/p&gt;&lt;h3&gt;LICENSE checked in&lt;/h3&gt;&lt;p&gt;The Common Public License that JUnit is released under is now includedin the source repository.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-92663172190457415?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/92663172190457415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/08/junit-49-released.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/92663172190457415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/92663172190457415'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/08/junit-49-released.html' title='JUnit 4.9 released'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-1480736882369044953</id><published>2011-08-12T08:29:00.000-07:00</published><updated>2011-08-12T13:57:44.290-07:00</updated><title type='text'>JUnit 4.9b4 (beta-)released</title><content type='html'>This release's theme is Test-class and suite level Rules.  This beta release contains a number of community-authored fixes for regression errors in documentation and test class validation.  Please read the &lt;a href="https://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.9.txt"&gt;release notes&lt;/a&gt;, &lt;a href="https://github.com/KentBeck/junit/downloads"&gt;download&lt;/a&gt;, and &lt;a href="http://tech.groups.yahoo.com/group/junit/"&gt;give feedback&lt;/a&gt; before the final release.&lt;br /&gt;&lt;br /&gt;[Edit: fixed release notes link]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-1480736882369044953?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/1480736882369044953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/08/junit-49b4-beta-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/1480736882369044953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/1480736882369044953'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/08/junit-49b4-beta-released.html' title='JUnit 4.9b4 (beta-)released'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-2742510406500749711</id><published>2011-07-06T14:04:00.000-07:00</published><updated>2011-07-06T14:06:51.534-07:00</updated><title type='text'>JUnit 4.9b3 (beta-)released</title><content type='html'>Five months and a dozen regression errors later, JUnit 4.9b3 is now ready for your testing pleasure.  This release's theme is Test-class and suite level Rules.  Please read the &lt;a href="https://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.9.txt"&gt;release notes&lt;/a&gt;, &lt;a href="https://github.com/KentBeck/junit/downloads"&gt;download&lt;/a&gt; or slurp from &lt;a href="https://oss.sonatype.org/index.html#nexus-search;gav~junit~junit~~~~kw,versionexpand"&gt;Maven&lt;/a&gt;, and &lt;a href="http://tech.groups.yahoo.com/group/junit/"&gt;give feedback&lt;/a&gt; before the final release.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-2742510406500749711?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/2742510406500749711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/07/junit-49b3-beta-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2742510406500749711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2742510406500749711'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/07/junit-49b3-beta-released.html' title='JUnit 4.9b3 (beta-)released'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-8477078158924444589</id><published>2011-03-22T11:24:00.000-07:00</published><updated>2011-03-22T11:24:56.054-07:00</updated><title type='text'>New project: junit.contrib</title><content type='html'>I'm planning to start a junit.contrib project.&lt;br /&gt;In this post, I'll first review the reasons for such a project, and&lt;br /&gt;secondly, I have a proposal for its structure, and I'd like feedback.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Background: reasons for junit.contrib&lt;/h2&gt;&lt;br /&gt;JUnit has always officially strived to be "the intersection of all&lt;br /&gt;useful Java testing frameworks".  Thus, the goals for code that gets&lt;br /&gt;into the junit repository include that it should:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Minimize dependencies on external libraries or particular JDK&lt;br /&gt;versions beyond a widely-used minimum.&lt;br /&gt;&lt;li&gt;Be very unlikely to change API moving forward.&lt;br /&gt;&lt;li&gt;Emphasize opportunities for extension over the richness of core features.&lt;br /&gt;&lt;li&gt;Have potential usefulness to all Java developers, regardless of&lt;br /&gt;their application domain.&lt;br /&gt;&lt;li&gt;Match in style to the current JUnit codebase.&lt;br /&gt;&lt;/ol&gt;Many people have made JUnit extensions that would be useful to ahealthy portion of Java developers, but do not meet all of the abovecriteria.  For example, the extension may target a particular IDE, ordata that is stored in a SQL database, or in XML, or it may beexperimental, and likely to change API, or it may require an externaldependency.  Also, as the popularity of non-Java languages on the JVMhas grown, some people have made extensions to JUnit that make iteasier to use JUnit's core functionality in ways idiomatic to thoseother languages.It has always been an option for developers of these extensions topublish them on their own repositories.  However, having a centralclearing-house as an option for extension developers has someadvantages, including discoverability, documentation, and dependencymanagement.The goal is for junit.contrib (just started &lt;a href="https://github.com/dsaff/junit.contrib"&gt;here&lt;/a&gt;) to be this clearing house.All Java classes in this project should be in packages prefixed withorg.junit.contrib.Now, the&lt;h2&gt;Proposal&lt;/h2&gt;The root structure of the project will contain:&lt;pre&gt;/&lt;br /&gt; README&lt;br /&gt; docs/&lt;br /&gt; java/&lt;br /&gt; scala/ [?]&lt;br /&gt; clojure/ [?]&lt;br /&gt;&lt;/pre&gt;Thus, a folder for overall documentation, and then a folderper-language.  I haven't thought about how non-java languageextensions should be organized.Under java, there should be a folder per "subproject" (names chosen,with apologies, by &lt;a href="http://en.wikipedia.org/wiki/Special:Random"&gt;my favorite naming tool&lt;/a&gt;):&lt;pre&gt;java/&lt;br /&gt; brewmasters/&lt;br /&gt; callisto/&lt;br /&gt; hekler/&lt;br /&gt; norway/&lt;br /&gt; ...&lt;br /&gt;&lt;/pre&gt;Each subproject should be organized as its own maven project:&lt;pre&gt;java/brewmasters/&lt;br /&gt; pom.xml&lt;br /&gt; src/main/java/org/junit/contrib/brewmasters/...&lt;br /&gt; src/test/java/org/junit/contrib/brewmasters/...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As potential users and contributors to such a repository, are there&lt;br /&gt;pitfalls in this organization that I should be aware of in advance?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-8477078158924444589?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/8477078158924444589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/03/new-project-junitcontrib.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/8477078158924444589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/8477078158924444589'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/03/new-project-junitcontrib.html' title='New project: junit.contrib'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-7823828034062912895</id><published>2011-01-27T12:29:00.001-08:00</published><updated>2011-01-27T12:31:13.031-08:00</updated><title type='text'>Very very simple testing in bash</title><content type='html'>&lt;p&gt;Imagine I'm starting today on a software system that I expect to spend&lt;br /&gt;at least a year on.  Being me, somewhere in the top five questions I&lt;br /&gt;ask myself is "How am I going to test this?"  Frequent automated testing&lt;br /&gt;gives me confidence that I won't find out next week that today I broke &lt;br /&gt;something that was working last week.  Writing tests is also an important way&lt;br /&gt;to organize my thinking about what I'm doing.  Once I've spent time specifying&lt;br /&gt;where I'm going, it's easier to get there quickly.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Since I'm going to be spending a year on this, it's worth my time to invest time&lt;br /&gt;in tools and frameworks that will make specifying and running these tests easy.&lt;br /&gt;I might even write some of my own.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;However, suppose that I'm working on a quick demo that I'm only going to spend&lt;br /&gt;a couple weeks on.  Or a data-processing script that I need to have finished&lt;br /&gt;tomorrow.  Or a sysadmin task that I expect will only take half an hour?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In these cases, I still want the benefits of testing, but I want to spend&lt;br /&gt;as little time as possible getting started.  Also, it's not always clear &lt;br /&gt;what technologies I'll be using: I may start in Java, and then find that&lt;br /&gt;a Python library will give me 80% of what I need.&lt;br /&gt;So, I've started to write start projects with test suites that consist of &lt;br /&gt;nothing more than a bash script with a standard footer I copy-and-paste&lt;br /&gt;from project to project.  The advantages:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Fast startup: I don't need to download anything or&lt;br /&gt;run through any "new project" wizards.  &lt;/li&gt;&lt;li&gt;If my project lasts longer than I expected, it's easy to remember how&lt;br /&gt;to run the tests: just run the script.&lt;/li&gt;&lt;li&gt;I can easily refactor to use a more heavyweight framework like JUnit by &lt;br /&gt;calling out to it from the script.&lt;/li&gt;&lt;li&gt;It isn't tied to any underlying implementation choice.&lt;/li&gt;&lt;li&gt;Perhaps best of all, it rewards a UNIX style of small stdin-to-stdout&lt;br /&gt;plug-and-play components.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;With no further ado, here's an example script, this one drawn from &lt;br /&gt;the JUnit build process:&lt;/p&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/797234.js?file=build_tests.sh"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-7823828034062912895?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/7823828034062912895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/01/title-very-very-simple-testing-in-bash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/7823828034062912895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/7823828034062912895'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/01/title-very-very-simple-testing-in-bash.html' title='Very very simple testing in bash'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-4611956474575071264</id><published>2011-01-21T16:51:00.000-08:00</published><updated>2011-01-28T07:44:33.901-08:00</updated><title type='text'>JUnit 4.9b2 (beta-)released</title><content type='html'>This release's theme is Test-class and suite level Rules.  Please read the &lt;a href="https://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.9.txt"&gt;release notes&lt;/a&gt;, &lt;a href="https://github.com/KentBeck/junit/downloads"&gt;download&lt;/a&gt;, and &lt;a href="http://tech.groups.yahoo.com/group/junit/"&gt;give feedback&lt;/a&gt; before the final release.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-4611956474575071264?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/4611956474575071264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/01/junit-49b2-beta-released.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/4611956474575071264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/4611956474575071264'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/01/junit-49b2-beta-released.html' title='JUnit 4.9b2 (beta-)released'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-7284912223090256354</id><published>2011-01-04T12:08:00.000-08:00</published><updated>2011-01-04T12:08:41.224-08:00</updated><title type='text'>Running a JUnit 4 test from a Scala script</title><content type='html'>I'm using Scala now and then as a language for side projects.  One of the nice things about Scala is that you can bootstrap with a single-file script, similar to Python or Ruby.  Since I enjoy building things with test-driven development, it's not long after I write a script that I want to start writing tests for classes and functions.  However, when I tried to do this in the straight-forward way, it doesn't quite work.  Herein, the problem, and its solution.&lt;br /&gt;&lt;br /&gt;As a first attempt, I expected this to work:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/765311.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;However, running this produces a failure in the infrastructure:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/765312.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;What's going on here is that when scala is run in single-file script mode, it implicitly wraps all of the declarations within the declaration of an anonymous singleton object (&lt;code&gt;Main$$anon&lt;/code&gt;).  When JUnit tries to reflectively create an ArithmeticTest object, it runs into the fact that, from the Java perspective, ArithmeticTest is a non-static inner class of &lt;code&gt;Main$$anon&lt;/code&gt;.  To get around this requires a bit of a dance, luckily made fairly short due to Scala's compact OO verbiage:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/765318.js"&gt; &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;If I find myself doing this often, I imagine I'll be pulling this out into an importable library.  Share and Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-7284912223090256354?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/7284912223090256354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2011/01/running-junit-4-test-from-scala-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/7284912223090256354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/7284912223090256354'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2011/01/running-junit-4-test-from-scala-script.html' title='Running a JUnit 4 test from a Scala script'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-8781286590626100766</id><published>2010-04-08T10:29:00.001-07:00</published><updated>2010-04-08T10:31:42.000-07:00</updated><title type='text'>JUnit 4.8.2</title><content type='html'>This is a &lt;a href="http://kentbeck.github.com/junit/doc/ReleaseNotes4.8.2.html"&gt;small bugfix release&lt;/a&gt;.  &lt;a href="http://github.com/KentBeck/junit/downloads"&gt;Download now&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-8781286590626100766?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/8781286590626100766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2010/04/junit-482.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/8781286590626100766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/8781286590626100766'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2010/04/junit-482.html' title='JUnit 4.8.2'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-661315376016438632</id><published>2010-03-15T16:06:00.000-07:00</published><updated>2010-03-15T16:11:03.260-07:00</updated><title type='text'>Dotmesh: get free rich assertions from your existing methods</title><content type='html'>It's been over &lt;a href="http://www.infoq.com/news/2007/07/new_junit_release"&gt;two years&lt;/a&gt; since JUnit 4.4 was released with support for the &lt;a href="http://www.junit.org/apidocs/org/junit/Assert.html#assertThat(T, org.hamcrest.Matcher)"&gt;assertThat&lt;/a&gt; method initially &lt;a href="http://joe.truemesh.com/blog/000511.html"&gt;conceived&lt;/a&gt; by Joe Walnes.  A classic statement using assertThat is:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333428.js?file=gistfile1.java"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;assertThat was based on the Matcher interface from &lt;a href="http://code.google.com/p/hamcrest/"&gt;hamcrest&lt;/a&gt;, and led to more readable code, more readable error messages, and custom, combinable assertions.  However, after two years of use, I’ve seen several situations in which the Matcher-based assertThat API can fail developers:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;br /&gt;Custom matchers can be too much code for simple ideas.  Ideally, custom assertions should just flow off the fingers, but I find it very telling that the JUnit self tests only have four custom matchers, all in the &lt;a href="http://github.com/KentBeck/junit/blob/a68ae0886c1c6274943e6f99d70816d162273d9c/src/main/java/org/junit/experimental/results/ResultMatchers.java"&gt;ResultMatchers&lt;/a&gt; class.  Most of them are about 7 lines of mostly-boilerplate code, such as this:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333430.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;Matchers can be difficult to discover.  They are generally returned by static factory methods--if your IDE isn’t set up to auto-complete these methods, it can be difficult to track down whether a matcher method exists for the assertion you want, or which of several available has the right meaning.  Ideally, we could restrict the types of Matchers that could type-check for a given value, to give your IDE hints.  Unfortunately...&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;I have discovered a long, painful proof that it is impossible to provide strong types for matcher-based assertThat using:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Java generics...&lt;/li&gt;&lt;li&gt;as implemented in all of the compilers we currently support...&lt;/li&gt;&lt;li&gt;without breaking the use of Matchers in &lt;a href="http://www.jmock.org/"&gt;jMock&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This blog post is too narrow to contain it.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Similar to the above, introducing a dependency from JUnit on hamcrest, the matcher library, causes problems for any users using a different version of hamcrest for another use (for example, jMock)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Based on these difficulties, I propose a new API for assertions, which I call dotmesh*.  The idea is to use &lt;a href="http://shareandenjoy.saff.net/2006/12/interface-imposterization.html"&gt;imposterization&lt;/a&gt; to generate assertions based on every boolean method available on every class.  The new form of the assertion above would be:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333432.js?file=gistfile1.java"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;If this fails, the error message is:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Failed: &amp;lt;ERROR: blah blah blah&amp;gt;.contains(&amp;lt;OK&amp;gt;)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here’s some more examples of dotmesh in action:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333434.js?file=gistfile1.java"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Advantages of the dotmesh approach over the Matcher approach:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;br /&gt;No additional code: assertions and error messages are automatically generated from any method that returns boolean.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;Super-easy discovery: know a boolean method?   You know a dotmesh assertion.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;Strong typing for free: since we’re using the same methods and types, assertions only compile if they make sense.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;As a bonus, dotmesh provides a reward for interfaces that follow the “&lt;a href="http://martinfowler.com/articles/mocksArentStubs.html#DesignStyle"&gt;Suggestion of Demeter&lt;/a&gt;”, and provide accessors returning booleans or collections for essential information.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;An ambivalent point:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;br /&gt;Both dotmesh and hamcrest must use specially-named methods to “talk about” operations that would otherwise be more clearly stated with operators.  For example, you can easily:&lt;br /&gt;&lt;code&gt;assertTrue(x &gt; 5)&lt;/code&gt;&lt;br /&gt;but in order to find out why this assertion fails, you must use:&lt;br /&gt;&lt;code&gt;assertThat(x, greaterThan(5))&lt;/code&gt; in hamcrest, or&lt;br /&gt;&lt;code&gt;assertThat(x).greaterThan(5)&lt;/code&gt; in dotmesh.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Disadvantages of dotmesh:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;br /&gt;The standard imposterization tricks break down when the target being imposterized is a primitive type or final class.  This isn’t too big a problem for primitive types and Strings: we can introduce a wrapper interface for each, and then be done.  The more disconcerting issue is third-party final classes.  We can’t generate new synthetic classes that replicate their interface, so this is going to fail at some point:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333435.js?file=gistfile1.java"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;My approach for the moment is to be very apologetic in the error message.  Once I see where this problem tends to come up for users, one of several possible mitigation tricks may prove possible.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;The hamcrest assertThat allowed (to a certain extent) for combinations of matchers:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333436.js?file=gistfile1.java"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;dotmesh can’t match that directly, but there’s often useful workarounds:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/333437.js?file=gistfile1.java"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;In order to pull off imposterization, I’m using objenesis and cglib, which might conceivably lead to the same versioning issues currently imposed by hamcrest.  However, this dependency is completely encapsulated from the user, so we could use a solution like &lt;a href="http://code.google.com/p/jarjar/"&gt;jarjar&lt;/a&gt; to avoid any conflicts.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;If I’ve piqued your interest enough to try some truly bleeding-edge, no-guarantees code, check out:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://github.com/dsaff/dotmesh"&gt;http://github.com/dsaff/dotmesh&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* Why "dotmesh"?  Well, it creates assertions by "meshing" a new meaning into the "dot" that indicates a method invocation.  There's another reason, which is a cryptic homage to hamcrest,..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-661315376016438632?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/661315376016438632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2010/03/dotmesh-free-assertions-from-domain.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/661315376016438632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/661315376016438632'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2010/03/dotmesh-free-assertions-from-domain.html' title='Dotmesh: get free rich assertions from your existing methods'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-6576471535270902847</id><published>2009-12-08T07:31:00.000-08:00</published><updated>2009-12-08T07:34:42.604-08:00</updated><title type='text'>JUnit 4.8.1 is released</title><content type='html'>JUnit 4.8's category support had a glaring error in the javadoc (CategoryType was a quickly-deleted design decision that lived on in the documentation), and in the implementation (Class-level annotations were not trickled down to methods).  4.8.1 fixes this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kentbeck.github.com/junit/doc/ReleaseNotes4.8.1.html"&gt;&lt;br /&gt;Release notes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kentbeck.github.com/junit/javadoc/4.8.1"&gt;Javadoc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://github.com/KentBeck/junit/downloads"&gt;Download&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-6576471535270902847?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/6576471535270902847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2009/12/junit-481-is-released.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/6576471535270902847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/6576471535270902847'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2009/12/junit-481-is-released.html' title='JUnit 4.8.1 is released'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-2037133824150925512</id><published>2009-12-01T12:57:00.000-08:00</published><updated>2009-12-01T13:01:47.328-08:00</updated><title type='text'>JUnit 4.8 is released</title><content type='html'>JUnit 4.8 has been released. The primary new feature is preliminary support for Categories. For more information, see the &lt;a href="http://kentbeck.github.com/junit/doc/ReleaseNotes4.8.html"&gt;release notes&lt;/a&gt; and &lt;a href="http://kentbeck.github.com/junit/javadoc/4.8/"&gt;javadoc&lt;/a&gt;, and then &lt;a href="http://github.com/KentBeck/junit/downloads"&gt;download&lt;/a&gt;!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-2037133824150925512?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/2037133824150925512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2009/12/junit-48-is-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2037133824150925512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/2037133824150925512'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2009/12/junit-48-is-released.html' title='JUnit 4.8 is released'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6376362364452929889.post-5183486971694883024</id><published>2009-11-14T05:06:00.000-08:00</published><updated>2009-11-14T05:16:54.655-08:00</updated><title type='text'>Categories in JUnit 4.8</title><content type='html'>This is from the tests for the upcoming JUnit 4.8 release.  It's the simplest-to-implement framework we could find for labelling tests with named categories, and running only tests with a given label.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; public interface SlowTests extends CategoryType {&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static class A {&lt;br /&gt;  @Test&lt;br /&gt;  public void a() {&lt;br /&gt;   fail();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Category(SlowTests.class)&lt;br /&gt;  @Test&lt;br /&gt;  public void b() {&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Category(SlowTests.class)&lt;br /&gt; public static class B {&lt;br /&gt;  @Test&lt;br /&gt;  public void c() {&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static class C {&lt;br /&gt;  @Test&lt;br /&gt;  public void d() {&lt;br /&gt;   fail();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @RunWith(Categories.class)&lt;br /&gt; @IncludeCategory(SlowTests.class)&lt;br /&gt; @SuiteClasses( { A.class, B.class, C.class })&lt;br /&gt; public static class SlowTestSuite {&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6376362364452929889-5183486971694883024?l=saffgreenbar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saffgreenbar.blogspot.com/feeds/5183486971694883024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://saffgreenbar.blogspot.com/2009/11/heres-test-code-snippet-public.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/5183486971694883024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6376362364452929889/posts/default/5183486971694883024'/><link rel='alternate' type='text/html' href='http://saffgreenbar.blogspot.com/2009/11/heres-test-code-snippet-public.html' title='Categories in JUnit 4.8'/><author><name>David Saff</name><uri>http://www.blogger.com/profile/09768182182555576537</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
