Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EC087200B74 for ; Thu, 1 Sep 2016 16:36:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E7853160AB7; Thu, 1 Sep 2016 14:36:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1EF0C160AB5 for ; Thu, 1 Sep 2016 16:36:29 +0200 (CEST) Received: (qmail 57445 invoked by uid 500); 1 Sep 2016 14:36:22 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 57320 invoked by uid 99); 1 Sep 2016 14:36:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2016 14:36:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A736EE07F4; Thu, 1 Sep 2016 14:36:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: synhershko@apache.org To: commits@lucenenet.apache.org Date: Thu, 01 Sep 2016 14:36:26 -0000 Message-Id: <59f451351c8f47868ea60c2ca5915f57@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [06/22] lucenenet git commit: Ported Analysis.Miscellaneous.TestSingleTokenTokenFilter archived-at: Thu, 01 Sep 2016 14:36:31 -0000 Ported Analysis.Miscellaneous.TestSingleTokenTokenFilter Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/65f1c5f0 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/65f1c5f0 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/65f1c5f0 Branch: refs/heads/analysis-work Commit: 65f1c5f0d2571e687073848b0ec14b98e8a603d8 Parents: 0549bf1 Author: Shad Storhaug Authored: Wed Aug 24 19:34:00 2016 +0700 Committer: Shad Storhaug Committed: Wed Aug 24 19:34:00 2016 +0700 ---------------------------------------------------------------------- .../Miscellaneous/TestSingleTokenTokenFilter.cs | 65 ++++++++++---------- .../Lucene.Net.Tests.Analysis.Common.csproj | 1 + 2 files changed, 32 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/65f1c5f0/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs index 7781dc4..a6ee91a 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs +++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs @@ -1,7 +1,10 @@ -namespace org.apache.lucene.analysis.miscellaneous -{ +using Lucene.Net.Analysis.Tokenattributes; +using Lucene.Net.Util; +using NUnit.Framework; - /* +namespace Lucene.Net.Analysis.Miscellaneous +{ + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. @@ -18,35 +21,29 @@ * limitations under the License. */ - using LuceneTestCase = org.apache.lucene.util.LuceneTestCase; - using AttributeImpl = org.apache.lucene.util.AttributeImpl; - using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute; - - public class TestSingleTokenTokenFilter : LuceneTestCase - { - -//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: -//ORIGINAL LINE: public void test() throws java.io.IOException - public virtual void test() - { - Token token = new Token(); - SingleTokenTokenStream ts = new SingleTokenTokenStream(token); - AttributeImpl tokenAtt = (AttributeImpl) ts.addAttribute(typeof(CharTermAttribute)); - assertTrue(tokenAtt is Token); - ts.reset(); - - assertTrue(ts.incrementToken()); - assertEquals(token, tokenAtt); - assertFalse(ts.incrementToken()); - - token = new Token("hallo", 10, 20, "someType"); - ts.Token = token; - ts.reset(); - - assertTrue(ts.incrementToken()); - assertEquals(token, tokenAtt); - assertFalse(ts.incrementToken()); - } - } - + public class TestSingleTokenTokenFilter : LuceneTestCase + { + + [Test] + public virtual void Test() + { + Token token = new Token(); + SingleTokenTokenStream ts = new SingleTokenTokenStream(token); + var tokenAtt = ts.AddAttribute(); + assertTrue(tokenAtt is Token); + ts.Reset(); + + assertTrue(ts.IncrementToken()); + assertEquals(token, tokenAtt); + assertFalse(ts.IncrementToken()); + + token = new Token("hallo", 10, 20, "someType"); + ts.Token = token; + ts.Reset(); + + assertTrue(ts.IncrementToken()); + assertEquals(token, tokenAtt); + assertFalse(ts.IncrementToken()); + } + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/lucenenet/blob/65f1c5f0/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj index 048bac7..3ed4a9d 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj +++ b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj @@ -220,6 +220,7 @@ +