本文整理匯總了Java中org.robolectric.shadows.ShadowLog.getLogsForTag方法的典型用法代碼示例。如果您正苦於以下問題:Java ShadowLog.getLogsForTag方法的具體用法?Java ShadowLog.getLogsForTag怎麽用?Java ShadowLog.getLogsForTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.robolectric.shadows.ShadowLog
的用法示例。
在下文中一共展示了ShadowLog.getLogsForTag方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: whenOnSnackbarShown_twhenSnackbarShownMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarShown_twhenSnackbarShownMessageLogged() {
callbackUnderTest.onSnackbarShown(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarShown");
}
示例2: whenOnSnackbarDismissed_thenSnackbarDismissedMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarDismissed_thenSnackbarDismissedMessageLogged() {
callbackUnderTest.onSnackbarDismissed(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarDismissed");
}
示例3: whenOnSnackbarDismissedWithEventType_thenSnackbarDismissedMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarDismissedWithEventType_thenSnackbarDismissedMessageLogged() {
callbackUnderTest.onSnackbarDismissed(snackbar, Callback.DISMISS_EVENT_TIMEOUT);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarDismissed method = 2");
}
示例4: whenOnSnackbarActionPressed_thenSnackbarActionPressedMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarActionPressed_thenSnackbarActionPressedMessageLogged() {
callbackUnderTest.onSnackbarActionPressed(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarActionPressed");
}
示例5: whenOnSnackbarSwiped_thenSnackbarSwipedMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarSwiped_thenSnackbarSwipedMessageLogged() {
callbackUnderTest.onSnackbarSwiped(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarSwiped");
}
示例6: whenOnSnackbarTimedOut_thenSnackbarTimedOutMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarTimedOut_thenSnackbarTimedOutMessageLogged() {
callbackUnderTest.onSnackbarTimedOut(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarTimedOut");
}
示例7: whenOnSnackbarManuallyDismissed_thenSnackbarManuallyDismissedMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarManuallyDismissed_thenSnackbarManuallyDismissedMessageLogged() {
callbackUnderTest.onSnackbarManuallyDismissed(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarManuallyDismissed");
}
示例8: whenOnSnackbarDismissedAfterAnotherShown_thenSnackbarDismissedAfterAnotherShownMessageLogged
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void whenOnSnackbarDismissedAfterAnotherShown_thenSnackbarDismissedAfterAnotherShownMessageLogged() {
callbackUnderTest.onSnackbarDismissedAfterAnotherShown(snackbar);
List<LogItem> logs = ShadowLog.getLogsForTag(SnackbarCallback.class.getSimpleName());
assertThat(logs).hasSize(1);
assertThat(logs.get(0).msg).isEqualTo("onSnackbarDismissedAfterAnotherShown");
}
示例9: shouldLog_activity
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void shouldLog_activity() {
Robolectric.buildActivity(TestActivity.class).create().start().stop().destroy().get();
List<ShadowLog.LogItem> logItems = ShadowLog.getLogsForTag("LogLifeCycle");
assertNotNull(logItems);
assertLogContainsMessage(logItems, "onCreate");
assertLogContainsMessage(logItems, "onStart");
assertLogContainsMessage(logItems, "onStop");
assertLogContainsMessage(logItems, "onDestroy");
}
示例10: shouldLog_fragment
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void shouldLog_fragment() {
Robolectric.buildActivity(TestActivityWitFragment.class).create().start().stop().destroy().get();
List<ShadowLog.LogItem> logItems = ShadowLog.getLogsForTag("LogLifeCycle");
assertNotNull(logItems);
assertLogContainsMessage(logItems, "onStart");
assertLogContainsMessage(logItems, "onStop");
}
示例11: shouldLog_View
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void shouldLog_View() {
Robolectric.buildActivity(TestActivityWitView.class).create().start().get();
List<ShadowLog.LogItem> logItems = ShadowLog.getLogsForTag("LogLifeCycle");
assertNotNull(logItems);
assertLogContainsMessage(logItems, "onFinishInflate");
}
示例12: shouldLog_Service
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Test
public void shouldLog_Service() {
Robolectric.buildService(TestService.class).attach().create().withIntent(null).startCommand(0,1).destroy().get();
List<ShadowLog.LogItem> logItems = ShadowLog.getLogsForTag("LogLifeCycle");
assertNotNull(logItems);
assertLogContainsMessage(logItems, "onCreate");
assertLogContainsMessage(logItems, "onStart");
assertLogContainsMessage(logItems, "onDestroy");
}