You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/05/13 19:03:07 UTC
svn commit: r1481970 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/core/ solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
Author: rmuir
Date: Mon May 13 17:03:07 2013
New Revision: 1481970
URL: http://svn.apache.org/r1481970
Log:
filter out 'hidden' directories with a regex filter instead
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java?rev=1481970&r1=1481969&r2=1481970&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java Mon May 13 17:03:07 2013
@@ -22,6 +22,8 @@ import java.util.Collection;
import java.util.List;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.RegexFileFilter;
+import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.cloud.ZkNodeProps;
@@ -189,16 +191,14 @@ public class ZkCLITest extends SolrTestC
File sourceConfDir = new File(ExternalPaths.EXAMPLE_HOME + File.separator + "collection1"
+ File.separator + "conf");
- Collection<File> sourceFiles = FileUtils.listFiles(sourceConfDir,null,true);
+ // filter out all directories starting with . (e.g. .svn)
+ Collection<File> sourceFiles = FileUtils.listFiles(sourceConfDir, TrueFileFilter.INSTANCE, new RegexFileFilter("[^\\.].*"));
for (File sourceFile :sourceFiles){
- if (!sourceFile.isHidden()){
int indexOfRelativePath = sourceFile.getAbsolutePath().lastIndexOf("collection1/conf");
String relativePathofFile = sourceFile.getAbsolutePath().substring(indexOfRelativePath + 17, sourceFile.getAbsolutePath().length());
File downloadedFile = new File(confDir,relativePathofFile);
assertTrue(downloadedFile.getAbsolutePath() + " does not exist source:" + sourceFile.getAbsolutePath(), downloadedFile.exists());
assertTrue("Content didn't change",FileUtils.contentEquals(sourceFile,downloadedFile));
- }
-
}