I have
New Test &
One line:
jQuery(this).closest('li').addClass("selected").siblings().removeClass("selected");
but you will have to amend your event to pass through 'this';
onclick="setSelectedTestPlan(this);"