1 Reply Latest reply on Jan 11, 2016 7:24 AM by Bartosz Majsak

    Best way to handle filereading in test

    Ole Kozaczenko Newbie

      Hey guys,

       

      I am facing this problem: I have a service, which fetches a list of files on a mounted NFS, so from an application servers point of view from a local directory. What is the best way to test this in an Arquillian test? I tried

              archive.addAsWebResource("master_fte.csv", "/testdata/");

      but no data is found (I think b/c the files end up in a war). The path where to log for files is from a configuration file, so I have to use this certain path. When I try to save files to that certain path to read them out again, it is not possible to create directories and file:

       

              File file = new File("/testdata/test.csv");

              file.mkdirs(); //(false)

              file.createNewFile(); //(false)

       

      What is the right way to do that?

       

      Thanks in advance for any help!