I have learnt some automated testing with JUnit. Junit is a java package which lets you write test suites so that you can simply run them when you program is done. It is good for software development as you can re-run the same tests again and again, and you can save some time and even avoid human generated error as missing out a particular test that happens with me over and over as I tend to forget cases.
Learning JUnit is extremely easy if you have some Java knowledge. However I noted that the official website has very less tutorials available and you wont find much information on the internet also (please direct me if you happen to know any good tutorial).
I grabbed “Pragmatic Unit Testing” by Andrew Hunt and Davis Thomas. This book is really helpful as it starts with the basics and goes through every details of JUnit. You can find a copy of the ebook if you search a little.
Archive for November, 2009
Automated testing with JUnit
This was really tough for me since I had never used command line for compiling java programs, I always used Netbeans for coding in Java. Recently I started learning JUnit for which I decided to use command Line.
Whenever I googled for its solution I got
$ export CLASSPATH=$CLASSPATH:
But this did not fix my problem. Eventually I landed up on some websites and finally here. Though it is mainly written for Windows but can be used likewise for linux also.
So the thing to be done is either add all the jar files explicitly to the classpath or put all the jars in a directory (/home/roshan/jars for me).
Now run this command:
$ export CLASSPATH=$CLASSPATH:/home/roshan/jars/*
The wildcard ‘*’ fixed the problem. Now you can make this change permanent by adding this command to your .bash_profile in home directory or /etc/profile to make system wide changes.
Somehow the default Iced Tea Webstart throws NullPointerException which I dont know how to debug. I downloaded SUN JDK and installed on my machine, you can use your package manager also. It usually gets installed in /usr/java/jdk-<version> and /usr/java/latest links to the latest version installed, so it is better to use the later. Then download the ContestApplet.jnlp and simply sun the following command to get it working.
$ /usr/java/latest/bin/javaws ContestApplet.jnlp
It uses default system proxy to download the content from Topcoder needed to execute the arena. When the arena is open set the proxy and use HTTP Tunnel A or B. For us Tunnel B works.
Recent Comments