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


Java DeviceSelectorBuilder.build方法代碼示例

本文整理匯總了Java中com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder.build方法的典型用法代碼示例。如果您正苦於以下問題:Java DeviceSelectorBuilder.build方法的具體用法?Java DeviceSelectorBuilder.build怎麽用?Java DeviceSelectorBuilder.build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder的用法示例。


在下文中一共展示了DeviceSelectorBuilder.build方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPresentDeviceFirstTestTwo

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@Test
public void getPresentDeviceFirstTestTwo() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.EMULATOR_PREFERRED)
                                                                       .screenHeight(600)
                                                                       .screenWidth(800);
    DeviceSelector deviceSelector = selectorBuilder.build();

    when(devicePoolDao.getDevices(eq(deviceSelector), eq(false))).thenReturn(deviceList);
    DeviceAllocationInformation deviceDescriptor = poolManager.allocateDevice(deviceSelector);
    String deviceId = deviceDescriptor.getDeviceId();

    doNothing().when(devicePoolDao).update(firstDevice);
    when(devicePoolDao.getDevice(eq(deviceId))).thenReturn(firstDevice);

    poolManager.releaseDevice(deviceId);

    assertCorrectDeviceFetched(FIRST_DEVICE_SERIAL_NUMBER, deviceDescriptor);
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-server,代碼行數:19,代碼來源:PoolManagerDeviceSelectionTest.java

示例2: testHasDeviceByIdAndAllocationState

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@Test
public void testHasDeviceByIdAndAllocationState() throws Exception {
    DeviceInformation deviceInformation = new DeviceInformation();
    deviceInformation.setApiLevel(TEST_API_LEVEL);
    deviceInformation.setRam(testRam[0]);

    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().ramCapacity(testRam[0])
                                                                       .targetApi(TEST_API_LEVEL);
    DeviceSelector deviceSelector = selectorBuilder.build();

    IDevice firstAddedDevice = testDevicePoolDao.addDevice(deviceInformation,
                                                           testDeviceIds[0],
                                                           testAgentIds[0],
                                                           testPasskeys[0]);

    firstAddedDevice.allocate();
    testDevicePoolDao.update(firstAddedDevice);
    assertTrue("Can't find allocated Device when it is present.",
               testDevicePoolDao.hasDevice(deviceSelector, true));
    assertFalse("Found not allocated Device when it is not present.",
                testDevicePoolDao.hasDevice(deviceSelector, false));
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-server,代碼行數:23,代碼來源:DevicePoolDaoIntegrationTest.java

示例3: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);
    setTestDevice(testDevice);
    startMainActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:9,代碼來源:ProcessRunningTest.java

示例4: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);
    setTestDevice(testDevice);

    startDiskSpaceActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:10,代碼來源:DiskSpaceTest.java

示例5: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED)
                                                                       .maxApi(19);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    try {
        initTestDevice(testDeviceSelector);
        setTestDevice(testDevice);
    } catch (NoAvailableDeviceFoundException e) {
        // Nothing to do here
    }
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:13,代碼來源:WaitForTaskUpdateTest.java

示例6: testFilterDevicesByMoreThanOneParameterWhenAvailableResultIsNotFromRequiredType

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@Test
public void testFilterDevicesByMoreThanOneParameterWhenAvailableResultIsNotFromRequiredType() throws Exception {
    DeviceSelectorBuilder deviceSelectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_ONLY)
                                                                             .isCameraAvailable(TEST_DEVICE_CAMERA_AVAILABILITY[0])
                                                                             .targetApi(TEST_DEVICE_API_LEVELS[0])
                                                                             .ramCapacity(TEST_DEVICE_RAM_VALUES[0]);
    DeviceSelector deviceSelector = deviceSelectorBuilder.build();
    List<IDevice> receivedDevices = deviceDao.filterDevices(deviceSelector, false);

    assertTrue(EMPTY_RESULT_LIST_MISMATCH_ERROR_MESSAGE, receivedDevices.isEmpty());
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-server,代碼行數:12,代碼來源:DeviceDaoSelectionIntegrationTest.java

示例7: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);

    setTestDevice(testDevice);
    startMainActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:10,代碼來源:ClearDataTest.java

示例8: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);
    setTestDevice(testDevice);

    startScrollActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:10,代碼來源:ScrollTest.java

示例9: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_ONLY)
                                                                       .maxApi(19);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    try {
        initTestDevice(testDeviceSelector);
    } catch (NoAvailableDeviceFoundException e) {
    }

    assumeNotNull(testDevice);
    setTestDevice(testDevice);
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:14,代碼來源:SetKeyguardTest.java

示例10: testGetDeviceByNonexistingOperatingSystem

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@Test(expected = NoAvailableDeviceFoundException.class)
public void testGetDeviceByNonexistingOperatingSystem() {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceOs(DeviceOs.JELLY_BEAN_4_1);
    DeviceSelector deviceSelector = selectorBuilder.build();

    builder.getDevice(deviceSelector);
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:8,代碼來源:BuilderDeviceSelectionIntegrationTest.java

示例11: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);
    setTestDevice(testDevice);

    startToastMessageActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:10,代碼來源:GetLastToastTest.java

示例12: testGetDeviceByRAM

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@Test
public void testGetDeviceByRAM() {
    int wantedRam = 513;
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().ramCapacity(wantedRam);
    DeviceSelector deviceSelector = selectorBuilder.build();

    Device receivedDevice = builder.getDevice(deviceSelector);

    DeviceInformation information = receivedDevice.getInformation();
    int realRam = information.getRam();

    assertEquals("Device RAM does not match requested RAM.", wantedRam, realRam);
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:14,代碼來源:BuilderDeviceSelectionIntegrationTest.java

示例13: getAndSetMobileDataStateOnEmulators

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
/**
 * Works only for emulators!
 */
@Test
public void getAndSetMobileDataStateOnEmulators() {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.EMULATOR_ONLY);
    DeviceSelector testDeviceSelector = selectorBuilder.build();

    testDevice = builder.getDevice(testDeviceSelector);
    assertNotNull("No emulator found.", testDevice);

    MobileDataState expectedState = MobileDataState.UNREGISTERED;
    testDevice.setMobileDataState(expectedState);
    MobileDataState actualState = testDevice.getMobileDataState();
    assertEquals("Mobile data states didn't match.", expectedState, actualState);
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:17,代碼來源:NetworkConnectionTest.java

示例14: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.EMULATOR_ONLY);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);
    setTestDevice(testDevice);
    startOrientationActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:9,代碼來源:DeviceOrientationTest.java

示例15: setUp

import com.musala.atmosphere.commons.cs.deviceselection.DeviceSelectorBuilder; //導入方法依賴的package包/類
@BeforeClass
public static void setUp() throws Exception {
    DeviceSelectorBuilder selectorBuilder = new DeviceSelectorBuilder().deviceType(DeviceType.DEVICE_PREFERRED);
    DeviceSelector testDeviceSelector = selectorBuilder.build();
    initTestDevice(testDeviceSelector);
    setTestDevice(testDevice);

    startDetectAudioTestActivity();
}
 
開發者ID:MusalaSoft,項目名稱:atmosphere-integration-tests,代碼行數:10,代碼來源:DetectAudioTest.java


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