Skip to content

Commit

Permalink
test: reproduce the reported problem as #1272
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA committed Oct 13, 2020
1 parent 84f2ad7 commit 7e59645
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -7,7 +7,12 @@
import org.hamcrest.MatcherAssert;
import org.junit.Test;

import java.io.IOException;
import java.io.StringWriter;

import static edu.umd.cs.findbugs.test.CountMatcher.containsExactly;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;

public class Issue390Test extends AbstractIntegrationTest {

Expand All @@ -18,4 +23,15 @@ public void test() {
MatcherAssert.assertThat(getBugCollection(), containsExactly(1, bugTypeMatcher));
}

/**
* @see <a href="https://github.com/spotbugs/spotbugs/issues/1272">The reported GitHub issue</a>
*/
@Test
public void testXmlGeneratability() throws IOException {
performAnalysis("ghIssues/Issue390.class");
StringWriter writer = new StringWriter();
getBugCollection().setWithMessages(true);
getBugCollection().writeXML(writer);
assertThat(writer.toString(), containsString("JUA_DONT_ASSERT_INSTANCEOF_IN_TESTS"));
}
}

0 comments on commit 7e59645

Please sign in to comment.