You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2013/07/10 23:19:26 UTC
svn commit: r1502006 - in /lucene/dev/trunk/solr:
core/src/test/org/apache/solr/search/TestSolr4Spatial.java
test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
Author: yonik
Date: Wed Jul 10 21:19:26 2013
New Revision: 1502006
URL: http://svn.apache.org/r1502006
Log:
tests: ignore expected exceptions
Modified:
lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java
lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java?rev=1502006&r1=1502005&r2=1502006&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial.java Wed Jul 10 21:19:26 2013
@@ -73,12 +73,14 @@ public class TestSolr4Spatial extends So
"fl", "id," + fieldName, "q", "*:*", "rows", "1000",
"fq", "{!field f="+fieldName+"}Intersectssss"), 400);
+ ignoreException("NonexistentShape");
try {
assertU(adoc("id", "-1", fieldName, "NonexistentShape"));
fail();
} catch (SolrException e) {
assertEquals(400, e.code());
}
+ unIgnoreException("NonexistentShape");
}
private void setupDocs() {
Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1502006&r1=1502005&r2=1502006&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Wed Jul 10 21:19:26 2013
@@ -713,23 +713,29 @@ public abstract class SolrTestCaseJ4 ext
/** Makes sure a query throws a SolrException with the listed response code */
public static void assertQEx(String message, SolrQueryRequest req, int code ) {
try {
+ ignoreException(".");
h.query(req);
fail( message );
} catch (SolrException sex) {
assertEquals( code, sex.code() );
} catch (Exception e2) {
throw new RuntimeException("Exception during query", e2);
+ } finally {
+ unIgnoreException(".");
}
}
public static void assertQEx(String message, SolrQueryRequest req, SolrException.ErrorCode code ) {
try {
+ ignoreException(".");
h.query(req);
fail( message );
} catch (SolrException e) {
assertEquals( code.code, e.code() );
} catch (Exception e2) {
throw new RuntimeException("Exception during query", e2);
+ } finally {
+ unIgnoreException(".");
}
}