package urjc;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by nexmaniosis on 12/10/17.
 */
public class JUnitListing {

    private final String PROJECT_ABS_PATH = "/Users/nexmaniosis/Google Drive/Universidad/TestingLibs - DOCS/junit5-vanilla-maven/";
    private final String REPORTS_FOLDER = "target/surefire-reports/";

    private File reportsDirectory;

    private File[] reports_nofilter;

    private File[] reports_filter;

    private List reports_filter_name;

    /*

     */
    private void setReportsDirectory(String path){
        reportsDirectory = new File(path);
    }

    /*
        Get every file on the folder. No filter.
     */

    private void setFiles(File folder){
        reports_nofilter = folder.listFiles();
    }

    public File getReportsDirectory() {
        return reportsDirectory;
    }

    public File[] getReportsNoFilter() {
        return reports_nofilter;
    }

    /*

    */

    private void setTestList(){

        List testList = new ArrayList<String>();

        for(File f: getReportsNoFilter()){
            testList.add(extractName(f));
        }

        reports_filter_name = testList;

    }

    public List getReports_filter_name() {
        return reports_filter_name;
    }

    private String extractName(File f){
        return f.getName();
    }
}

@@ -79,16 +79,60 @@
 il.List;
+%0Aimport org.apache.commons.io.FilenameUtils;
 %0A%0A/**%0A *
@@ -230,387 +230,113 @@
 ing 
-PROJECT_ABS_PATH = %22/Users/nexmaniosis/Google Drive/Universidad/TestingLibs - DOCS/junit5-vanilla-maven/%22;%0A    private final String REPORTS_FOLDER = %22target/surefire-reports/%22;%0A%0A    private File reportsDirectory;%0A%0A    private File%5B%5D reports_nofilter;%0A%0A    private File%5B%5D reports_filter;%0A%0A    private List reports_filter_name;%0A%0A    /*%0A%0A     */%0A    private void setReportsDirectory
+REPORTS_FOLDER = %22target/surefire-reports/%22;%0A%0A    private File reportsDirectory;%0A%0A    public JUnitListing
 (Str
@@ -340,16 +340,23 @@
 String p
+rojectP
 ath)%7B%0A  
@@ -394,14 +394,39 @@
 le(p
-ath
+rojectPath + REPORTS_FOLDER
 );%0A
+%0A
     
@@ -437,160 +437,44 @@
    /
-*%0A        Get every file on the folder. No filter.%0A     */%0A%0A    private void setFiles(File folder)%7B%0A        reports_nofilter = folder.listFiles();%0A    %7D
+/ --- //%0A    // GET //%0A    // --- //
 %0A%0A  
@@ -579,25 +579,45 @@
 tReports
-NoF
+_no_f
 ilter(
+File reportsFolder
 ) %7B%0A    
@@ -638,72 +638,75 @@
 orts
-_nofilter;%0A    %7D%0A%0A    /*%0A%0A    */%0A%0A    private void setTestList
+Folder.listFiles();%0A    %7D%0A%0A    public List getReportsName_filter
 ()
+ 
 %7B%0A%0A 
@@ -774,16 +774,21 @@
 File f: 
+this.
 getRepor
@@ -793,17 +793,45 @@
 orts
-NoF
+_no_f
 ilter(
+this.getReportsDirectory()
 ))%7B%0A
@@ -841,16 +841,29 @@
         
+ if(isXML(f))
  testLis
@@ -868,16 +868,27 @@
 ist.add(
+filterName(
 extractN
@@ -894,16 +894,17 @@
 Name(f))
+)
 ;%0A      
@@ -922,87 +922,127 @@
   re
-ports_filter_name = testList;%0A%0A    %7D%0A%0A    public List getReports_filter_name() 
+turn testList;%0A    %7D%0A%0A    // ------ //%0A    // STATIC //%0A    // ------ //%0A%0A    private static String extractName(File f)
 %7B%0A  
@@ -1058,35 +1058,27 @@
 urn 
-reports_filter_n
+f.getN
 ame
+()
 ;%0A    %7D%0A
 %0A   
@@ -1069,25 +1069,24 @@
 me();%0A    %7D%0A
-%0A
     private 
@@ -1089,67 +1089,190 @@
 ate 
-String extractName(File f)%7B%0A        return f.getName();%0A   
+static Boolean isXML(File f)%7B return FilenameUtils.getExtension(f.getName()).equals(%22xml%22); %7D%0A    private static String filterName(String n)%7B return FilenameUtils.removeExtension(n);
  %7D%0A%7D

remove setters, added constructor. Added: extractName, isXML and FilterName. Finished getReportsName with XML filtering