* TIKA-1145 If the TikaConfig has a ClassLoader set on it,
* that should be used when loading the mimetypes and when
* discovering services
*/
public void testClassLoaderUsedEverywhere() throws Exception {
ResourceLoggingClassLoader customLoader =
new ResourceLoggingClassLoader(getClass().getClassLoader());
TikaConfig config;
// Without a classloader set, normal one will be used
config = new TikaConfig();
config.getMediaTypeRegistry();
config.getParser();
assertEquals(0, customLoader.getLoadedResources().size());
// With a classloader set, resources will come through it
config = new TikaConfig(customLoader);
config.getMediaTypeRegistry();
config.getParser();
Map<String,List<URL>> resources = customLoader.getLoadedResources();
int resourcesCount = resources.size();
assertTrue(
"Not enough things used the classloader, found only " + resourcesCount,
resourcesCount > 3
);