From ebc43a1f5f515df22e0856d748785751a4f2a27b Mon Sep 17 00:00:00 2001 From: Steven Rowe Date: Mon, 12 Sep 2011 16:12:27 +0000 Subject: [PATCH] Increase verbosity on failure git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1169814 13f79535-47bb-0310-9956-ffa450edef68 --- .../solrj/embedded/TestSolrProperties.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java index 89905a9795d..4748ce727e5 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java @@ -203,23 +203,23 @@ public class TestSolrProperties extends LuceneTestCase { mcr = CoreAdminRequest.persist("solr-persist.xml", coreadmin); - if (VERBOSE) { - FileInputStream fis = new FileInputStream(new File(solrXml.getParent(), "solr-persist.xml")); - try { - System.out.println(IOUtils.toString(fis)); - } finally { - fis.close(); - } - } DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); FileInputStream fis = new FileInputStream(new File(solrXml.getParent(), "solr-persist.xml")); try { Document document = builder.parse(fis); - assertTrue(exists("/solr/cores[@defaultCoreName='core0']", document)); - assertTrue(exists("/solr/cores[@host='127.0.0.1']", document)); - assertTrue(exists("/solr/cores[@hostPort='8983']", document)); - assertTrue(exists("/solr/cores[@zkClientTimeout='8000']", document)); - assertTrue(exists("/solr/cores[@hostContext='solr']", document)); + fis.close(); + fis = new FileInputStream(new File(solrXml.getParent(), "solr-persist.xml")); + String solrPersistXml = IOUtils.toString(fis); + assertTrue("\"/solr/cores[@defaultCoreName='core0']\" doesn't match in:\n" + solrPersistXml, + exists("/solr/cores[@defaultCoreName='core0']", document)); + assertTrue("\"/solr/cores[@host='127.0.0.1']\" doesn't match in:\n" + solrPersistXml, + exists("/solr/cores[@host='127.0.0.1']", document)); + assertTrue("\"/solr/cores[@hostPort='8983']\" doesn't match in:\n" + solrPersistXml, + exists("/solr/cores[@hostPort='8983']", document)); + assertTrue("\"/solr/cores[@zkClientTimeout='8000']\" doesn't match in:\n" + solrPersistXml, + exists("/solr/cores[@zkClientTimeout='8000']", document)); + assertTrue("\"/solr/cores[@hostContext='solr']\" doesn't match in:\n" + solrPersistXml, + exists("/solr/cores[@hostContext='solr']", document)); } finally { fis.close();