當前位置: 首頁>>代碼示例>>Java>>正文


Java ShadowLog.getLogsForTag方法代碼示例

本文整理匯總了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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:andrewlord1990,項目名稱:SnackbarBuilder,代碼行數:9,代碼來源:SnackbarCallbackTest.java

示例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");
}
 
開發者ID:stephanenicolas,項目名稱:loglifecycle,代碼行數:12,代碼來源:LogLifeCycleProcessorTest.java

示例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");
}
 
開發者ID:stephanenicolas,項目名稱:loglifecycle,代碼行數:10,代碼來源:LogLifeCycleProcessorTest.java

示例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");
}
 
開發者ID:stephanenicolas,項目名稱:loglifecycle,代碼行數:9,代碼來源:LogLifeCycleProcessorTest.java

示例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");
}
 
開發者ID:stephanenicolas,項目名稱:loglifecycle,代碼行數:11,代碼來源:LogLifeCycleProcessorTest.java


注:本文中的org.robolectric.shadows.ShadowLog.getLogsForTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。