<?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>Lars Dunemark</title>
	<atom:link href="http://www.dunemark.se/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dunemark.se/blog</link>
	<description>Programming, Android, Beagle board and other stuff</description>
	<lastBuildDate>Fri, 26 Jun 2009 16:45:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google releases NDK for Android</title>
		<link>http://www.dunemark.se/blog/?p=111</link>
		<comments>http://www.dunemark.se/blog/?p=111#comments</comments>
		<pubDate>Fri, 26 Jun 2009 16:44:44 +0000</pubDate>
		<dc:creator>Lars Dunemark</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.dunemark.se/blog/?p=111</guid>
		<description><![CDATA[News for android development is that Google announced the release of Android NDK today. This should be used to implement some functionality that your android application need in native C or C++ instead of java. 
For more information read: http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html
]]></description>
			<content:encoded><![CDATA[<p>News for android development is that Google announced the release of Android NDK today. This should be used to implement some functionality that your android application need in native C or C++ instead of java. </p>
<p>For more information read: <a href="http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html">http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dunemark.se/blog/?feed=rss2&amp;p=111</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using gerrit</title>
		<link>http://www.dunemark.se/blog/?p=78</link>
		<comments>http://www.dunemark.se/blog/?p=78#comments</comments>
		<pubDate>Wed, 13 May 2009 22:03:48 +0000</pubDate>
		<dc:creator>Lars Dunemark</dc:creator>
				<category><![CDATA[Programmering]]></category>
		<category><![CDATA[gerrit]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.dunemark.se/blog/?p=78</guid>
		<description><![CDATA[Some git commands to remember when working with gerrit.

Gerrit documentation
Clone master branch:
git clone ssh://user@review-server:29418/myProject
Send new patch:
git push ssh://user@review-server:29418/myProject HEAD:refs/for/master
update a patch:
1: Grab a change:
   git pull ssh://user@review-server:29418/myProject refs/changes/&#60;nbr&#62;
2: Make you changes.
   # commit A
3: Rebase
   git rebase -i HEAD~2
   change pick to squash
4: Push
]]></description>
			<content:encoded><![CDATA[<p>Some git commands to remember when working with <a title="Gerrit" href="http://code.google.com/p/gerrit/">gerrit</a>.<br />
<span id="more-78"></span></p>
<p><a title="Gerrit documentation" href="http://gerrit.googlecode.com/svn/documentation/2.0/index.html">Gerrit documentation</a></p>
<pre>Clone master branch:
git clone ssh://user@review-server:29418/myProject</pre>
<pre>Send new patch:
git push ssh://user@review-server:29418/myProject HEAD:refs/for/master</pre>
<pre>update a patch:
1: Grab a change:
   git pull ssh://user@review-server:29418/myProject refs/changes/&lt;nbr&gt;
2: Make you changes.
   # commit A
3: Rebase
   git rebase -i HEAD~2
   change pick to squash
4: Push</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dunemark.se/blog/?feed=rss2&amp;p=78</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New look!</title>
		<link>http://www.dunemark.se/blog/?p=72</link>
		<comments>http://www.dunemark.se/blog/?p=72#comments</comments>
		<pubDate>Tue, 12 May 2009 17:13:27 +0000</pubDate>
		<dc:creator>Lars Dunemark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.dunemark.se/blog/?p=72</guid>
		<description><![CDATA[Today I took the time to change from the standard theme to a new look&#8230;
I think the code block is better in this theme.
If you see any problem or has any comments send my a note.
]]></description>
			<content:encoded><![CDATA[<p>Today I took the time to change from the standard theme to a new look&#8230;<br />
I think the code block is better in this theme.</p>
<p>If you see any problem or has any comments send my a note.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dunemark.se/blog/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup our own local copy of androids repositories</title>
		<link>http://www.dunemark.se/blog/?p=67</link>
		<comments>http://www.dunemark.se/blog/?p=67#comments</comments>
		<pubDate>Mon, 04 May 2009 18:04:02 +0000</pubDate>
		<dc:creator>Lars Dunemark</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[repo]]></category>

		<guid isPermaLink="false">http://www.dunemark.se/blog/?p=67</guid>
		<description><![CDATA[I found this link about setting up your own local repositories for android source.
http://gregmeiste.com/2009/02/mirror-android-repositories-on-a-local-server/
]]></description>
			<content:encoded><![CDATA[<p>I found this link about setting up your own local repositories for android source.</p>
<p><a href="http://gregmeiste.com/2009/02/mirror-android-repositories-on-a-local-server/">http://gregmeiste.com/2009/02/mirror-android-repositories-on-a-local-server/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dunemark.se/blog/?feed=rss2&amp;p=67</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My first post with postbot</title>
		<link>http://www.dunemark.se/blog/?p=63</link>
		<comments>http://www.dunemark.se/blog/?p=63#comments</comments>
		<pubDate>Sun, 03 May 2009 16:39:18 +0000</pubDate>
		<dc:creator>androidbot</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[market]]></category>
		<category><![CDATA[postbot]]></category>

		<guid isPermaLink="false">http://www.dunemark.se/blog/?p=63</guid>
		<description><![CDATA[There is many applications in Android market and one that I&#8217;m trying now is postbot to write this blog post on wordpress.
It seems to work very good and has a clean and simple UI.
It supports categories and adding images.
But its missing feature for adding tags but its looks like that will be included in next [...]]]></description>
			<content:encoded><![CDATA[<p>There is many applications in Android market and one that I&#8217;m trying now is postbot to write this blog post on wordpress.</p>
<p>It seems to work very good and has a clean and simple UI.<br />
It supports categories and adding images.<br />
But its missing feature for adding tags but its looks like that will be included in <a href="http://nickthecook.wordpress.com/2009/03/01/postbot-110-in-the-works/">next release</a>.</p>
<p>You can find it on <a href="http://nickthecook.wordpress.com/">http://nickthecook.wordpress.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dunemark.se/blog/?feed=rss2&amp;p=63</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing and developing using JUnit in Java</title>
		<link>http://www.dunemark.se/blog/?p=45</link>
		<comments>http://www.dunemark.se/blog/?p=45#comments</comments>
		<pubDate>Sat, 02 May 2009 15:35:49 +0000</pubDate>
		<dc:creator>Lars Dunemark</dc:creator>
				<category><![CDATA[Programmering]]></category>
		<category><![CDATA[developing]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.dunemark.se/blog/?p=45</guid>
		<description><![CDATA[As programmer you have probably heard that testing is not fun and that no programmer like testing&#8230;
I don&#8217;t think that is the true. I believe that most programmers would like to test there code before releasing anything to a test organization. One way to do this is by writing unit test.
One tool for doing this [...]]]></description>
			<content:encoded><![CDATA[<p>As programmer you have probably heard that testing is not fun and that no programmer like testing&#8230;<br />
I don&#8217;t think that is the true. I believe that most programmers would like to test there code before releasing anything to a test organization. One way to do this is by writing unit test.</p>
<p>One tool for doing this is <a href="http://www.junit.org/">JUnit</a>. JUnit is for Java but it exist similar tools for other languages.<span id="more-45"></span></p>
<p>We will start with a simple example, we will write a unit test for Java LinkedList.</p>
<pre>import java.util.LinkedList;

import junit.framework.Assert;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;

public class testLinkedList extends TestCase {

    private LinkedList&lt;String&gt; list = null;

    @Before
    public void setUp() throws Exception {
        list = new LinkedList&lt;String&gt;();
    }

    @After
    public void tearDown() throws Exception {
        list = null;
    }

    public void testNewLinkedList() {
        Assert.assertNotNull(list);
    }

    public void testSizeZero() {
        Assert.assertEquals(0, list.size());
    }

    public void testSizeOneString() {
        String testString = "Hello world, this is our test string.";
        list.add(testString);
        Assert.assertEquals(1, list.size());
    }

    public void testIsEmpty() {
        Assert.assertTrue(list.isEmpty());
    }

    public void testIsEmptyOneString() {
        String testString = "Hello world, this is our test string.";
        list.add(testString);
        Assert.assertFalse(list.isEmpty());
    }
}</pre>
<p>This test will work on Java implementation of LinkedList.<br />
With this test we should try to make our own implementation of a list.</p>
<p>Lets create a new class called MyList with our 3 methods that we are testing.</p>
<pre>public class MyList {

	public void add(String testString) {
	}

	public boolean isEmpty() {
		return false;
	}

	public int size() {
		return 0;
	}

}</pre>
<p>If we change all references LinkedList to MyList in our testcase and try to run it again we will get a new result with 3 tests passed and 2 tests failed.</p>
<pre>	private MyList list = null;

	@Before
	public void setUp() throws Exception {
		list = new MyList();
	}</pre>
<p>As you can see the tests that&#8217;s failing is testSizeOneString and testIsEmpty.</p>
<p>So lets try fix some of the problem.<br />
If we implement MyList with a array of Strings like this all tests will pass.</p>
<pre>public class MyList {

	String[] array = null;
	int pos = -1;

	public MyList() {
		array = new String[20];
		pos = 0;
	}

	public void add(String testString) {
		array[pos++] = testString;
	}

	public boolean isEmpty() {
		return (pos == 0);
	}

	public int size() {
		return pos;
	}

}</pre>
<p>The problem with this implementation is that it will not be possible to add more then 20 items to the list. So by adding next test we need to find a new way to implement the list.</p>
<pre>	public void testSize30Strings() {
		String testString = "Hello world, this is our test string.";
		for (int i = 0; i &lt; 30; i++) {
			list.add(testString);
		}
		Assert.assertEquals(30, list.size());
	}</pre>
<p>This was my quick tour of java junit. If you liked it or hated it please leave a comment and I will try to change it.</p>
<p>Have fun and don&#8217;t forget to test your code&#8230; <img src='http://www.dunemark.se/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dunemark.se/blog/?feed=rss2&amp;p=45</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
