There's an open source extention to JUnit called Cactus which you can use for testing server-side code. It's available from the apache foundation web site. it even contains tasks for ant, so you can automate your testing into you build process.
Another option (assuming you're doing all your JNDI lookups etc from one class, which you should me because it makes your code more maintainable) is to plug in a different implementaion of that class that does not do JNDI lookups etc. for testing.
1. Can I get a JNDI resouce from JBoss into a different VM (such as a Datasource made available to JUnit) so I may test these sorts of classes properly?
JNDI can be accessed from a different JVM, however Datasources can not be accessed remotely. If you use Cactus as sugested by Carpy you will be running in the same JVM so will be able to access them.
2. If not, can I deploy a datasource config so that it is deployed in a Global scope, rather than "java:" local VM scope?