fix for previous commit, formatting was fixed to pass on CI

This commit is contained in:
Roman Ivanov 2014-06-30 08:04:58 -07:00
parent a25d3f86b3
commit ec5630294a
1 changed files with 29 additions and 21 deletions

View File

@ -57,28 +57,36 @@ public class SuppressionsLoaderTest
}
@Test
public void testLoadFromURL() throws CheckstyleException, InterruptedException
public void testLoadFromURL()
throws CheckstyleException, InterruptedException
{
FilterSet fc = null;
int attemptCount = 0;
while (attemptCount < 5)
try{
fc = SuppressionsLoader.loadSuppressions("http://checkstyle.sourceforge.net/files/suppressions_none.xml");
break;
} catch (CheckstyleException ex) {
// for some reason Travis CI failed some times(unstable) on reading this file
if (ex.getMessage().contains("unable to read")) {
attemptCount++;
// wait for bad/disconnection time to pass
Thread.sleep(1000);
} else {
throw ex;
}
}
FilterSet fc = null;
int attemptCount = 0;
final int attemptLimit = 5;
while (attemptCount <= attemptLimit) {
try {
fc = SuppressionsLoader
.loadSuppressions("http://checkstyle.sourceforge.net/files/suppressions_none.xml");
break;
}
catch (CheckstyleException ex) {
// for some reason Travis CI failed some times(unstable) on reading this file
if (attemptCount < attemptLimit
&& ex.getMessage().contains("unable to read"))
{
attemptCount++;
// wait for bad/disconnection time to pass
Thread.sleep(1000);
}
else {
throw ex;
}
}
}
final FilterSet fc2 = new FilterSet();
assertEquals(fc, fc2);
}