vendredi 6 mai 2016

nosqlunit annotation @UsingDataSet location

I've written this test

    @Test
    @UsingDataSet(locations = {"dataset.json"}, loadStrategy= LoadStrategyEnum.CLEAN_INSERT)
    public void readAndupdateTemplate(){

        ..............

    }

And my root project has the following structure

app
 |
 |_ _ src
       |_ _ main
       |      |_ _ java
       |      |    ......(my packages)
       |      |_ _ resources
       |
       |_ _ test
              |_ _java
              |   .....(my test packages)
              |_ _resources

Class's test written above is in app/src/test/java and my dataset.json in app/src/test/resource

When I try to run this test I get this error

java.lang.IllegalArgumentException: File specified in locations property are not present in classpath, or no files matching default name are found. Valid default locations are: /xx/xxxxxxxxx/xxxxxxxxxx/service/TemplateServiceTest.json or /xx/xxxxxxxxx/xxxxxxxxxx/service/TemplateServiceTest#readAndupdateTemplate.json

Aucun commentaire:

Enregistrer un commentaire