0

I build a tool to generate RandomTestData, you can find it here RandomTestData

But their is a big problem. If I run a Junit Test inside the project, I have to put the .txt files in src/main/test/resources so that the DataHolder find the files. And if I use this as a jar inside another Project, I have the same problem that the Dataholder can not find the files.

I tried the solution in this Thread but this doesn't work either. Can anyone help me with this?

Christian
  • 1,022
  • 13
  • 28
  • `Class#getResource` is the correct method - why it doesn't work for you could come down to any number of common issues; using the wrong path; missing resource (not been included in the Jar at build time) – MadProgrammer Jun 23 '18 at 09:09

1 Answers1

0

so Class#getReource is the write Methode do load a resource. But the resource best is in the same folder as the class. So you have to build the same package structure in the resource folder like the package structure for your class files.

Christian
  • 1,022
  • 13
  • 28