我正在尝试运行一个调用多个文件的文件,但我遇到了一些错误。
在名为day4Measurement的当前目录中,我有 13 个文件:BuggyMeasurement.java、BuggyMeasurement01.java、BuggyMeasurement02.java、BuggyMeasurement03.java、BuggyMeasurement04.java...BuggyMeasurement10.java、MeasurementTest.java 和 Measurement.java。
Measurement.java包含main()并调用所有其他文件。
这是main():
public static void main(String [] args){
JUnitCore tester = new JUnitCore();
String s = "Failed to detect: ";
int count = 0;
String [] tests = {"toString prints reverse inches then feet", // 01
"plus modifies this", // 02
"minus modifies this", // 03
"multiple modifies this", // 04
"plus incorrect roll over", // 05
"minus incorrect roll over", // 06
"multiple incorrect roll over", // 07
"plus incorrect non-roll over", // 08
"minus incorrect non-roll over", // 09
"multiple incorrect non-roll over", // 10
"CORRRRECTTT!!!"
};
for (int i = 1; i < tests.length + 1; i++){
testRound = i;
System.out.println("Running: " + tests[i-1]);
TestRunner.run(day4Measurement.MeasurementTest.class);
Result temp = tester.run(day4Measurement.MeasurementTest.class);
if (temp.wasSuccessful()) {
s += tests[i-1] + "; ";
count++;
}
}
System.out.print(10-(count-1)*0.5 + " ");
System.out.println(s);
}
在 Mac 终端中,我运行
javac Measurement.java
我遇到了问题。这是我得到的:
有什么建议么?