Skip to content

Commit

Permalink
Fix false negative test failure in ResourceTests
Browse files Browse the repository at this point in the history
Prior to changes in commit 57851de,
AbstractResource#getFilename threw IllegalStateException unless
overridden by a subclass. Following that change, this method now throws
null instead, but ResourceTests#testAbstractResourceExceptions had not
been updated to reflect, resulting in a false negative failure. This has
now been fixed.

Issue: SPR-9043
  • Loading branch information
cbeams committed Feb 13, 2012
1 parent 8e0b1c3 commit 1d9d3e6
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.springframework.core.io;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.*;

import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -215,13 +216,8 @@ public InputStream getInputStream() {
catch (FileNotFoundException ex) {
assertTrue(ex.getMessage().indexOf(name) != -1);
}
try {
resource.getFilename();
fail("IllegalStateException should have been thrown");
}
catch (IllegalStateException ex) {
assertTrue(ex.getMessage().indexOf(name) != -1);
}

assertThat(resource.getFilename(), nullValue());
}

}

0 comments on commit 1d9d3e6

Please sign in to comment.