Code example for UnknownHostException

0
  } 
 
  @Test 
  public void testDisabledLocalFailure() throws Exception { 
    client.delete = Response.SOFT_FAILURE;
    client.exception = new UnknownHostException();
 
    policy = new SubmissionPolicy(sharedPrefs, client, tracker, false);
    setMinimumTimeBetweenUploads(policy.getMinimumTimeBetweenUploads() - 1);
    ExtendedJSONObject ids = new ExtendedJSONObject();
    ids.put("id1", 5L);
    ids.put("id2", 3L);
    tracker.setObsoleteIds(ids);
 
    assertTrue(policy.tick(3));
    // The upload fails locally, so we shouldn't decrement attempts remaining. 
    assertEquals(ids, tracker.getObsoleteIds());
  } 
 
  @Test 
  public void testUploadFailureCountResetAfterOneDay() throws Exception {