I wanted if there is a way or an article referring to the way one can write unit tests for web scripts. I read that there is a framework available with the version 3.0, but was wondering if there is one testing framework for alfresco 2.1
TestWebScriptServer can be used for this. For 3.0 it has been enhanced to be more easily pluggable into unit testing frameworks, but in 2.1 you can still create an instance of it, submit requests to it, and then verify the results. See wiki section here: http://wiki.alfresco.com/wiki/Web_Scripts#Unit_Test_Helper_Methods