Throw exceptions only when datasource has wrong package, not check for instance of Datasource
fix failing tests. test and mocked sources would cause exceptions
Merge pull request #1176 from ceeram/2.3-3694

Throw exceptions only when datasource has wrong package.

This is replaces instanceof checks with a more generalized check. 

Refs #3694