Skip to content

Commit e9d8db9

Browse files
committed
start using the commandline
1 parent 1575e9d commit e9d8db9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/main/java/edu/rit/se/testsmells/Main.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package edu.rit.se.testsmells;
22

33
import java.io.BufferedReader;
4+
import java.io.File;
45
import java.io.FileReader;
56
import java.io.IOException;
67
import java.util.ArrayList;
@@ -11,10 +12,23 @@ public class Main {
1112
static List<TestFile> testFiles;
1213

1314
public static void main(String[] args) throws IOException {
15+
if (args == null) {
16+
System.out.println("Please provide the file containing the paths to the collection of test files");
17+
return;
18+
}
19+
if(!args[0].isEmpty()){
20+
File inputFile = new File(args[0]);
21+
if(!inputFile.exists() || inputFile.isDirectory()) {
22+
System.out.println("Please provide a valid file containing the paths to the collection of test files");
23+
return;
24+
}
25+
}
26+
27+
1428
System.out.println("Started!");
1529

1630
MappingDetector mappingDetector;
17-
BufferedReader in = new BufferedReader(new FileReader("F:\\Projects\\TestFileMapping\\detected_testFile.csv"));
31+
BufferedReader in = new BufferedReader(new FileReader(args[0]));
1832
String str;
1933

2034
testFiles = new ArrayList<>();

0 commit comments

Comments
 (0)