SOLR-4019: Fix tests that are invalid due to logging change

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1405919 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Dyer 2012-11-05 18:51:00 +00:00
parent 5fb2789394
commit f1a67f7cb0
1 changed files with 11 additions and 17 deletions

View File

@ -84,19 +84,16 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
assertEquals("OK", rsp.getValues().get("status")); assertEquals("OK", rsp.getValues().get("status"));
} }
@Ignore
public void testEnablingServer() throws Exception { public void testEnablingServer() throws Exception {
assertTrue(! healthcheckFile.exists()); assertTrue(! healthcheckFile.exists());
// first make sure that ping responds back that the service is disabled // first make sure that ping responds back that the service is disabled
SolrQueryResponse sqr = makeRequest(handler, req());
try { SolrException se = (SolrException) sqr.getException();
makeRequest(handler, req()); assertEquals(
fail("Should have thrown a SolrException because not enabled yet"); "Response should have been replaced with a 503 SolrException.",
} catch (SolrException se){ se.code(), SolrException.ErrorCode.SERVICE_UNAVAILABLE.code);
assertEquals(SolrException.ErrorCode.SERVICE_UNAVAILABLE.code,se.code());
}
// now enable // now enable
@ -115,7 +112,6 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
assertTrue(healthcheckFile.exists()); assertTrue(healthcheckFile.exists());
} }
@Ignore
public void testDisablingServer() throws Exception { public void testDisablingServer() throws Exception {
assertTrue(! healthcheckFile.exists()); assertTrue(! healthcheckFile.exists());
@ -134,13 +130,11 @@ public class PingRequestHandlerTest extends SolrTestCaseJ4 {
assertFalse(healthcheckFile.exists()); assertFalse(healthcheckFile.exists());
// now make sure that ping responds back that the service is disabled // now make sure that ping responds back that the service is disabled
SolrQueryResponse sqr = makeRequest(handler, req());
try { SolrException se = (SolrException) sqr.getException();
makeRequest(handler, req()); assertEquals(
fail("Should have thrown a SolrException because not enabled yet"); "Response should have been replaced with a 503 SolrException.",
} catch (SolrException se){ se.code(), SolrException.ErrorCode.SERVICE_UNAVAILABLE.code);
assertEquals(SolrException.ErrorCode.SERVICE_UNAVAILABLE.code,se.code());
}
// disable when already disabled shouldn't cause any problems // disable when already disabled shouldn't cause any problems
makeRequest(handler, req("action", "disable")); makeRequest(handler, req("action", "disable"));