From e96bbc1e2897dd0bc168edb146e17377747622bf Mon Sep 17 00:00:00 2001 From: Pascal Essiembre Date: Tue, 10 Dec 2013 00:58:48 -0500 Subject: [PATCH] Minor fix in unit test. --- norconex-committer/pom.xml | 28 +++---------------- .../committer/AbstractFileQueueCommitter.java | 1 + .../AbstractMappedCommitterTest.java | 6 ++-- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/norconex-committer/pom.xml b/norconex-committer/pom.xml index 4a7bdf5..b942485 100644 --- a/norconex-committer/pom.xml +++ b/norconex-committer/pom.xml @@ -76,12 +76,6 @@ along with Norconex Committer. If not, see . - - junit - junit - 4.11 - test - - - commons-io - commons-io - 2.4 - - - org.apache.commons - commons-lang3 - 3.1 - - - log4j - log4j - 1.2.17 - com.norconex.commons norconex-commons-lang 1.2.0-SNAPSHOT - commons-configuration - commons-configuration - 1.9 + junit + junit + 4.11 + test diff --git a/norconex-committer/src/main/java/com/norconex/committer/AbstractFileQueueCommitter.java b/norconex-committer/src/main/java/com/norconex/committer/AbstractFileQueueCommitter.java index 18352c7..84cda12 100644 --- a/norconex-committer/src/main/java/com/norconex/committer/AbstractFileQueueCommitter.java +++ b/norconex-committer/src/main/java/com/norconex/committer/AbstractFileQueueCommitter.java @@ -139,6 +139,7 @@ public void visit(File file) { } }); + //TODO move this to finalize() to truly respect the commit size? commitComplete(); } diff --git a/norconex-committer/src/test/java/com/norconex/committer/AbstractMappedCommitterTest.java b/norconex-committer/src/test/java/com/norconex/committer/AbstractMappedCommitterTest.java index 3e8ba7f..f228ea5 100644 --- a/norconex-committer/src/test/java/com/norconex/committer/AbstractMappedCommitterTest.java +++ b/norconex-committer/src/test/java/com/norconex/committer/AbstractMappedCommitterTest.java @@ -40,13 +40,13 @@ * @author Pascal Dimassimo * @author Pascal Essiembre */ -@SuppressWarnings("nls") +@SuppressWarnings({"nls","javadoc"}) public class AbstractMappedCommitterTest { @Rule - private TemporaryFolder tempFolder = new TemporaryFolder(); + public TemporaryFolder tempFolder = new TemporaryFolder(); private StubCommitter committer; private boolean committed; @@ -140,6 +140,7 @@ public void testKeepSourceId() throws IOException { // Add a doc (it should trigger a commit because batch size is 1) committer.setQueueSize(1); committer.queueAdd(defaultReference, tempFolder.newFile(), metadata); +// committer.commit(); // Get the map generated assertEquals(1, committer.getCommitBatch().size()); @@ -183,6 +184,7 @@ public List getCommitBatch() { @Override protected void commitComplete() { + super.commitComplete(); committed = true; }