本文整理汇总了Java中android.test.MoreAsserts.assertEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java MoreAsserts.assertEmpty方法的具体用法?Java MoreAsserts.assertEmpty怎么用?Java MoreAsserts.assertEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.test.MoreAsserts
的用法示例。
在下文中一共展示了MoreAsserts.assertEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetConflictingSchedules_noConflict
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_noConflict() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 0L, 200L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 0L, 100L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 100L, 200L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 0L, 100L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 100L, 200L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
}
示例2: testGetConflictingSchedules_conflict2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_conflict2() {
// The case when there is a long schedule.
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 1000L);
schedules.add(r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r3);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
}
示例3: testGetConflictingSchedulesForWatching_otherChannels
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_otherChannels() {
// The other channels are to be recorded.
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r2);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 3));
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2), r1);
}
示例4: testGetConflictingSchedulesForWatching_sameChannel1
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_sameChannel1() {
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r2);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2));
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 1), r2);
}
示例5: testGetConflictingSchedulesForWatching_sameChannel2
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForWatching_sameChannel2() {
long priority = 0;
long channelToWatch = 1;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
channelToWatch, ++priority, 0L, 200L);
schedules.add(r2);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 2));
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedulesForWatching(
INPUT_ID, channelToWatch, 0L, ++priority, schedules, 1), r1);
}
示例6: testGetConflictingSchedules_noTuner
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_noTuner() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 0));
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 0L, 200L));
assertEquals(schedules, DvrScheduleManager.getConflictingSchedules(schedules, 0));
schedules.add(0, RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(++channelId,
++priority, 0L, 100L));
assertEquals(schedules, DvrScheduleManager.getConflictingSchedules(schedules, 0));
}
示例7: testGetConflictingSchedules_sameChannel
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_sameChannel() {
long priority = 0;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(channelId,
++priority, 0L, 200L));
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(channelId,
++priority, 0L, 200L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
}
示例8: testGetConflictingSchedulesForTune_canTune
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedulesForTune_canTune() {
// Can tune to the recorded channel if tuner count is 1.
long priority = 0;
long channelId = 1;
List<ScheduledRecording> schedules = new ArrayList<>();
schedules.add(RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(channelId,
++priority, 0L, 200L));
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedulesForTune(INPUT_ID,
channelId, 0L, priority + 1, schedules, 1));
}
示例9: testRequest
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testRequest() throws Exception {
withHttpRequestThrowing(new IOException("arbitrary"));
try {
mProvider.getNetworkTime();
} catch (Exception expected) {}
ArgumentCaptor<HttpUriRequest> requestCaptor = ArgumentCaptor.forClass(HttpUriRequest.class);
verify(mMockHttpClient).execute(requestCaptor.capture());
HttpUriRequest request = requestCaptor.getValue();
assertEquals("HEAD", request.getMethod());
assertEquals("https://www.google.com", request.getURI().toString());
MoreAsserts.assertEmpty(Arrays.asList(request.getAllHeaders()));
}
示例10: checkBadAccountSetup
import android.test.MoreAsserts; //导入方法依赖的package包/类
private void checkBadAccountSetup(String uri, int dialogId) throws Throwable {
getActivity();
callOnActivityResultOnUiThreadWithScannedUri(uri);
List<String> accountNames = new ArrayList<String>();
mAccountDb.getNames(accountNames);
MoreAsserts.assertEmpty(accountNames);
TestUtilities.assertDialogWasDisplayed(getActivity(), dialogId);
assertFalse(getActivity().isFinishing()); // AuthenticatorActivity should continue
}
示例11: testAccountSetup_withNullIntent
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testAccountSetup_withNullIntent() throws Throwable {
getActivity();
callOnActivityResultOnUiThread(AuthenticatorActivity.SCAN_REQUEST, Activity.RESULT_OK, null);
List<String> accountNames = new ArrayList<String>();
mAccountDb.getNames(accountNames);
MoreAsserts.assertEmpty(accountNames);
TestUtilities.assertDialogWasDisplayed(getActivity(), Utilities.INVALID_QR_CODE);
assertFalse(getActivity().isFinishing()); // AuthenticatorActivity should continue
}
示例12: testGetConflictingSchedules_emptySchedule
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_emptySchedule() {
List<ScheduledRecording> schedules = new ArrayList<>();
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
}
示例13: testGetConflictingSchedules_conflict
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_conflict() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r3);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
ScheduledRecording r4 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(r4);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
ScheduledRecording r5 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(r5);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
ScheduledRecording r6 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 10L, 90L);
schedules.add(r6);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));
ScheduledRecording r7 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 110L, 190L);
schedules.add(r7);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r5, r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));
ScheduledRecording r8 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 50L, 150L);
schedules.add(r8);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r7, r6, r5, r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r5, r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 4),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 5));
}
示例14: testGetConflictingSchedules_reverseOrder
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testGetConflictingSchedules_reverseOrder() {
long priority = 0;
long channelId = 0;
List<ScheduledRecording> schedules = new ArrayList<>();
ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 200L);
schedules.add(0, r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 1));
ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(0, r2);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(0, r3);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 2));
ScheduledRecording r4 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 0L, 100L);
schedules.add(0, r4);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
ScheduledRecording r5 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 100L, 200L);
schedules.add(0, r5);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 3));
ScheduledRecording r6 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 10L, 90L);
schedules.add(0, r6);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));
ScheduledRecording r7 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 110L, 190L);
schedules.add(0, r7);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r5, r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 4));
ScheduledRecording r8 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod(
++channelId, ++priority, 50L, 150L);
schedules.add(0, r8);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 1),
r7, r6, r5, r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 2),
r5, r4, r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 3),
r3, r2, r1);
MoreAsserts.assertContentsInOrder(DvrScheduleManager.getConflictingSchedules(schedules, 4),
r1);
MoreAsserts.assertEmpty(DvrScheduleManager.getConflictingSchedules(schedules, 5));
}
示例15: testEnumerateAccountsNoRecords
import android.test.MoreAsserts; //导入方法依赖的package包/类
public void testEnumerateAccountsNoRecords() throws Exception {
assertEquals(0, otpProvider.enumerateAccounts(result));
MoreAsserts.assertEmpty(result);
}