redis.embedded.RedisRunScriptEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of embedded-redis Show documentation
Show all versions of embedded-redis Show documentation
Redis embedded server for Java integration testing
package redis.embedded;
/**
* Created by piotrturek on 22/01/15.
*/
enum RedisRunScriptEnum {
WINDOWS_64("redis-server.exe"),
UNIX("redis-server"),
MACOSX("redis-server.app");
private final String runScript;
private RedisRunScriptEnum(String runScript) {
this.runScript = runScript;
}
public static String getRedisRunScript() {
String osName = System.getProperty("os.name").toLowerCase();
String osArch = System.getProperty("os.arch").toLowerCase();
if (osName.contains("win") && osArch.contains("64")) {
return WINDOWS_64.runScript;
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
return UNIX.runScript;
} else if ("Mac OS X".equalsIgnoreCase(osName)) {
return MACOSX.runScript;
} else {
throw new RuntimeException("Unsupported os/architecture...: " + osName + " on " + osArch);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy