You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working to integrate Cucumber with the Arquillian test framework, and I found a major problem with the ClasspathResourceLoader: there is no way to extend the capabilities of the resource loader to be able to conditionally load resources based on the protocol of each resource's URL. If there's a funky URL protocol that doesn't refer to a filesystem resource or a JAR file, the ClasspathResourceLoader will fail to load the resource.
I ran into this problem while executing Cucumber tests with Arquillian and JBoss AS 7.1.1.Final. When the Cucumber tests are running within JBoss AS, each resource URL returned by ClassLoader.getResources() uses the "vfs" protocol to indicate handling by the JBoss Virtual File System.
ClasspathIterable creates ZipResourceIterator for any resource URL's with "jar" protocol or FileResourceIterator for all other protocols.
FileResourceIterator receives invalid path to resource that doesn't exist because JBoss VFS abstracts away the physical location of all resources.
I get IllegalArgumentException: "Not a file or directory: C:\jboss-as\install\dir\bin\content\weirdo-location-that-doesn't-really-exist-unless-you-load-me-using-vfs".
Currently, there is no way to extend or modify the resource loading behavior of the ClasspathResourceLoader class. I'm looking at having to completely reimplement the ResourceLoader interface and manually providing Backend implementations to the Runtime because of the hard dependency on the ClasspathResourceLoader class in Runtime.loadBackends(). Most of the classes used by the ClasspathResourceLoader are also package-private, so existing code cannot be reused.
The text was updated successfully, but these errors were encountered:
I'm working to integrate Cucumber with the Arquillian test framework, and I found a major problem with the ClasspathResourceLoader: there is no way to extend the capabilities of the resource loader to be able to conditionally load resources based on the protocol of each resource's URL. If there's a funky URL protocol that doesn't refer to a filesystem resource or a JAR file, the ClasspathResourceLoader will fail to load the resource.
I ran into this problem while executing Cucumber tests with Arquillian and JBoss AS 7.1.1.Final. When the Cucumber tests are running within JBoss AS, each resource URL returned by ClassLoader.getResources() uses the "vfs" protocol to indicate handling by the JBoss Virtual File System.
Here's the problem:
Currently, there is no way to extend or modify the resource loading behavior of the ClasspathResourceLoader class. I'm looking at having to completely reimplement the ResourceLoader interface and manually providing Backend implementations to the Runtime because of the hard dependency on the ClasspathResourceLoader class in Runtime.loadBackends(). Most of the classes used by the ClasspathResourceLoader are also package-private, so existing code cannot be reused.
The text was updated successfully, but these errors were encountered: