Created
November 22, 2010 00:02
-
-
Save xian/709314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pivotallabs; | |
import android.util.Log; | |
import com.xtremelabs.robolectric.Robolectric; | |
import com.xtremelabs.robolectric.RobolectricTestRunner; | |
import com.xtremelabs.robolectric.util.Implements; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
@RunWith(RobolectricTestRunner.class) | |
public class LogTest { | |
@Test | |
public void testLogging() throws Exception { | |
Robolectric.bindShadowClass(ShadowLog.class); | |
Log.i("LogTest", "log message"); | |
} | |
@Implements(Log.class) | |
public static class ShadowLog { | |
public static int i(java.lang.String tag, java.lang.String msg) { | |
System.out.println("[" + tag + "] " + msg); | |
return 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment