<?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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>DevChix » Java</title>
	
	<link>http://www.devchix.com</link>
	<description>Boys can't have all the fun</description>
	<pubDate>Sat, 04 Jul 2009 06:18:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/devchix/IfHv" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Test More for Java?!</title>
		<link>http://www.devchix.com/2007/05/16/test-more-for-java/</link>
		<comments>http://www.devchix.com/2007/05/16/test-more-for-java/#comments</comments>
		<pubDate>Wed, 16 May 2007 12:52:55 +0000</pubDate>
		<dc:creator>Nola</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.devchix.com/2007/05/16/test-more-for-java/</guid>
		<description><![CDATA[Any one know, does there exist a TestSimple/More (from Perl) for Java like the module for Perl?
whats that you say? I wrote about TestMore in Perl and PHP on my blog awhile back: here and here also!
I did a quick scan with google didn&#8217;t give me much hope. So I wrote this quickly on the [...]]]></description>
			<content:encoded><![CDATA[<p>Any one know, does there exist a TestSimple/More (from Perl) for Java like the module for Perl?</p>
<p>whats that you say? I wrote about TestMore in Perl and PHP on my blog awhile back: <a href="http://www.rubygeek.com/2006/01/25/test-freak/">here</a> and <a href="http://www.rubygeek.com/2006/01/26/response-to-test-freak/">here also!</a></p>
<p>I did a quick scan with google didn&#8217;t give me much hope. So I wrote this quickly on the train this morning, since I can&#8217;t hardly stand to program in any language without a TestMore like implementation..  (I know there&#8217;s JUnit, and I&#8217;ved used it before, but its alot of overhead.. I just needed some quick tests!)</p>
<p>Class: (not making any claim this is the best or greatest way, and not 100% TAP protocol)</p>
<pre>
package com.myawesomesite.util;

public class TestSimple {

 private int testCount;

 public TestSimple() {
  this.testCount = 0;
 }

 public void ok(boolean truth, String message) {
  this.testCount++;
  System.out.println( (truth ? "ok " : "not ok ")
                      + this.testCount + " - "
                      + message);
 }
</pre>
<p>Usage:</p>
<pre>
package com.myawesomesite.java;

import com.myawesomesite.java.*;
import com.myawesomesite.util.TestSimple;

public class TestAnimal {

 public static void main(String[] args) {
  TestSimple test = new TestSimple();

  Dog bob = new Dog();

  bob.setColor("green");
  bob.setCollarSize(10);

  test.ok(bob.getColor() == "green", "bob's color is green");
  test.ok(bob.getCollarSize() == 10,"bob's collar size is 10");
  test.ok(bob.getCollarSize() == 0,"bob's collar size 0");

 } 

}
</pre>
<p>output is:</p>
<pre>
ok 1 - bob's color is green
ok 2 - bob's collar size is 10
not ok 3 - bob's collar size is 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.devchix.com/2007/05/16/test-more-for-java/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
