Java Code Examples for com.linkedin.android.testbutler.TestButler#setWifiState()
The following examples show how to use
com.linkedin.android.testbutler.TestButler#setWifiState() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CarretoVersionProviderTest.java From force-update with Apache License 2.0 | 6 votes |
@Test @SdkSuppress(minSdkVersion=19) public void loadVersionOffline() throws Exception { CarretoGooglePlayVersionProvider provider = new CarretoGooglePlayVersionProvider("com.vocabularyminer.android"); TestButler.setGsmState(false); TestButler.setWifiState(false); try { VersionResult result = provider.getVersionResult(); assertTrue(result.isError()); assertNotNull(result); assertNull(result.getVersion()); assertNotNull(result.getErrorMessage()); assertNotNull(result.getErrorException()); } finally { TestButler.setGsmState(true); TestButler.setWifiState(true); Thread.sleep(1000); } }
Example 2
Source File: JsonHttpVersionProviderTest.java From force-update with Apache License 2.0 | 6 votes |
@Test @SdkSuppress(minSdkVersion=19) public void loadVersionOffline() throws Exception { JsonHttpVersionProvider provider = new JsonHttpVersionProvider("https://raw.githubusercontent.com/skoumalcz/force-update/master/force-update/src/androidTest/java/net/skoumal/forceupdate/provider/JsonHttpVersionProviderTest.DefaultAttributes.json"); TestButler.setGsmState(false); TestButler.setWifiState(false); try { VersionResult result = provider.getVersionResult(); assertTrue(result.isError()); assertNotNull(result); assertNull(result.getVersion()); assertNull(result.getPayload()); assertNotNull(result.getErrorMessage()); assertNotNull(result.getErrorException()); } finally { TestButler.setGsmState(true); TestButler.setWifiState(true); Thread.sleep(1000); } }