Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE138C1E5 for ; Tue, 1 May 2012 17:15:46 +0000 (UTC) Received: (qmail 4015 invoked by uid 500); 1 May 2012 17:15:46 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 3993 invoked by uid 500); 1 May 2012 17:15:46 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 3986 invoked by uid 99); 1 May 2012 17:15:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 17:15:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 17:15:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 615BD2388860 for ; Tue, 1 May 2012 17:15:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1332755 - /accumulo/trunk/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java Date: Tue, 01 May 2012 17:15:25 -0000 To: commits@accumulo.apache.org From: ecn@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120501171525.615BD2388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ecn Date: Tue May 1 17:15:24 2012 New Revision: 1332755 URL: http://svn.apache.org/viewvc?rev=1332755&view=rev Log: ACCUMULO-564: turn TestQueryLogic unit test into a functioning unit test by completing the configuration Modified: accumulo/trunk/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java Modified: accumulo/trunk/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java?rev=1332755&r1=1332754&r2=1332755&view=diff ============================================================================== --- accumulo/trunk/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java (original) +++ accumulo/trunk/examples/wikisearch/query/src/test/java/org/apache/accumulo/examples/wikisearch/logic/TestQueryLogic.java Tue May 1 17:15:24 2012 @@ -22,6 +22,7 @@ import java.io.File; import java.io.IOException; import java.net.URL; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; @@ -46,6 +47,7 @@ import org.apache.accumulo.examples.wiki import org.apache.accumulo.examples.wikisearch.parser.RangeCalculator; import org.apache.accumulo.examples.wikisearch.reader.AggregatingRecordReader; import org.apache.accumulo.examples.wikisearch.sample.Document; +import org.apache.accumulo.examples.wikisearch.sample.Field; import org.apache.accumulo.examples.wikisearch.sample.Results; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; @@ -158,6 +160,7 @@ public class TestQueryLogic { table.setIndexTableName(INDEX_TABLE_NAME); table.setReverseIndexTableName(RINDEX_TABLE_NAME); table.setUseReadAheadIterator(false); + table.setUnevaluatedFields(Collections.singletonList("TEXT")); } void debugQuery(String tableName) throws Exception { @@ -179,13 +182,14 @@ public class TestQueryLogic { List docs = results.getResults(); assertEquals(4, docs.size()); - /* - * debugQuery(METADATA_TABLE_NAME); debugQuery(TABLE_NAME); debugQuery(INDEX_TABLE_NAME); debugQuery(RINDEX_TABLE_NAME); - * - * results = table.runQuery(c, auths, "TEXT == 'abacus'", null, null, null); docs = results.getResults(); assertEquals(4, docs.size()); for (Document doc : - * docs) { System.out.println("id: " + doc.getId()); for (Field field : doc.getFields()) System.out.println(field.getFieldName() + " -> " + - * field.getFieldValue()); } - */ + results = table.runQuery(c, auths, "TEXT == 'abacus'", null, null, null); + docs = results.getResults(); + assertEquals(1, docs.size()); + for (Document doc : docs) { + System.out.println("id: " + doc.getId()); + for (Field field : doc.getFields()) + System.out.println(field.getFieldName() + " -> " + field.getFieldValue()); + } } }