mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Allow for emulated Preferences in testing.
This commit is contained in:
@@ -129,6 +129,14 @@ public class Preferences {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For testing, pretend to load preferences without a real file.
|
||||
*/
|
||||
static public void skipInit() {
|
||||
initalized = true;
|
||||
}
|
||||
|
||||
|
||||
static void handleProxy(String protocol, String hostProp, String portProp) {
|
||||
String proxyHost = get("proxy." + protocol + ".host");
|
||||
String proxyPort = get("proxy." + protocol + ".port");
|
||||
|
||||
@@ -17,7 +17,7 @@ public class ProcessingTestUtil {
|
||||
static void init() {
|
||||
// noop; just causes class to be loaded
|
||||
}
|
||||
|
||||
|
||||
private static final String RESOURCES = "test/resources/";
|
||||
private static final String RESOURCES_UP_DIR = "../java/test/resources";
|
||||
static final UTCompiler COMPILER;
|
||||
@@ -64,9 +64,10 @@ public class ProcessingTestUtil {
|
||||
|
||||
return normalize(out);
|
||||
}
|
||||
|
||||
|
||||
static String format(final File resource)
|
||||
{
|
||||
Preferences.skipInit();
|
||||
return format(read(resource));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user