I am using an abstract class in another module to read and write input for my test data with:
package src/main/java/path/to/my/base/testclass; InputStream stream = getClass().getResourceAsStream(filename);
filename , for example, "test.txt" located in src/main/resources/path/to/my/base/testclass
As long as I put this abstract class in the same module as my test classes, everything works fine. Then I extract the acstract class (as well as resources) into another module, compile, add to pom, etc. Result: my test implementation is working fine, but: I get an IO exception as file could not be found.
What am I missing here? Why does an abstract class work in one module, but not inside?
source share