Skip to content

Commit 37bdfab

Browse files
committed
Kill meaningless test, and tweak our UselessOutputWriter
testSOLR59responseHeaderVersions looks like it tests wt, but the assertQ always sets wt=xml, so it doesn't do anything. We test qtime and status plenty of other places. I was confused by USELESS_OUTPUT till I realized it was part of UselessOutputWriter.
1 parent 441ae7a commit 37bdfab

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

solr/core/src/test/org/apache/solr/OutputWriterTest.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,16 @@
2929
/** Tests the ability to configure multiple query output writers, and select those at query time. */
3030
public class OutputWriterTest extends SolrTestCaseJ4 {
3131

32-
/** The XML string that's output for testing purposes. */
33-
public static final String USELESS_OUTPUT = "useless output";
34-
3532
@BeforeClass
3633
public static void beforeClass() throws Exception {
3734
initCore("solr/crazy-path-to-config.xml", "solr/crazy-path-to-schema.xml");
3835
}
3936

40-
/**
41-
* responseHeader has changed in SOLR-59, check old and new variants, In SOLR-2413, we removed
42-
* support for the deprecated versions
43-
*/
44-
@Test
45-
public void testSOLR59responseHeaderVersions() {
46-
// default results in "new" responseHeader
47-
lrf.args.put("wt", "json");
48-
assertQ(req("foo"), "/response/lst[@name='responseHeader']/int[@name='status'][.='0']");
49-
lrf.args.remove("wt");
50-
assertQ(req("foo"), "/response/lst[@name='responseHeader']/int[@name='QTime']");
51-
}
52-
5337
@Test
5438
public void testUselessWriter() throws Exception {
5539
lrf.args.put("wt", "useless");
5640
String out = h.query(req("foo"));
57-
assertEquals(USELESS_OUTPUT, out);
41+
assertEquals(UselessOutputWriter.USELESS_OUTPUT, out);
5842
}
5943

6044
public void testLazy() {
@@ -71,6 +55,9 @@ public void testLazy() {
7155
/** An output writer that doesn't do anything useful. */
7256
public static class UselessOutputWriter implements TextQueryResponseWriter {
7357

58+
/** The XML string that's output for testing purposes. */
59+
public static final String USELESS_OUTPUT = "useless output";
60+
7461
public UselessOutputWriter() {}
7562

7663
@Override

0 commit comments

Comments
 (0)