<?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:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-14113074</atom:id><lastBuildDate>Thu, 16 Feb 2012 09:53:41 +0000</lastBuildDate><category>Random</category><category>Dzone</category><category>Android</category><category>Dev Tool</category><category>Java</category><category>Unit Test</category><category>Tips and Tricks</category><category>Cloud</category><category>Jboss</category><title>Senthil Balakrishnan</title><description>Open Source - Technology &amp;amp; Standards.</description><link>http://www.senthilb.com/</link><managingEditor>noreply@blogger.com (Senthil Balakrishnan)</managingEditor><generator>Blogger</generator><openSearch:totalResults>69</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SenthilBalakrishnan" /><feedburner:info uri="senthilbalakrishnan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-1668068934644556847</guid><pubDate>Sun, 20 Nov 2011 16:56:00 +0000</pubDate><atom:updated>2011-11-20T22:35:46.797+05:30</atom:updated><title>Cross-Platform Mobile development tools/frameworks</title><description>Was exploring some cross-platform mobile frameworks in the market. Even though there are lot of them in the market. Couple of open source solutions sounded  very impressive.&lt;br /&gt;1. &lt;a href="http://rhomobile.com/"&gt;Rhomobile&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://phonegap.com/"&gt;PhoneGap&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tried some samples on Rhomobile, yet to try phone gap. In a way these frameworks saves lot of time &amp;amp; cost involved in developing application specific to an operating systems / app markets. Instead of working on a specific SDK's it's a no-brainer to choose such frameworks. Write once &amp;amp; port to any device type. How cool it is !!!, way to go...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-1668068934644556847?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/GtPjPUenIrg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/GtPjPUenIrg/cross-platform-mobile-development.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2011/11/cross-platform-mobile-development.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-8407410105299491840</guid><pubDate>Sun, 31 Jul 2011 03:47:00 +0000</pubDate><atom:updated>2011-07-31T09:20:58.884+05:30</atom:updated><title>web-log-analyzer  - Hosted a project in google code base today</title><description>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Hosted a project in google code base today "web-log-analyzer". &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Simple Utility to analyze your web access log to help you identify  potential traffic, response times (min/max/avg), most used URL's etc. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/web-log-analyzer/"&gt;http://code.google.com/p/web-log-analyzer/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-8407410105299491840?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/Watz4E2iDLQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/Watz4E2iDLQ/web-log-analyzer-hosted-project-in.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2011/07/web-log-analyzer-hosted-project-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-8190520152439933353</guid><pubDate>Sun, 31 Jul 2011 01:05:00 +0000</pubDate><atom:updated>2011-07-31T06:44:22.383+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips and Tricks</category><title>Garbage Cat - Analysis of you GC Log</title><description>&lt;span style="font-family: verdana;font-size:100%;" &gt;Came across this handy utility(&lt;a href="http://code.google.com/a/eclipselabs.org/p/garbagecat/"&gt;garbagecat&lt;/a&gt;) to analyze Garbage Collector logs. Simple to use, output contains nice analysis report &amp;amp; recommendation on your GC.&lt;br /&gt;&lt;br /&gt;Refer the &lt;a href="http://code.google.com/a/eclipselabs.org/p/garbagecat/wiki/Documentation"&gt;documentation&lt;/a&gt; for more details on the usage.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-8190520152439933353?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/5DudXeKvWfs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/5DudXeKvWfs/garbage-cat-analysis-of-you-gc-log.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2011/07/garbage-cat-analysis-of-you-gc-log.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-2365551486863004250</guid><pubDate>Sun, 12 Jun 2011 00:27:00 +0000</pubDate><atom:updated>2011-06-12T19:40:38.076+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jboss</category><title>My Test Drive on JBoss AS 6.0.0</title><description>Took a test drive of JBoss 6.0.0 this weekend, thought would be nice to summarize my observation (with the background of using JBoss 4.3.0 version for my current projects).&lt;br /&gt;&lt;br /&gt;JBoss 6.x.x is a re-architecture of JBoss 4.x with new the kernal (&lt;a href="http://www.jboss.org/jbossmc"&gt;JBoss Microcontainer&lt;/a&gt;).  Good news for application developers not much of change to the folder structure with exception of few new configuration files &amp;amp; some old ones were moved around.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;High Lights&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Default support to &lt;a href="http://www.jcp.org/en/jsr/detail?id=316"&gt;Java EE 6.0&lt;/a&gt; Specification support.&lt;/li&gt;&lt;li&gt;JSF 2.0 support with integration with &lt;a href="http://hibernate.org/subprojects/validator"&gt;Bean Validation&lt;/a&gt; (&lt;a href="http://jcp.org/en/jsr/detail?id=303"&gt;JSR-303&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;CDI (Contexts and Dependency Injection) &lt;a href="http://www.jcp.org/en/jsr/detail?id=299"&gt;JSR - 299&lt;/a&gt; , &lt;a href="http://seamframework.org/Weld"&gt;Weld &lt;/a&gt;is JBoss project to support CDI.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Hornet MQ is the default  &amp;amp;  recommended messaging infrastructure.&lt;/li&gt;&lt;li&gt;New Apache CXF-based JBossWS stack.&lt;/li&gt;&lt;li&gt;&lt;a href="http://community.jboss.org/wiki/JBossEmbeddedAS"&gt;JBoss Embedded AS&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;New Admin-Console to ease the server administration.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Admin-Console&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;New Admin-Console is a refresher, user friendly with tree based  navigatio. &lt;/li&gt;&lt;li&gt;Lot of resembles to Weblogic Admin console :), never mind it does the purpose.&lt;/li&gt;&lt;li&gt;All configuration parameters are persisted for good, unlike the JBoss 4.* version.&lt;/li&gt;&lt;li&gt;"Service Binding Manager" Component externalizes all port configuration  for a given/running profile. This saves lot of time fiddling with the  raw .xml files :) as in 4.3.0. &lt;/li&gt;&lt;li&gt;Applications (.war, .ear)  can be added/updated dynamically using the console.&lt;/li&gt;&lt;li&gt;Queues &amp;amp; Topic can be added dynamically using the console.&lt;/li&gt;&lt;li&gt;Database connection pools can be added dynamically using the console.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You have provision to restart/start/shutdown the server using the admin console.&lt;/li&gt;&lt;li&gt;Very detailed Garbage Collector / Memory pool info on the console.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The Metric tab for every component provides you useful statistics/metrics an the component. Ex: Selecting a queue provides (Message count, consumer count etc.)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-SId0pHNLCsM/TfQMx_g1RmI/AAAAAAAABos/VKPs2bQharo/s1600/adminconsole.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 415px; height: 210px;" src="http://3.bp.blogspot.com/-SId0pHNLCsM/TfQMx_g1RmI/AAAAAAAABos/VKPs2bQharo/s320/adminconsole.JPG" alt="" id="BLOGGER_PHOTO_ID_5617128688240117346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;JMX-CONSOLE&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;JMX-CONSOLE is still available, but with a new look &amp;amp; feel.&lt;/li&gt;&lt;/ol&gt;&lt;a href="http://4.bp.blogspot.com/-AIwcDsFEvJs/TfQN47xyi9I/AAAAAAAABo0/zW75AYil2l8/s1600/jmxconsole.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 384px; height: 265px;" src="http://4.bp.blogspot.com/-AIwcDsFEvJs/TfQN47xyi9I/AAAAAAAABo0/zW75AYil2l8/s320/jmxconsole.JPG" alt="" id="BLOGGER_PHOTO_ID_5617129907008211922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Others&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Jboss VFS (Virtual File System), help yourself reading this &lt;a href="http://java.dzone.com/news/jboss-virtual-file-system"&gt;article &lt;/a&gt;to understand.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/jbossweb"&gt;Jboss Web&lt;/a&gt; is the default webserver offering from JBoss 5.x.x, build on top of Tomcat.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Felt the Server startup &amp;amp; Shutdown is slower than 4.3.0 GA :( hoping minor tweaks should take care of it.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Couldn't find any documentation on migration from 4.3.0 to 6.0.0, will keep looking...&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Reference&lt;br /&gt;&lt;a href="http://java.dzone.com/videos/jboss-as6-m1"&gt;Jason Greene - What's new in JBoss AS 6.0.0&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://docs.jboss.org/jbossas/6/Admin_Console_Guide/en-US/html/index.html"&gt;Admin Console user guide&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.jboss.org/"&gt;www.jboss.org&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.java.dzone.com/"&gt;www.java.dzone.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-2365551486863004250?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/y8zpZjp0uAU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/y8zpZjp0uAU/my-test-drive-on-jboss-600.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-SId0pHNLCsM/TfQMx_g1RmI/AAAAAAAABos/VKPs2bQharo/s72-c/adminconsole.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.senthilb.com/2011/06/my-test-drive-on-jboss-600.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-5737296878337845228</guid><pubDate>Fri, 10 Jun 2011 01:09:00 +0000</pubDate><atom:updated>2011-06-10T07:23:56.773+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Jboss</category><title>Power of AccessLog &amp; Tomcat Valve configuration</title><description>&lt;span style="font-family: verdana;font-family:verdana;font-size:100%;"  &gt;In recent past we faced quite a performance issues resulting in different modes of collecting performance statistics from web server.  One of the handy tool was web server access logs, all I had to do is configure my webserver to write access logs. It dumps all the requested information (URL, Timestamp &amp;amp; Even roundtrip/response time of a request), How cool... with zero additional code you get response time of each request.&lt;br /&gt;&lt;br /&gt;Link below details of access log configuration on tomcat, this could vary depending on the type of webserver used. But every webserver would have a access log by default.&lt;br /&gt;&lt;a href="http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access_Log_Valve"&gt;http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Access_Log_Valve&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;All different types of valves supported by Tomcat, most useful of it all is "Request Dumper" valve (dumps all request detail) &amp;amp; "Access Log" Valve.&lt;br /&gt;&lt;a href="http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Request_Dumper_Valve"&gt;http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Request_Dumper_Valve&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Example, below configuration (%D %T) will log response time for a request &amp;amp; timestamp of the request.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold; font-family:verdana;" &gt;Valve className="org.apache.catalina.valves.AccessLogValve" prefix="localhost_access_log." suffix=".txt" pattern="%D %T"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Lot of tools can help you analyze the access logs &amp;amp; provide more insight of the usage response time etc.&lt;/span&gt;&lt;br /&gt;&lt;pre  style="font-family: verdana;font-family:verdana;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.nltechno.com/awstats/awstats.pl?config=destailleur.fr"&gt;http://www.nltechno.com/awstats/awstats.pl?config=destailleur.fr&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;Conclusion: We all know it's mandatory for a web server to have an access log,&lt;br /&gt;but the good part is this can greatly ease performance study &amp;amp; tune&lt;br /&gt;your web application.&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-5737296878337845228?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/mXGRoTRG9_8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/mXGRoTRG9_8/power-of-accesslog-tomcat-valve.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2011/06/power-of-accesslog-tomcat-valve.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-7651037923787426916</guid><pubDate>Mon, 27 Dec 2010 02:55:00 +0000</pubDate><atom:updated>2010-12-27T08:43:58.037+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Android</category><title>How to use Intent to pass object ?</title><description>During my eZeditor app development I figured out how to pass an object using intent from one activity to another.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you want to pass an Object (Note.java) from one activity to another.&lt;/li&gt;&lt;li&gt;The Note.java should implement android.os.Parcelable interface.&lt;/li&gt;&lt;li&gt;Before you say startActivity(intent) on the source activity to navigate.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Say intent.putExtra("com.ez.editor.note", note); where note is an object.&lt;/li&gt;&lt;li&gt;On the target activity this.getIntent().getParcelableExtra("com.ez.editor.note"); should return you the object that you intent to pass.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;blockquote  style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;public class Note implements Parcelable {&lt;br /&gt;&lt;br /&gt;public static final Parcelable.Creator&lt;note&gt; CREATOR = new Parcelable.Creator&lt;note&gt;() {&lt;br /&gt;&lt;br /&gt;       public Note createFromParcel(Parcel in) {&lt;br /&gt;           return new Note(in);&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;     @Override&lt;br /&gt;      public void writeToParcel(Parcel out, int flags) {&lt;br /&gt;          out.writeString(name);&lt;br /&gt;          out.writeInt(index);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;       public Note[] newArray(int size) {&lt;br /&gt;           return new Note[size];&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   };&lt;br /&gt;}&lt;/note&gt;&lt;/note&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-7651037923787426916?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/yKZd66k822Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/yKZd66k822Q/how-to-use-intent-to-pass-object.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>1</thr:total><feedburner:origLink>http://www.senthilb.com/2010/12/how-to-use-intent-to-pass-object.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-6228783929319643600</guid><pubDate>Mon, 27 Dec 2010 01:35:00 +0000</pubDate><atom:updated>2010-12-27T09:40:10.661+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Android</category><title>Android eZedit (My first open App)</title><description>&lt;span style="font-weight: bold;"&gt;Application Name: &lt;/span&gt;eZedit (Android Application)&lt;span style="font-weight: bold;"&gt;.&lt;br /&gt;&lt;br /&gt;API Used: &lt;/span&gt; SQLLite Database, Custom View (onDraw), Usage of intent, Touch/Click Listeners &amp;amp; etc.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Objective: &lt;/span&gt;Simple android app let's you "Write your notes in your own handwriting" by touching the screen.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Android Eclipse project: &lt;/span&gt;&lt;a href="https://sites.google.com/site/dreamcometruesite/android/eZEditor.zip?attredirects=0&amp;amp;d=1"&gt;eZedit.zip&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Android installable: &lt;/span&gt;&lt;span&gt;&lt;a href="https://sites.google.com/site/dreamcometruesite/android/eZEditor.apk?attredirects=0&amp;amp;d=1"&gt;eZedit.apk&lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Android Version: &lt;/span&gt;&lt;span&gt;Android Platform 2.2 / API level 8&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Disclaimer: &lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I have tested it on an emulator, never on a real phone.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;No warranty &amp;amp; support will be provided.&lt;/li&gt;&lt;li&gt;The code is open for reuse.&lt;/li&gt;&lt;li&gt;Try at your own risk :)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-6228783929319643600?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/pF52QPUOy28" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/pF52QPUOy28/android-ezeditor-my-first-open-app.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/12/android-ezeditor-my-first-open-app.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-3936588869677720434</guid><pubDate>Wed, 21 Jul 2010 02:53:00 +0000</pubDate><atom:updated>2010-07-21T09:03:46.980+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Random</category><title>Is there a way to surprise your loved ones after "Death" ?</title><description>Even writing "Death" makes me sad &amp;amp; terrified, but sometimes things change very little even if you want to. Every one of us has an end to this life, but our love for people around doesn't change much. If you have seen the movie "&lt;a href="http://www.imdb.com/title/tt0431308/"&gt;P.S. I love you&lt;/a&gt;", I felt amazed that someone can plan so much after his death to surprise and gift his wife at perfect instances. That's exactly what i am talkin about.&lt;br /&gt;&lt;br /&gt;Is it possible or any entrepreneur out their thinking about such a service, were someone can subscribe and pay for a service that need to be performed after his/her death :). Typically, Schedule all the moments and time to gift and surprise his/her loved ones.&lt;br /&gt;&lt;br /&gt;I know I sound crazy here, not all that shown in movies can be brought to reality, but if it really makes someone special to you happy, Why not ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-3936588869677720434?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/HeeFz3hgb2M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/HeeFz3hgb2M/is-there-way-to-surprise-your-loved.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/07/is-there-way-to-surprise-your-loved.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-5852452299715322932</guid><pubDate>Fri, 16 Jul 2010 01:33:00 +0000</pubDate><atom:updated>2010-07-21T08:52:25.138+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Random</category><title>Stuff that Interest me - 07/15</title><description>&lt;h2 class="post-title"  style="font-family:trebuchet ms;"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;/span&gt;&lt;/h2&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;Just started this  section, will get this organized and interesting soon...&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);font-family:trebuchet ms;font-size:130%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;span style="font-family:trebuchet ms;"&gt;Interesting Projects:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://joda-time.sourceforge.net/"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;ol style="font-weight: bold;"&gt;&lt;li&gt;&lt;a href="http://joda-time.sourceforge.net/"&gt;Joda Time&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://couchdb.apache.org/"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Apache CouchDB&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://beust.com/jcommander/"&gt;JCommander&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;font-size:100%;"  &gt;Interesting Post:&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.qas.com/company/data-quality-news/cloud_computing_biggest_change_in_it_in_years__5793.htm"&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;ol style="font-weight: bold;"&gt;&lt;li&gt;&lt;a style="font-family: trebuchet ms;" href="http://www.qas.com/company/data-quality-news/cloud_computing_biggest_change_in_it_in_years__5793.htm"&gt;&lt;span&gt;Cloud computing 'biggest change in IT in years'&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;a href="http://www.nytimes.com/2010/07/12/technology/12google.html?_r=1&amp;amp;src=busln"&gt;Google’s Do-It-Yourself App Creation  Software&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a style="font-family: trebuchet ms;" href="http://manidoraisamy.blogspot.com/2010/07/forget-number-of-servers-in-your-data.html"&gt;Forget  the number of servers in your data center. Reverse the constraints!&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a style="font-family: trebuchet ms;" href="http://mashable.com/2010/07/14/distributed-developer-teams/?utm_source=TweetMeme&amp;amp;utm_medium=widget&amp;amp;utm_campaign=retweetbutton"&gt;&lt;span style="font-size:100%;"&gt;10 Tools for Distributed Developer Teams&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;a href="http://satyaq.wordpress.com/2010/07/09/pairing-why-does-it-work/"&gt;&lt;span&gt;Pairing – Why does it work?&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;a href="http://coolcrafting.blogspot.com/2010/07/indian-rupee-gets-symbol.html"&gt;Indian  Rupee gets a symbol&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-5852452299715322932?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/sX39DsGRyDs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/sX39DsGRyDs/stuff-interested-me-0715.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/07/stuff-interested-me-0715.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-6752380449714867145</guid><pubDate>Sun, 11 Jul 2010 14:34:00 +0000</pubDate><atom:updated>2010-07-21T08:52:58.711+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Random</category><title>8 Traits of a Great Leader</title><description>One question keeps popping up all the time "What makes a true leader ?".  In all my years of experience, i have seen many leaders whom i really admire, worship &amp;amp;  imitate (to be frank). I am very sure everyone of us would have such icon, and their influence on each one of our work hence this &lt;span&gt;is &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;"My Version or Belief of a Great leader"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Style Of Leadership: &lt;/span&gt;There is no one single recipe to be a great leader, first trait is to be yourself and have a style of your own. Effectiveness of a leadership is directly proportional to the context (environment, industry, nature of work &amp;amp; type of people you handle).&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Courage: &lt;/span&gt;You step back, your  team does the same. As a  leader you need to be man enough to speak when you have to. (customer, top management doesn't matter).&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Talk less:&lt;/span&gt; Show "How to get  things done?", rather than lecturing for hours.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Understanding individuals: &lt;/span&gt;Every human being is unique and they get motivated for some, and may not for some. You need to understand, better than being a clown.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Panic - Band Wagon:&lt;/span&gt; Don't jump  in to the panic band wagon when the whole team is already in their.  These are times of fight back and thinking rationale and no time for  panic.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Innovation: &lt;/span&gt;Just like how one goal can bring the spirit back into the team. It's important to keep innovating, this means a lot of positive energy, openness to compete.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Be a real captain:&lt;/span&gt; You should be  the last person to jump from a wrecking ship, Believe me this means a lot  of guts.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Winning Habit:&lt;/span&gt; Everybody wants to be on a winning team, winning is a critical factor for further success as a leader. All you can do here is to give yourself a best chance, leave the rest to the fate...&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-6752380449714867145?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/F1rDRHBrvCQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/F1rDRHBrvCQ/8-traits-of-great-leader.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>7</thr:total><feedburner:origLink>http://www.senthilb.com/2010/07/8-traits-of-great-leader.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-2280981087315592043</guid><pubDate>Sun, 20 Jun 2010 02:30:00 +0000</pubDate><atom:updated>2010-07-21T08:53:44.020+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Dev Tool</category><title>Guava or Google Collection library</title><description>Guava or Google Collection library - just started to play with it. One thing attracted me the most is &lt;a href="http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html"&gt;MapMarker&lt;/a&gt; which resembles the behavior of ConcurrentMap with eviction timeouts and choice of soft, weak references. Objective of the project says "Productivity aids to Java Programmers", Still exploring to see how it's useful in real context...&lt;br /&gt;&lt;br /&gt;&lt;object height="385" width="500"&gt;&lt;param name="movie" value="http://www.youtube.com/v/ZeO_J2OcHYM&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/ZeO_J2OcHYM&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="385" width="540"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Loads of Material In reference to Guava,&lt;br /&gt;&lt;a href="http://jnb.ociweb.com/jnb/jnbApr2010.html"&gt;http://jnb.ociweb.com/jnb/jnbApr2010.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://scaramoche.blogspot.com/2010/05/googles-guava-library-tutorial-part-1.html"&gt;http://scaramoche.blogspot.com/2010/05/googles-guava-library-tutorial-part-1.html&lt;br /&gt;&lt;/a&gt;&lt;a href="http://code.google.com/p/guava-libraries/"&gt;http://code.google.com/p/guava-libraries/&lt;/a&gt;&lt;a href="http://code.google.com/p/guava-libraries/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-2280981087315592043?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/xaPY3Fl-BZA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/xaPY3Fl-BZA/guava-or-google-collection-library.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/guava-or-google-collection-library.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-8273130826955341862</guid><pubDate>Sat, 19 Jun 2010 14:55:00 +0000</pubDate><atom:updated>2010-06-19T20:30:38.355+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dzone</category><title>Unit Tests - "Written Once and Forgotten Forever"</title><description>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;I have come across many unit test cases that are written once and forgotten for ever, with all the dataset/environmental dependencies in it. What is the importance of dataset/environment? Let's take an example, observe the test case below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;public void testEmpFinder () {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;//Weird Test case for Fun!!!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;String result = "JOHN";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;//Passing employee id returns employee object.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;//verify the name matches.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Employee emp = EmpFinder.find(1);&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;assertEquals(emp.getName,result);&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;}&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;What's wrong? The developer had made an assumption, that on querying with employeeid='1' will return employee with the name "JOHN". The data could be coming from a database table "EMPLOYEE". But It’s very evident this test case would fail if run on an environment where the employeeid='1' data doesn't exists. This makes the test cases obsolete the moment they are written.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Approach&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;1. Save Insert/Delete datascript, that could be run on test setup () and delete test data on completion of test.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;2. You could use something like DBUnit (http://www.dbunit.org/) which exports and imports the database data into an XML dataset. - Not sure of DBUnit support for modern day ORM's (Hibernate).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Conclusion:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Unit tests should match &amp;amp; sustain life time of source, after all its a guarantee card to your source code. We just looked at database dependency for example, how about dependencies such as JMS, Content Repository, LDAP etc. Writing a test case with all its data &amp;amp; environmental dependencies Mocked &amp;amp; externalized is an Art.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://java.dzone.com/articles/unit-test-written-once-and"&gt;Chekout In Dzone&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-8273130826955341862?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/MgQU4RJpbUk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/MgQU4RJpbUk/unit-tests-written-once-and-forgotten.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>2</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/unit-tests-written-once-and-forgotten.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-3384946799503378556</guid><pubDate>Wed, 16 Jun 2010 01:42:00 +0000</pubDate><atom:updated>2010-06-19T20:06:25.317+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dev Tool</category><title>VisualVM - Simple Profiler</title><description>&lt;a href="https://visualvm.dev.java.net/download.html"&gt;VisualVM &lt;/a&gt;is a handy tool just like the JConsole, with additional features of a commercial profilers. You could profile your application by CPU &amp;amp; Heap utilization (by class/method). You can even profile a server remotely, check out for documentation.&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://blip.tv/play/AeGPcQI" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="390"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It's a must to have tool for java developers...&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;https://visualvm.dev.java.net/features.html&lt;br /&gt;http://blip.tv/file/1582849&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-3384946799503378556?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/2oxLa5DxGi0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/2oxLa5DxGi0/visualvm-simple-profiler.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/visualvm-simple-profiler.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-1926640470097711548</guid><pubDate>Tue, 15 Jun 2010 00:45:00 +0000</pubDate><atom:updated>2010-06-19T20:04:08.997+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Random</category><title>Is flexibility enemy of standardization ?</title><description>&lt;span style="font-family:trebuchet ms;"&gt;I was thinking about evolution of java &amp;amp; open source world. What comes to my mind is the flexibility it offers to build your own stack of tools &amp;amp; technology when you start a project, cool!!! isn't it. You could explore, develop, cutting edge, unknown, unnamed open source project in your project....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;But software is not about using cool technology all the time, isn't it ?  &lt;/span&gt;&lt;br /&gt;&lt;ol style="font-family: trebuchet ms;"&gt;&lt;li&gt;What about skill set to manage and maintain it ? &lt;/li&gt;&lt;li&gt;What about  support for the technology and open source used ?&lt;/li&gt;&lt;li&gt;What about wear and tear of changes happens over the life cycle ?&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:trebuchet ms;"&gt;I tend to feel too much of flexibility leads to problems, which are unnoticed during the &lt;/span&gt;&lt;span style="font-weight: bold;font-family:trebuchet ms;" &gt;architecture&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt; and development of the project and get's uncovered during maintenance phase. Same application developed in .&lt;span style="font-weight: bold;"&gt;net &lt;/span&gt;takes lesser effort than &lt;span style="font-weight: bold;"&gt;java&lt;/span&gt;, what do you think is the reason ? Why every java projects are different by technology rather than business ? Is this the price to pay, to use an open platform independent languages &amp;amp; specifications ?&lt;br /&gt;&lt;br /&gt;Architects come up with cool stuff, believe me it's the least used feature in the actual project. To sum it up, flexibility to choose the specification, implementation, technology, open source, commercial blah blah!!! leads to problems in later stages of the project, which very few people have stayed long enough to see them. &lt;/span&gt;It's also important to consider other aspects like skill set, proven architecture, standardization, support and etc in a software architecture than just being cool......&lt;br /&gt;&lt;br /&gt;After all this is my blog, and i am bored of being cool :) ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-1926640470097711548?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/H_JbUKaVM3o" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/H_JbUKaVM3o/is-flexibitly-enemy-to-standardization.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>4</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/is-flexibitly-enemy-to-standardization.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-5516306733883372023</guid><pubDate>Thu, 10 Jun 2010 23:20:00 +0000</pubDate><atom:updated>2010-06-19T20:03:28.393+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tips and Tricks</category><title>How to post XML code on Blogger</title><description>Paste your XML content &lt;a href="http://centricle.com/tools/html-entities/"&gt;here&lt;/a&gt; and click on encode. Copy the encoded content and paste in your blog. It safes lot of your time encoding it yourself....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-5516306733883372023?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/IOW8u6Orf5A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/IOW8u6Orf5A/how-to-post-xml-code-on-blogger.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/how-to-post-xml-code-on-blogger.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-5659423535840451653</guid><pubDate>Thu, 10 Jun 2010 23:09:00 +0000</pubDate><atom:updated>2010-06-19T20:07:21.845+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tips and Tricks</category><category domain="http://www.blogger.com/atom/ns#">Jboss</category><title>This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6</title><description>&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;2010-06-10 16:18:51,656 503469 ERROR [STDERR] @main     at org.jboss.resource.adapter.jms.JmsSession.checkStrict&lt;br /&gt;(JmsSession.java:754)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;2010-06-10 16:18:51,656 503469 ERROR [STDERR] @main     at org.jboss.resource.adapter.jms.JmsMessageConsumer&lt;br /&gt;.setMessageListener(JmsMessageConsumer.java:174)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fix:&lt;/span&gt;&lt;br /&gt;Adding the following in the file, default/deploy/jms-ds.xml (or) production/deploy/hajndi-jms-ds.xml based on the profile used, fixed it.&lt;/span&gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;span style=";font-family:trebuchet ms;font-size:100%;"  &gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;config-property name="Strict" type="java.lang.Boolean"&amp;gt;false&amp;lt;/config-property&amp;gt; under "&amp;lt;tx-connection-factory&amp;gt;&amp;lt;jndi-name&amp;gt;JmsXA&amp;lt;/jndi-name&amp;gt;"&lt;/blockquote&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-5659423535840451653?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/SFJ14baG5fk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/SFJ14baG5fk/this-method-is-not-applicable-inside.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/this-method-is-not-applicable-inside.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-1952574006418139989</guid><pubDate>Thu, 10 Jun 2010 12:10:00 +0000</pubDate><atom:updated>2010-06-19T20:05:05.721+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cloud</category><title>Opensource entry into Cloud space :)</title><description>Read this article at &lt;a href="http://java.dzone.com/articles/typhoonae-and-proliferation"&gt;Dzone&lt;/a&gt; yesterday, sounded very interesting. As a matter of fact, it's an opensource &lt;a href="http://code.google.com/p/typhoonae/"&gt;project&lt;/a&gt; that could give you all that GAE or EC2 can provide with all opensource stack.&lt;br /&gt;&lt;br /&gt;The beauty is, you can have your own cloud built with in your firewall and have your apps follow GAE API to be portable, how cool it is :) checkout - &lt;a href="http://code.google.com/p/typhoonae/"&gt;Typhoonae&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-1952574006418139989?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/-SpXasDVHlU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/-SpXasDVHlU/opensource-venturing-into-cloud-space.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/opensource-venturing-into-cloud-space.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-6487125312372427069</guid><pubDate>Wed, 02 Jun 2010 03:02:00 +0000</pubDate><atom:updated>2010-06-19T20:05:14.790+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cloud</category><title>MongoDB</title><description>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;MongoDB bridges the gap between key-value stores (which are fast     and highly scalable) and traditional RDBMS systems (which provide     rich queries and deep functionality).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;I strongly feel the cloud players should adopt this approach, since so much of knowledge, best practices and standardization has gone into the design of traditional RDBMS Systems. I strongly feel ditching them is not the best way to go....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;br /&gt;I haven't tried Mongo myself yet, would do soon....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Reference:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://www.mongodb.org/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-6487125312372427069?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/MmfS-eNSCJE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/MmfS-eNSCJE/mongodb.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/06/mongodb.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-1417936606821649921</guid><pubDate>Fri, 28 May 2010 01:03:00 +0000</pubDate><atom:updated>2010-06-19T20:05:32.743+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Unit Test</category><title>EasyMock your Jms Listener</title><description>&lt;blockquote  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;EasyMock as the name states "Its an easy to Mock framework" that mocks interfaces to do better unit testing. I tried some samples and found it really amazing, and thought of creating a sample that helps to understand mocking better.&lt;br /&gt;&lt;br /&gt;Assume &lt;/span&gt;&lt;span style="font-size:100%;"&gt;JMSListener &lt;/span&gt;&lt;span style="font-size:100%;"&gt;is a business class that listens to a JMS Queue and does some business processing based on the received message. The problem with such components are they are dependent on some resources  external&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (J2ee Container, Queue, database, LDAP etc.)&lt;/span&gt;&lt;span style="font-size:100%;"&gt; to the code itself. This makes unit testing difficult and puts the EasyMock on driving seat :).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 51);font-size:100%;" &gt;package com.jms;&lt;br /&gt;&lt;br /&gt;import javax.jms.JMSException;&lt;br /&gt;import javax.jms.Message;&lt;br /&gt;import javax.jms.MessageListener;&lt;br /&gt;import javax.jms.TextMessage;&lt;br /&gt;&lt;br /&gt;public class JMSListener implements MessageListener{&lt;br /&gt;public void onMessage(Message arg0) {&lt;br /&gt;TextMessage msg = (TextMessage)arg0;&lt;br /&gt;try {&lt;br /&gt;   //Some Mission Critical Logic :)&lt;br /&gt;   System.out.println("Got the message.. \n"+msg.getText());&lt;br /&gt;} catch (JMSException e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Let's see the Unit Test and how EasyMock Mocks the Message interface, The highlighted lines shows the Magic of EasyMock &amp;amp; power of interfaces...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 51);font-size:100%;" &gt;package com.jms;&lt;br /&gt;&lt;br /&gt;import static org.easymock.EasyMock.*;&lt;br /&gt;import javax.jms.JMSException;&lt;br /&gt;import javax.jms.TextMessage;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;&lt;br /&gt;public class JMSListenerTest extends TestCase {&lt;br /&gt;private TextMessage mock;&lt;br /&gt;private JMSListener listener;&lt;br /&gt;&lt;br /&gt;protected void setUp() {&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153);"&gt;     &lt;span style="font-weight: bold;"&gt;mock = createMock(TextMessage.class);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;listener = new JMSListener();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void testRemoveNonExistingDocument() throws JMSException {&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;expect(mock.getText()).andReturn("&lt;/span&gt;&lt;xml style="color: rgb(51, 0, 153); font-weight: bold;"&gt;content&lt;/xml&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;     replay(mock);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;     listener.onMessage(mock);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;     verify(mock);&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;Reference&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;a href="http://easymock.org/EasyMock2_2_Documentation.html"&gt;http://easymock.org/EasyMock2_2_Documentation.html&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-1417936606821649921?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/vSXB_b_9aoE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/vSXB_b_9aoE/easymock-your-jms-listener.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/05/easymock-your-jms-listener.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-2626612977459096438</guid><pubDate>Wed, 26 May 2010 22:26:00 +0000</pubDate><atom:updated>2010-06-19T20:17:38.311+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Dev Tool</category><title>JavaAssist - Byte Code Enhancement simplified</title><description>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;JavaAssist - Byte Code Enhancement simplified.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;JavaAssist is a class library to manipulate your Java Byte Code without touching the source. Let's take an example of measuring &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;time taken to execute a method. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(51, 0, 51);"&gt;&lt;span style="font-family:trebuchet ms;"&gt;public class Subject {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;    /**&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;     * Timetaken for start &amp;amp; end of the method&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;     * @throws InterruptedException &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;     */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;    public void method2() throws InterruptedException {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;        //Some business logic :)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;        Thread.sleep(2000);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:trebuchet ms;"&gt;To measure time taken for executing subject.method2(), you could enhance the Subject.methods() by adding code start and end of the method as shown.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(51, 0, 51);"&gt;&lt;span style="font-family:trebuchet ms;"&gt;public class JavaAssist {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;       public static void main(String[] args) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          public static void timeTaken() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          try {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          ClassPool p = ClassPool.getDefault();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          CtClass cc = p.get("Subject");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          CtMethod meth2 = cc.getDeclaredMethod("method2");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          meth2.insertBefore("System.out.println(\" Start : \"+new java.util.Date());");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          meth2.insertAfter("System.out.println(\" End   : \"+new java.util.Date());");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          //cc.writeFile(".");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          Class c = cc.toClass();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          Subject s = (Subject) c.newInstance();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          s.method2();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          cc.detach();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;          } catch (Exception e) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;             // suppressed&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;         }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:trebuchet ms;"&gt;Output:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Start : Wed May 26 17:24:18 EDT 2010&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;End   : Wed May 26 17:24:20 EDT 2010&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Cool isn't it!!!. It can do wonders check the &lt;a href="http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/"&gt;API section&lt;/a&gt; for more details.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Reference&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;a href="http://www.csg.is.titech.ac.jp/%7Echiba/javassist/tutorial/tutorial.html#read"&gt;http://www.csg.is.titech.ac.jp/~chiba/javassist/tutorial/tutorial.html#read&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/"&gt;&lt;span style="font-family:trebuchet ms;"&gt;http://www.csg.is.titech.ac.jp/~chiba/javassist/html/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-2626612977459096438?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/bTYqGyH1GkY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/bTYqGyH1GkY/javaassist-byte-code-enhancement.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>3</thr:total><feedburner:origLink>http://www.senthilb.com/2010/05/javaassist-byte-code-enhancement.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-7032487881769243051</guid><pubDate>Tue, 25 May 2010 22:50:00 +0000</pubDate><atom:updated>2010-06-19T20:08:03.240+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Unit Test</category><category domain="http://www.blogger.com/atom/ns#">Random</category><title>Unit Test - "Written once and forgotten for ever"</title><description>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;I have come across many Unit test cases that are &lt;/span&gt;&lt;strong style="font-family: trebuchet ms;"&gt;written once  and forgotten for ever&lt;/strong&gt;&lt;span style="font-family:trebuchet ms;"&gt;, with all the dataset/environmental  dependencies in it. What is the importance of dataset/environment? Let's  take an example, observe the test case below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote  style="font-family:trebuchet ms;"&gt;&lt;span style="font-size:100%;"&gt;public  void testEmpFinder () {&lt;br /&gt;&lt;br /&gt;//Weird Test case for Fun!!!&lt;br /&gt;&lt;br /&gt;String  result = "JOHN";&lt;br /&gt;&lt;br /&gt;//Passing employee id returns employee object.&lt;br /&gt;&lt;br /&gt;//verify  the name matches.&lt;br /&gt;&lt;br /&gt;Employee emp = EmpFinder.find(1);&lt;br /&gt;&lt;br /&gt;assertEquals(emp.getName,result);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;What's  wrong? The developer had made an assumption, that on querying with  employeeid='1' will return employee with the name "JOHN". The data could  be coming from a database table "EMPLOYEE". But It’s very evident this  test case would fail if run on an environment where the employeeid='1'  data doesn't exists. This makes the test cases obsolete the moment they  are written.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Approach,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;1. Insert/Delete data script that  could run on test suit setup () and delete test data on completion of  test.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;2. You could use something like DBUnit  (http://www.dbunit.org/) which exports and imports the database data  into an XML dataset. - Not sure of DBUnit support for modern day ORM's  (Hibernate).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong style="font-family: trebuchet ms;"&gt;Conclusion:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Unit test should  match &amp;amp; sustain life time of source, after all its a guarantee card  to your source code. We just looked at database dependency for example,  how about dependencies such as JMS, Content Repository, LDAP etc.  Writing a test case with all its data &amp;amp; environmental dependencies  externalized is an Art.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-7032487881769243051?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/Kd7P3IqbU1g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/Kd7P3IqbU1g/unit-test-written-once-and-forgotten.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/05/unit-test-written-once-and-forgotten.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-3034758986956115060</guid><pubDate>Tue, 04 May 2010 00:19:00 +0000</pubDate><atom:updated>2010-06-19T20:08:53.125+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dev Tool</category><category domain="http://www.blogger.com/atom/ns#">Tips and Tricks</category><title>Memory Profiling Java Application</title><description>In continuation to the last post on &lt;a href="http://www.senthilb.com/2010/05/jboss-profiler-cool.html"&gt;Jboss Profiler&lt;/a&gt;, thought of sharing this simple and elegant memory profiler that ships with your JSDK (jmap)...&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To know the # of instances &amp;amp; type of objects in the heap in a simple and quick way, &lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;                    jmap -histo &lt;pid&gt;&gt; snapshot1.txt&lt;/pid&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;Sample Output:&lt;/li&gt;&lt;/ol&gt;           num #instances #bytes class name&lt;br /&gt;      --------------------------------------&lt;br /&gt;      1: 5555 6013016 java.util.Hashmap&lt;br /&gt;      2: 103 482888 org.apache....&lt;br /&gt;      3: 2000 334928 org.jboss...&lt;br /&gt;      4: 1280 274976 org.spring...&lt;ul&gt;&lt;li&gt;To troubleshoot a memory leak, do the above command multiple time and observe the snapshot.&lt;/li&gt;&lt;li&gt;jconsole is good enough, but this give a verbose details on the memory.&lt;/li&gt;&lt;li&gt;jhat is cool utility to browse the object topology over http on a specific port for analysis.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-3034758986956115060?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/VLuLxMrCMaU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/VLuLxMrCMaU/memory-profiling-java-application.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/05/memory-profiling-java-application.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-1908040003375708474</guid><pubDate>Sat, 01 May 2010 13:24:00 +0000</pubDate><atom:updated>2010-06-19T20:09:08.478+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Memory Intensive Operation In Java</title><description>Memory intensive processing without bloating Java Heap ????&lt;br /&gt;&lt;br /&gt;Not many must be aware of the package java.lang.ref.*, and their impact on Garbage Collectors,&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Strong Reference (Frequently used)&lt;/li&gt;&lt;li&gt;Soft Reference&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Weak Reference&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;A sample to demonstrate the references here, this program will fail with OutOfMemory without a weak reference (as we all know). With weak reference you can see the program runs for ever.&lt;br /&gt;&lt;br /&gt;But the downside is the GC will treat these references low in priority and does cleans it up from the heap, you are bound to see Null Pointer Exceptions. Another alternate is SoftReferences which could fit in very well in most of the business cases and keep your memory foot print clean.&lt;br /&gt;&lt;br /&gt;public class WeakRef {&lt;br /&gt;public static WeakReference lst = new WeakReference(new ArrayList());&lt;br /&gt;        public static void main(String[] args) {&lt;br /&gt;            while (true) {&lt;br /&gt;              try {&lt;br /&gt;                     lst.get().add("EEEEEEEEEEEEEEEEEEEEEEEEEEEEE");&lt;br /&gt;               } catch (Exception e) {&lt;br /&gt;                     e.printStackTrace();&lt;br /&gt;               }&lt;br /&gt;            }&lt;br /&gt;}&lt;arraylist&gt;&lt;arraylist&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Leaving this article a WeakReference to StrongReferences below,&lt;br /&gt;&lt;/arraylist&gt;&lt;/arraylist&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html"&gt;&lt;arraylist&gt;&lt;arraylist&gt;http://weblogs.java.net/blog/enicholas/archive/2006/05/understanding_w.html&lt;/arraylist&gt;&lt;/arraylist&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/package-summary.html"&gt;&lt;arraylist&gt;&lt;arraylist&gt;http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/package-summary.html&lt;/arraylist&gt;&lt;/arraylist&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;arraylist&gt;&lt;arraylist&gt;&lt;br /&gt;&lt;br /&gt;&lt;/arraylist&gt;&lt;/arraylist&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-1908040003375708474?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/47XWIzFURb4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/47XWIzFURb4/memory-intensive-operation-in-java.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/05/memory-intensive-operation-in-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-515423171334557646</guid><pubDate>Sat, 01 May 2010 00:56:00 +0000</pubDate><atom:updated>2010-06-19T20:37:06.589+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Dev Tool</category><category domain="http://www.blogger.com/atom/ns#">Jboss</category><category domain="http://www.blogger.com/atom/ns#">Dzone</category><title>Jboss Profiler 2.0 - Coo!!!</title><description>Got myself into a tough situation of Memory profiling a web application. I had a custom written profiler which does cool on measuring the time consumption, but not the memory. Since most of the profilers are commercial, tried my hands on "JBoss Profiler 2.0", Wow!!! never seen a profiler work in just 3-4 steps :), don't believe me try it yourself,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Steps:&lt;/span&gt;&lt;br /&gt;1.Download "JBoss Profiler 2.0" - http://labs.jboss.com/jbossprofiler/downloads.html&lt;br /&gt;2.Copy files to your Jboss,&lt;br /&gt;&lt;ul&gt;&lt;li&gt; jboss-profiler.jar -&gt; jboss/bin &lt;/li&gt;&lt;li&gt; jboss-profiler.properties (Add packages to be instrumented in includes) -&gt; jboss/bin &lt;/li&gt;&lt;li&gt; javassist.jar -&gt; Jboss/bin&lt;/li&gt;&lt;li&gt;jboss-profiler.sar -&gt; jbossas/server/(default)&lt;conf&gt;/deploy&lt;br /&gt;&lt;/conf&gt;&lt;/li&gt;&lt;/ul&gt;3.Add the following to your run.conf or run.bat JAVA_OPTS,&lt;br /&gt;-javaagent:jboss-profiler.jar -Djboss-profiler.properties=jboss-profiler.properties&lt;br /&gt;&lt;br /&gt;4.Start the Server, Use the Client program to collect the statistics,&lt;br /&gt;java -Xmx512m -Djboss-profiler-client.properties=jboss-profiler-client.properties -jar jboss-profiler-client.jar -h(server-host) &lt;localhost&gt; -P(server-port) &lt;port&gt; snapshot&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reference:&lt;/span&gt;&lt;br /&gt;1.Excellent User Guide comes with the download, it has everything you needed to know.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://java.dzone.com/tips/jboss-profiler-20-coo"&gt;Checkout In Dzone&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/port&gt;&lt;/localhost&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-515423171334557646?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/cexCJ3fn8Vg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/cexCJ3fn8Vg/jboss-profiler-cool.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/05/jboss-profiler-cool.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-14113074.post-1049038687889088500</guid><pubDate>Sat, 10 Apr 2010 18:06:00 +0000</pubDate><atom:updated>2010-06-19T20:09:31.583+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Random</category><title>Personal Tweet Robot - Approach</title><description>Personal/Personality based Tweet Robot ?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Proxy based utility that captures and analyzes user's internet behaviors (such as websites, keyword etc.). &lt;/li&gt;&lt;li&gt;Using the collected information, the robot should be able to generate automatic tweets using the twitter credentials and twitter API's.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Robot can also search the internet based on user's behavioral understanding and generate automatic updates reflecting the true personality of the user.&lt;/li&gt;&lt;/ul&gt;Still an approach in my mind, still thinking on the details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14113074-1049038687889088500?l=www.senthilb.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SenthilBalakrishnan/~4/mB7WbAthZCA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/SenthilBalakrishnan/~3/mB7WbAthZCA/personal-tweet-robot-approach.html</link><author>noreply@blogger.com (Senthil Balakrishnan)</author><thr:total>0</thr:total><feedburner:origLink>http://www.senthilb.com/2010/04/personal-tweet-robot-approach.html</feedburner:origLink></item></channel></rss>

