You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by la...@apache.org on 2015/06/03 02:52:21 UTC

lucenenet git commit: output the value that is passed in to DateTools

Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 2d9cac601 -> 7538910a2


output the value that is passed in to DateTools


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

Branch: refs/heads/failingtests
Commit: 7538910a2f985c50f261426e427772bc6b467687
Parents: 2d9cac6
Author: Laimonas Simutis <la...@gmail.com>
Authored: Tue Jun 2 20:52:09 2015 -0400
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Tue Jun 2 20:52:09 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Document/DateTools.cs       |  2 ++
 .../core/Search/TestDateFilter.cs               | 23 +++++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7538910a/src/Lucene.Net.Core/Document/DateTools.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/DateTools.cs b/src/Lucene.Net.Core/Document/DateTools.cs
index d4334d9..b1dba5b 100644
--- a/src/Lucene.Net.Core/Document/DateTools.cs
+++ b/src/Lucene.Net.Core/Document/DateTools.cs
@@ -78,6 +78,8 @@ namespace Lucene.Net.Documents
         ///  depending on <code>resolution</code>; using GMT as timezone </returns>
         public static string TimeToString(long time, Resolution resolution)
         {
+            OutputCollector.Current.AppendLine("Received time: " + time);
+
             DateTime date = new DateTime(Round(time, resolution));
 
             if (resolution == Resolution.YEAR)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7538910a/src/Lucene.Net.Tests/core/Search/TestDateFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestDateFilter.cs b/src/Lucene.Net.Tests/core/Search/TestDateFilter.cs
index baaf0da..ad939a6 100644
--- a/src/Lucene.Net.Tests/core/Search/TestDateFilter.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestDateFilter.cs
@@ -49,12 +49,22 @@ namespace Lucene.Net.Search
 
             long now = Environment.TickCount / TimeSpan.TicksPerMillisecond;
 
-            Document doc = new Document();
-            // add time that is in the past
-            doc.Add(NewStringField("datefield", DateTools.TimeToString(now - 1000, DateTools.Resolution.MILLISECOND), Field.Store.YES));
-            doc.Add(NewTextField("body", "Today is a very sunny day in New York City", Field.Store.YES));
-            writer.AddDocument(doc);
-
+            try
+            {
+                Document doc = new Document();
+                // add time that is in the past
+                doc.Add(NewStringField("datefield", DateTools.TimeToString(now - 1000, DateTools.Resolution.MILLISECOND),
+                                       Field.Store.YES));
+                doc.Add(NewTextField("body", "Today is a very sunny day in New York City", Field.Store.YES));
+                writer.AddDocument(doc);
+            }
+            catch (Exception)
+            {
+                Console.WriteLine("Output collected:");
+                Console.WriteLine(OutputCollector.Current);
+
+                throw;
+            }
             IndexReader reader = writer.Reader;
             writer.Dispose();
             IndexSearcher searcher = NewSearcher(reader);
@@ -98,6 +108,7 @@ namespace Lucene.Net.Search
         }
 
         [Test]
+        [Category("Focus")]
         public void Test()
         {
             // noop, required for the before and after tests to run