/** * Tests that {@link AdHocReportDownloadHelper#getReportDownloadTimeout()} retrieves the global * timeout if not set on the helper. */ @Test public void testGetReportDownloadTimeout() { assertEquals( AdWordsInternals.getInstance().getAdWordsLibConfiguration().getReportDownloadTimeout(), helper.getReportDownloadTimeout()); }
/** * Tests that {@link AdHocReportDownloadHelper#setReportDownloadTimeout(int)} sets the * helper-specific timeout and does not affect the global timeout. */ @Test public void testSetReportDownloadTimeout() { int internalsTimeout = AdWordsInternals.getInstance().getAdWordsLibConfiguration().getReportDownloadTimeout(); assertEquals(internalsTimeout, helper.getReportDownloadTimeout()); int helperTimeout = internalsTimeout + 10; helper.setReportDownloadTimeout(helperTimeout); assertEquals("Timeout on helper does not reflect changes made via setReportDownloadTimeout", helperTimeout, helper.getReportDownloadTimeout()); assertEquals("Setting the timeout on a helper instance modified the global timeout", internalsTimeout, AdWordsInternals.getInstance().getAdWordsLibConfiguration().getReportDownloadTimeout()); }