Android JUnit testing with files -


i have lot of files required junit testing don't want include in app when downloaded (a lot of them bitmaps take space). files stored in assets folder. there directory can put files in won't included when app downloaded?

we have similar situation.

create new java library , place files need in tests under src/main/resources. don't use src/test/resources or won't have visibility of files.

then import module part of test dependencies.

testcompile project(':files-module') // java modules 

or

androidtestcompile project(':files-module') // android modules 

you should able gain access files through getresourceasstream("/" + filename)

because module used dependency in tests nothing included in production code.


Comments

Popular posts from this blog

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

java - Unable to make sub reports with Jasper -

Integrity error when loading fixtures for Selenium testing in Django -