Disabling test under JUnit 4.4

Recently I had to disable a unit test in our test system. We use Maven as our build tool and JUnit 4.4 for unit testing. I had a few options,

  1. Exclude that particular class from tests under surefire plugins configuration in my pom.xml
  2. Remove @Test annotation from test method in the test class. Which fails as it finds a Test class but does not find any test methods
  3. Rename the class from say MyTest to something that does not end with "Test" say "Tezt"
I remembered that in TestNG you can just disable a test by saying @Test (enable = false) and I was desperately trying to find how to do this in JUnit 4.4. But to my dissappointment Test annotation only allows a couple of attributes, timeout and expected which did not do what I want.

After looking at the JUnit javadocs, I stumbled upon an annotation @Ignore it is indeed an annotation to be used if you want to skip the test.

So if you want to disable your test case in JUnit 4.4 just annotate your test methond with @Ignore @Test annotations.

What it also did was that Maven started reposting one test as being "Skipped" which is nicer as it keeps reminding you that you need to look after the test that you have disabled.

Wow! Thunderbird now reminds me to attach the file

Thunderbird 3.0.3 introduces a great feature that reminds you to attach a document in case you type words like "attaching" in your email. It scans through the matter of the composed email finds relevant word that may indicate that you may want to attach some file. Here is a screenshot.

Thunderbird 3.0.3 migration

I recently migrated to Thunderbird 3.0.3 There is a specific problem with Thunderbird that I have seen at times. Ever faced a problem of loosing your mail data and accounts after migrating to new Thunderbird? Thunderbird stores data under directory named .thunderbird in your home. But maybe just in Ubuntu or some versions of Thunderbird store it under directory named .mozilla-thunderbird. So  if after installing a new Thunnderbird and restarting it, if you are not able to see your e-mails, it might well be the problem of directory names.

To resolve, try renaming the directory (Whatever applies to you),

> mv .mozilla-thunderbird .thunderbird

or

> mv .thunderbird .mozilla-thunderbird 

Restart your Thunderbird and now you should be able to see your e-mails.

I have mostly seen this problem  when I install Thunderbird externally i.e. not through package manager. By installing I mean simply extracting it to /opt and not doing "./configure make install"

RIA frameworks and HTML 5

Recently when Steve Jobs wrote off Adobe Flash support in iPad, I went ahead and read more about HTML 5.0 and I am convinced that once HTML 5.0  is out, there will be no need of the fancy RIA frameworks like Apache Pivot and Adobe Flex.

HTML 5.0 introduces everything from videos, audio as well as shapes as part of the specification (introduces tags

But indeed HTML 5.0 is the future. If you are planning to develop your products based on Adobe Flex or Apache Pivot then think twice.

Why I like Twitter!

With only about 30 odd posts in last 4 years over here, and already about a 35 tweets in a couple of months, I really have started liking twitter. I ask myself why did I not blog so much? Answer is simple, everytime I tried to write a blog entry, I never had a restriction of number of words. I always felt as if I needed to fill the space (for no reason) With Twitter its just soo much more easy.

Animal Sniffer Maven Plugin

While looking at the Maven plugins at Codehaus, I just stumbled upon a maven plugin named Animal Sniffer. This plugin could be a great tool for people working on frameworks where API's are published to the user. There is always a problem of API loosing the compatibility across versions (for eg. making some method final looses backward compatibility). These kind of problems are very very difficult to trap.

I wanted to evaluate this plugin for instrumenting our internal API against which following versions can check compatibility. Firstly I am not sure if Animal Sniffer can be used in this way but I believe it could be.

I tried to play with the plugin a little where I figured out that vresion 1.5-SNAPSHOT cannot be downloaded from the Codehaus snapshot repository and older versions 1.4, 1.3 encounter an NPE when I run animal-sniffer:build goal.

Does anyone have experience with Animal Sniffer?

Apache Pivot, Platform for building Rich Internet Appplications

Apache Pivot is a framework for building Rich Internet Applications. Pivot seems to have taken inspiration from Flex and Silverlight.

Here is a snippet of overview from Pivot website,

"Pivot applications are written using a combination of Java and XML and can be run either as an applet or as a standalone (optionally offline) desktop application. Pivot includes features that make building modern GUI applications much easier, including declarative UI, data binding, effects and transitions, and web services integration." 

I would personally choose Pivot over Flex or Silverlight as it is easier to integrate builds into Continuous Integration and Maven. Not sure where Pivot will head to but it surely seems a promising technology.

Log4j 1.2.15 with Maven

I had a problem with Log4j version 1.2.15 where after adding a Log4j dependency, maven would try to download dependencies like java mail, jmx etc. The download never seem to finish as it is from some external repository. I am not sure if it was a temporary problem. I figured the problem was version 1.2.15 when I looked at the pom of that version and I could see some dependencies with specific repository.

Migrating to version 1.2.14 seem to fix this problem.

How I tricked my Ubuntu

My Ubunut was giving me problems starting up yesterday. After investigating for a while, I figured that it was due to corrupt reiserfs on /var So I set to fix the problem by running reiserfsch --check on my /var partition. I rebooted Ubuntu in Recovery Mode. To My surprise, I could not do fsck on my /var as it was mounted and some applications seemed to be using it. I always thought that Recovery Mode does not boot the installed kernel instead it boots an alternate image. This was merely a misconception.

Now with no Ubuntu live CD I could virtually not solve the problem! So I thought about tricking my Ubuntu. I edited my /var/fstab, commented out the mount /var and rebooted my machine. Now the /var was not mounted and I could run fsck on that partition. Some applications did complain about missing files etc. but it at least allowed me to run fsck on my /var partition. After fixing problems by doing reiserfsck --rebuild-tree I removed the commented line from fstab, mounted /var and switched to runlevel 5 and my Ubuntu is back fixed again

Runnable jar using maven assembly plugin

I faced a nagging problem of not able to create a runnable jar using Maven assembly plugin. I had a couple of dependencies which were required at runtime. I used the jar-with-dependecies assembly to achieve this. But my Main-Class attribute from the MANIFEST.MF was lost every time.

The solution to this problem is archive configuration under assembly plugin as described here