0

I am migrating some tests from instrumentation to unit-tests ( the new ones that came with 1.1 ) - And now I am facing the problem that I find no way to supply the tests with files ( data that I need to test if it gets parsed correctly ) Anyone knows a way to do this? Unfortunately for the android asset stuff I have no context and this also does not work:

getClass().getClassLoader().getResource("src.sgf")

The above is null with the file in:

src/test/assets/src.sgf

Interestingly AndroidStudio recognizes the asset - when I control click on the src.sgf in the code it brings me to the right file.

ligi
  • 39,001
  • 44
  • 144
  • 244

1 Answers1

1

As far as I understand you are looking for resources being accessible from your unit-tests environment.

It is an official issue of android build tools gradle plugin version 1.1.

You can find work around for this issue in this following thread Test resources not found from unit test

Tom Koptel
  • 309
  • 1
  • 9