diff --git a/app/src/test/java/android/util/Log.java b/app/src/test/java/android/util/Log.java deleted file mode 100644 index 7090f73cd..000000000 --- a/app/src/test/java/android/util/Log.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Nextcloud Talk - Android Client - * - * SPDX-FileCopyrightText: 2024 Daniel Calviño Sánchez - * SPDX-License-Identifier: GPL-3.0-or-later - */ -package android.util; - -/** - * Dummy implementation of android.util.Log to be used in unit tests. - *

- * The Android Gradle plugin provides a library with the APIs of the Android framework that throws an exception if any - * of them are called. This class is loaded before that library and therefore becomes the implementation used during the - * tests, simply printing the messages to the system console. - */ -public class Log { - - public static int d(String tag, String msg) { - System.out.println("DEBUG: " + tag + ": " + msg); - - return 1; - } - - public static int e(String tag, String msg) { - System.out.println("ERROR: " + tag + ": " + msg); - - return 1; - } - - public static int i(String tag, String msg) { - System.out.println("INFO: " + tag + ": " + msg); - - return 1; - } - - public static boolean isLoggable(String tag, int level) { - return true; - } - - public static int v(String tag, String msg) { - System.out.println("VERBOSE: " + tag + ": " + msg); - - return 1; - } - - public static int w(String tag, String msg) { - System.out.println("WARN: " + tag + ": " + msg); - - return 1; - } -} diff --git a/app/src/test/java/android/util/Log.kt b/app/src/test/java/android/util/Log.kt new file mode 100644 index 000000000..eee2147ad --- /dev/null +++ b/app/src/test/java/android/util/Log.kt @@ -0,0 +1,58 @@ +/* + * Nextcloud Talk - Android Client + * + * SPDX-FileCopyrightText: 2024 Daniel Calviño Sánchez + * SPDX-License-Identifier: GPL-3.0-or-later + */ +package android.util + +/** + * Dummy implementation of android.util.Log to be used in unit tests. + * + * + * The Android Gradle plugin provides a library with the APIs of the Android framework that throws an exception if any + * of them are called. This class is loaded before that library and therefore becomes the implementation used during the + * tests, simply printing the messages to the system console. + */ +object Log { + + @JvmStatic + fun d(tag: String, msg: String): Int { + println("DEBUG: $tag: $msg") + + return 1 + } + + @JvmStatic + fun e(tag: String, msg: String): Int { + println("ERROR: $tag: $msg") + + return 1 + } + + @JvmStatic + fun i(tag: String, msg: String): Int { + println("INFO: $tag: $msg") + + return 1 + } + + @JvmStatic + fun isLoggable(tag: String?, level: Int): Boolean { + return true + } + + @JvmStatic + fun v(tag: String, msg: String): Int { + println("VERBOSE: $tag: $msg") + + return 1 + } + + @JvmStatic + fun w(tag: String, msg: String): Int { + println("WARN: $tag: $msg") + + return 1 + } +}