lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lai...@apache.org
Subject lucenenet git commit: more logging
Date Sat, 23 May 2015 15:22:11 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 4eadaef97 -> e95c93218


more logging


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/e95c9321
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/e95c9321
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/e95c9321

Branch: refs/heads/failingtests
Commit: e95c93218ba37160f3a609e7e79388223749dbb6
Parents: 4eadaef
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Sat May 23 11:21:53 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Sat May 23 11:21:53 2015 -0400

----------------------------------------------------------------------
 .../core/Search/TestFuzzyQuery.cs                | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e95c9321/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs b/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
index 7ec2fd7..8f3b217 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
@@ -1,4 +1,6 @@
+using System;
 using System.Collections.Generic;
+using System.Text;
 using Lucene.Net.Documents;
 
 namespace Lucene.Net.Search
@@ -243,6 +245,9 @@ namespace Lucene.Net.Search
         [Category("Focus")]
         public virtual void TestTieBreaker()
         {
+            var collector = new StringBuilder();
+            OutputCollector.Init(collector);
+
             Directory directory = NewDirectory();
             RandomIndexWriter writer = new RandomIndexWriter(Random(), directory);
             AddDoc("a123456", writer);
@@ -266,7 +271,19 @@ namespace Lucene.Net.Search
             IndexSearcher searcher = NewSearcher(mr);
             FuzzyQuery fq = new FuzzyQuery(new Term("field", "z123456"), 1, 0, 2, false);
             TopDocs docs = searcher.Search(fq, 2);
-            Assert.AreEqual(5, docs.TotalHits); // 5 docs, from the a and b's
+            try
+            {
+
+                Assert.AreEqual(5, docs.TotalHits); // 5 docs, from the a and b's
+            }
+            catch (AssertionException)
+            {
+                Console.WriteLine("Collected output:");
+                Console.WriteLine(collector);
+                OutputCollector.Init(null);
+                throw;
+            }
+
             mr.Dispose();
             ir1.Dispose();
             ir2.Dispose();


Mime
View raw message