#482 Provide better default messages and merge MessagesManager

- Return message from the JAR's messages_en.yml file instead of an unusable error for the end user
- Merge MessagesManager into Messages
This commit is contained in:
ljacqu
2016-02-11 21:27:16 +01:00
parent 2d8a80049b
commit 39168bc818
12 changed files with 271 additions and 135 deletions
@@ -0,0 +1,28 @@
package fr.xephi.authme;
import java.io.File;
import java.net.URL;
/**
* AuthMe test utilities.
*/
public final class TestHelper {
private TestHelper() {
}
/**
* Return a {@link File} to an existing file from the main (non-test) resources folder.
*
* @param path The absolute path to the file
* @return The project file
*/
public static File getJarFile(String path) {
URL url = TestHelper.class.getResource(path);
if (url == null) {
throw new IllegalStateException("File '" + path + "' could not be loaded");
}
return new File(url.getFile());
}
}