lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject lucene-solr:master: SOLR-12250: Create the temporary tlog file properly
Date Wed, 06 Jun 2018 08:50:35 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 2b406a57c -> 2f19ae190


SOLR-12250: Create the temporary tlog file properly


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/2f19ae19
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/2f19ae19
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/2f19ae19

Branch: refs/heads/master
Commit: 2f19ae1907e63864e19eda5b6325083f61f9cf66
Parents: 2b406a5
Author: Cao Manh Dat <datcm@apache.org>
Authored: Wed Jun 6 15:50:19 2018 +0700
Committer: Cao Manh Dat <datcm@apache.org>
Committed: Wed Jun 6 15:50:19 2018 +0700

----------------------------------------------------------------------
 .../test/org/apache/solr/update/TransactionLogTest.java   | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/2f19ae19/solr/core/src/test/org/apache/solr/update/TransactionLogTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/TransactionLogTest.java b/solr/core/src/test/org/apache/solr/update/TransactionLogTest.java
index d2b4b26..100d4d9 100644
--- a/solr/core/src/test/org/apache/solr/update/TransactionLogTest.java
+++ b/solr/core/src/test/org/apache/solr/update/TransactionLogTest.java
@@ -17,8 +17,10 @@
 
 package org.apache.solr.update;
 
+import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Locale;
 
@@ -29,9 +31,11 @@ import org.junit.Test;
 public class TransactionLogTest extends LuceneTestCase {
 
   @Test
-  public void testBigLastAddSize() throws IOException {
-    String tlogFileName = String.format(Locale.ROOT, UpdateLog.LOG_FILENAME_PATTERN, UpdateLog.TLOG_NAME,
0);
-    try (TransactionLog transactionLog = new TransactionLog(Files.createTempFile(tlogFileName,
"").toFile(), new ArrayList<>())) {
+  public void testBigLastAddSize() {
+    String tlogFileName = String.format(Locale.ROOT, UpdateLog.LOG_FILENAME_PATTERN, UpdateLog.TLOG_NAME,
Long.MAX_VALUE);
+    Path path = createTempDir();
+    File logFile = new File(path.toFile(), tlogFileName);
+    try (TransactionLog transactionLog = new TransactionLog(logFile, new ArrayList<>()))
{
       transactionLog.lastAddSize = 2000000000;
       AddUpdateCommand updateCommand = new AddUpdateCommand(null);
       updateCommand.solrDoc = new SolrInputDocument();


Mime
View raw message