Order resources alphabetically and add test for it

Change-Id: I4a3b7d139ae0485da192499681325fc64f05247c