Th other option was to use the new scheme of specifying mapred-queues.xml containing he queue configuration. I used QueueManagerTestUtils class to achieve this. But there are other mapred-queues.xml in the classpath which gets picked up before test's mapred-queues.xml with different configuration.
These files seem to be created when I build using eclipse and if I remove those mapred-queues.xml, then test passes. So this may be an eclipse created problem.
The old scheme of defining queues does not use mapred-queues.xml and hence will work regardless multiple mapred-queues.xml issues.
Since we are not testing Queue management here, I believe, keeping the following line makes the test more reliable.
So I recommend to go with the attached patch. Please let me know if there are some other ideas.