Skip to content
Snippets Groups Projects
Commit 05f4f196 authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

removed duplicate code

parent 2d37bab4
No related branches found
No related tags found
No related merge requests found
......@@ -38,5 +38,4 @@ final class AlgorithmHelper {
return o;
}
}
......@@ -72,13 +72,7 @@ public class AlgorithmTest {
}
private static void runDefault(final Class<? extends Isochrone> algorithmClass, final boolean expireNodes) {
LOGGER.info("Executing \"" + algorithmClass.getSimpleName() + "\" (with default test parameters)");
final TestParameters params = getParamsDefault();
long startTime = Calendar.getInstance().getTimeInMillis();
AlgorithmHelper.run(algorithmClass, params, expireNodes);
long runTime = Calendar.getInstance().getTimeInMillis() - startTime;
LOGGER.info(" - runtime: \"" + params.getRuntime() + "\": " + runTime + "msec");
LOGGER.info("-----------------------------");
run(algorithmClass, getParamsDefault(), expireNodes);
}
private static void runLocal(final Class<? extends Isochrone> algorithmClass) {
......@@ -86,12 +80,16 @@ public class AlgorithmTest {
}
private static void runLocal(final Class<? extends Isochrone> algorithmClass, final boolean expireNodes) {
LOGGER.info("Executing \"" + algorithmClass.getSimpleName() + "\" (with local test parameters)");
final TestParameters params = getParamsLocal();
run(algorithmClass, getParamsLocal(), expireNodes);
}
private static void run(final Class<? extends Isochrone> algorithmClass, final TestParameters params, final boolean expireNodes) {
LOGGER.info("Executing \"" + algorithmClass.getSimpleName() + "\"");
long startTime = Calendar.getInstance().getTimeInMillis();
AlgorithmHelper.run(algorithmClass, params, expireNodes);
long runTime = Calendar.getInstance().getTimeInMillis() - startTime;
LOGGER.info(" - runtime: \"" + params.getRuntime() + "\": " + runTime + "msec");
LOGGER.info("-----------------------------");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment