Google Chrome OS Screenshots

Auto Generate JUnit Test Cases

If you are starting fresh with using JUnit and writing Unit Testcases, then this tool will be very handy.

We currently already use JUnit, however we didnt write testcases for the POJOs. Now the code had grown so much we now have lot of POJOs and our coverage looks very dull.

The advantage of this tool is it not only generates skeleton test cases, for POJOs with just setter and getters, it actually generates Testcases also.

JUnit Code generation tool: http://www.junitdoclet.org/

Eclipse plugin using this doclet: http://sourceforge.net/projects/e-junitdoclet/

Example:
JUnitDoclet.1.0.2>junitdoclet.bat -d out -sourcepath C:\mymodule\src -package com.my.package

Very cool tool and I am gonna use this a lot. Thanks to JUnitDoclet Team.

JS: Calculate Browser window Height

Calculating browser window size using Javascript is not straight forward. There are many properties to check for and each property behaves differently in each version of Browser.

Following are various properties available to get Browser window width and height:
  • window.innerHeight/window.innerWidth
  • window.outerheight/window.outerwidth
  • document.body.clientHeight/document.body.clientWidth
  • document.documentElement.clientHeight/document.documentElement.clientWidth
Now if you want to calculate the window width and height you'll have to write javascript that checks the browser type and gets the width and height.

Fortunately for us Mark has already written a script that works in any browser. Here it is... http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

Thank you Mark!

Eclipse Shortcuts

Eclipse shortcuts for everyday development.

Ctrl+Shift+R
Open any Resource in the workspace.

Ctrl+Shift+T
Open a Java Class. Also supports abbreviations, example: BIS gives BufferedInputStream, NPE gives NullPointerException