1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.server.bluetooth.test 17 18 import com.android.server.bluetooth.Log 19 import org.junit.Test 20 import org.junit.runner.RunWith 21 import org.robolectric.RobolectricTestRunner 22 23 private const val TAG: String = "LogTest" 24 25 @RunWith(RobolectricTestRunner::class) 26 class LogTest { 27 @Test log_verbosenull28 fun log_verbose() { 29 Log.v(TAG, "Logging verbose") 30 } 31 32 @Test log_debugnull33 fun log_debug() { 34 Log.d(TAG, "Logging debug") 35 } 36 37 @Test log_infonull38 fun log_info() { 39 Log.i(TAG, "Logging info") 40 } 41 42 @Test log_warningnull43 fun log_warning() { 44 Log.w(TAG, "Logging warning") 45 } 46 47 @Test log_warningThrowablenull48 fun log_warningThrowable() { 49 Log.w(TAG, "Logging warning", RuntimeException("With a Throwable")) 50 } 51 52 @Test log_errornull53 fun log_error() { 54 Log.e(TAG, "Logging error") 55 } 56 57 @Test log_errorThrowablenull58 fun log_errorThrowable() { 59 Log.e(TAG, "Logging error… ", RuntimeException("With a Throwable")) 60 } 61 } 62