You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/19 04:33:16 UTC

[13/50] [abbrv] incubator-weex git commit: * [android] add test case

* [android] add test case


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c9b5c45f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c9b5c45f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c9b5c45f

Branch: refs/heads/release
Commit: c9b5c45fbaf6c9540f2501b2716aa68f2c5d8c16
Parents: b512647
Author: zshshr <zh...@gmail.com>
Authored: Tue Oct 17 11:50:08 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Tue Oct 17 11:50:08 2017 +0800

----------------------------------------------------------------------
 .../java/com/taobao/weex/utils/WXLogUtilsTest.java  | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c9b5c45f/android/sdk/src/test/java/com/taobao/weex/utils/WXLogUtilsTest.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/test/java/com/taobao/weex/utils/WXLogUtilsTest.java b/android/sdk/src/test/java/com/taobao/weex/utils/WXLogUtilsTest.java
index 3fde10a..e249c1c 100644
--- a/android/sdk/src/test/java/com/taobao/weex/utils/WXLogUtilsTest.java
+++ b/android/sdk/src/test/java/com/taobao/weex/utils/WXLogUtilsTest.java
@@ -20,6 +20,7 @@ package com.taobao.weex.utils;
 
 import com.taobao.weappplus_sdk.BuildConfig;
 import com.taobao.weex.WXEnvironment;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -91,4 +92,17 @@ public class WXLogUtilsTest {
     Log.e("tag",new Throwable("test"));
   }
 
-}
+  @Test
+  public void testLogLevel() throws Exception {
+    WXEnvironment.sLogLevel = LogLevel.DEBUG;
+    Log.d("LogLevel.DEBUG", "test debug");
+    Log.w("LogLevel.DEBUG", "test warning");
+    Log.e("LogLevel.DEBUG", "test error");
+
+    WXEnvironment.sLogLevel = LogLevel.WARN;
+
+    Log.d("LogLevel.WARN", "test debug");
+    Log.w("LogLevel.WARN", "test warning");
+    Log.e("LogLevel.WARN", "test error");
+  }
+  }