First, there's a slightly easier way to get at the site name: SiteContextManager.getCurrentSite().getItemDisplayName()
Second, yes you can set the site context directly from your unit test code. You'd call SiteContextManager's pushSiteContext method. It's not a static method, so you need a reference to the SiteContextManager component. The method takes a SiteContext as input and returns true if the push was successful. They way you get your hands on a SiteContext object depends on what your test code is trying to do and how much of the normal ATG runtime environment is present.
If your test class contains a number of different cases, you might want to be a good citizen and match every pushSiteContext with a call to popSiteContext. The input to popSiteContext is the SiteContext object you pushed earlier. There's a sanity check to see if the context at the top of the stack is the one the caller passed in.
Thanks Clare.This works. What's the easier way to get the SiteName?
The easier way to get the site name is the one I mentioned earlier. It's similar to what you coded, without the call to getCurrentSiteContext.