[Test] Don't generate throws Exception on methods of generated tests
This is needed to reduce the size of generated test files, which started to exceed default IDE limit Also update some (mostly old) test utilities to remove exceptions from java signatures
This commit is contained in:
committed by
Space Team
parent
7ad371b215
commit
9b5a9ccba8
+11
-6
@@ -84,7 +84,7 @@ public class KtTestUtil {
|
||||
return doLoadFile(new File(fullName));
|
||||
}
|
||||
|
||||
public static String doLoadFile(@NotNull File file) throws IOException {
|
||||
public static String doLoadFile(@NotNull File file) {
|
||||
try {
|
||||
return FileUtil.loadFile(file, CharsetToolkit.UTF8, true);
|
||||
}
|
||||
@@ -94,11 +94,16 @@ public class KtTestUtil {
|
||||
* This clarifies the exception by showing the full path.
|
||||
*/
|
||||
String messageWithFullPath = file.getAbsolutePath() + " (No such file or directory)";
|
||||
throw new IOException(
|
||||
"Ensure you have your 'Working Directory' configured correctly as the root " +
|
||||
"Kotlin project directory in your test configuration\n\t" +
|
||||
messageWithFullPath,
|
||||
fileNotFoundException);
|
||||
throw new RuntimeException(
|
||||
new IOException(
|
||||
"Ensure you have your 'Working Directory' configured correctly as the root " +
|
||||
"Kotlin project directory in your test configuration\n\t" +
|
||||
messageWithFullPath,
|
||||
fileNotFoundException
|
||||
)
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user