@@ -12,13 +12,14 @@ public class Main {
1212 static List <TestFile > testFiles ;
1313
1414 public static void main (String [] args ) throws IOException {
15- if (args == null ) {
15+ if (args == null || args . length == 0 ) {
1616 System .out .println ("Please provide the file containing the paths to the collection of test files" );
1717 return ;
1818 }
19- if (!args [0 ].isEmpty ()){
19+
20+ if (!args [0 ].isEmpty ()) {
2021 File inputFile = new File (args [0 ]);
21- if (!inputFile .exists () || inputFile .isDirectory ()) {
22+ if (!inputFile .exists () || inputFile .isDirectory ()) {
2223 System .out .println ("Please provide a valid file containing the paths to the collection of test files" );
2324 return ;
2425 }
@@ -35,31 +36,23 @@ public static void main(String[] args) throws IOException {
3536
3637 System .out .println ("Reading input." );
3738 while ((str = in .readLine ()) != null ) {
38- System .out .println ("Detecting: " + str );
39+ System .out .println ("Detecting: " + str );
3940 mappingDetector = new MappingDetector ();
4041 testFiles .add (mappingDetector .detectMapping (str ));
4142 }
4243
43- System .out .println ("Saving results. Total lines:" + testFiles .size ());
44+ System .out .println ("Saving results. Total lines:" + testFiles .size ());
4445 ResultsWriter resultsWriter = ResultsWriter .createResultsWriter ();
4546 List <String > columnNames = new ArrayList <>();
4647 List <String > columnValues = null ;
47- columnNames .add (0 ,"App" );
48- columnNames .add (1 ,"Tag" );
49- columnNames .add (2 ,"TestFilePath" );
50- columnNames .add (3 ,"ProductionFilePath" );
51- columnNames .add (4 ,"RelativeTestFilePath" );
52- columnNames .add (5 ,"RelativeProductionFilePath" );
48+ columnNames .add (0 , "TestFilePath" );
49+ columnNames .add (1 , "ProductionFilePath" );
5350 resultsWriter .writeColumnName (columnNames );
5451
5552 for (int i = 0 ; i < testFiles .size (); i ++) {
5653 columnValues = new ArrayList <>();
57- columnValues .add (0 ,testFiles .get (i ).getAppName ());
58- columnValues .add (1 ,testFiles .get (i ).getTagName ());
59- columnValues .add (2 ,testFiles .get (i ).getFilePath ());
60- columnValues .add (3 ,testFiles .get (i ).getProductionFilePath ());
61- columnValues .add (4 ,testFiles .get (i ).getRelativeTestFilePath ());
62- columnValues .add (5 ,testFiles .get (i ).getRelativeProductionFilePath ());
54+ columnValues .add (0 , testFiles .get (i ).getTestFilePath ());
55+ columnValues .add (1 , testFiles .get (i ).getProductionFilePath ());
6356 resultsWriter .writeLine (columnValues );
6457 }
6558
0 commit comments