2323import org .junit .Assert ;
2424import org .junit .Test ;
2525import org .junit .experimental .categories .Category ;
26+ import org .labkey .api .util .FileUtil ;
2627import org .labkey .remoteapi .CommandException ;
2728import org .labkey .remoteapi .Connection ;
2829import org .labkey .remoteapi .query .Filter ;
@@ -295,13 +296,22 @@ private void createIlluminaSampleSheet()
295296 assertTextPresent (fileSearcher , prop_name + "," + prop_value );
296297
297298 File fileRoot = TestFileUtils .getDefaultFileRoot (getProjectName ());
298- File importTemplate = new File (fileRoot , ILLUMINA_CSV );
299+ File importTemplate = FileUtil . appendName (fileRoot , ILLUMINA_CSV );
299300 if (importTemplate .exists ())
300301 importTemplate .delete ();
301302
302303
303304 //NOTE: use the text generated directly using JS
304- TestFileUtils .saveFile (importTemplate .getParentFile (), importTemplate .getName (), outputTable );
305+ File tsvFile = FileUtil .appendName (importTemplate .getParentFile (), importTemplate .getName ());
306+
307+ try
308+ {
309+ TestFileUtils .writeFile (tsvFile , outputTable );
310+ }
311+ catch (IOException e )
312+ {
313+ e .printStackTrace (System .err );
314+ }
305315 goToProjectHome ();
306316 }
307317
@@ -330,7 +340,7 @@ private void importIlluminaTest() throws Exception
330340 File fileRoot = TestFileUtils .getDefaultFileRoot (getProjectName ());
331341 for (String fn : Arrays .asList ("Illumina-F.fastq.gz" , "Illumina-R.fastq.gz" , "SkipMe.fastq.gz" ))
332342 {
333- File target = new File (fileRoot , fn );
343+ File target = FileUtil . appendName (fileRoot , fn );
334344 if (target .exists ())
335345 {
336346 target .delete ();
@@ -749,7 +759,7 @@ private void alignmentImportPanelTest(boolean sequencePipelineEnabled) throws Ex
749759 File fileRoot = TestFileUtils .getDefaultFileRoot (getProjectName ());
750760 log ("file root: " + fileRoot .getPath ());
751761
752- File inputBam = new File (fileRoot , "test.bam" );
762+ File inputBam = FileUtil . appendName (fileRoot , "test.bam" );
753763 File inputBamIdx = new File (inputBam .getPath () + ".bai" );
754764 if (inputBam .exists ())
755765 {
@@ -763,8 +773,8 @@ private void alignmentImportPanelTest(boolean sequencePipelineEnabled) throws Ex
763773 inputBamIdx .delete ();
764774 }
765775
766- FileUtils .copyFile (new File (_sampleData , "test.bam" ), inputBam );
767- FileUtils .copyFile (new File (_sampleData , "test.bam.bai" ), inputBamIdx );
776+ FileUtils .copyFile (FileUtil . appendName (_sampleData , "test.bam" ), inputBam );
777+ FileUtils .copyFile (FileUtil . appendName (_sampleData , "test.bam.bai" ), inputBamIdx );
768778
769779 _helper .initiatePipelineJob (_alignmentImportPipelineName , List .of (inputBam .getName ()), getProjectName ());
770780 waitForText ("Job Name" );
0 commit comments