Skip to content

Commit 7d3d639

Browse files
Lubos Koscotrondn
Lubos Kosco
authored andcommitted
correct junit arc url
add test for a FIFO into to the repository
1 parent 9f7520d commit 7d3d639

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

src/org/opensolaris/opengrok/index/IndexDatabase.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,9 @@ private boolean accept(File file) {
607607
return false;
608608
}
609609
}
610-
//below will only let go files and directories, anything else is considered special and is
610+
//below will only let go files and directories, anything else is considered special and is not added
611611
if (!file.isFile() && !file.isDirectory()) {
612-
log.warning("Warning: ignored special file " + file.getAbsolutePath() +
613-
" -> " + file.getCanonicalPath());
612+
log.warning("Warning: ignored special file " + file.getAbsolutePath());
614613
return false;
615614
}
616615
} catch (IOException exp) {

test/org/opensolaris/opengrok/configuration/RuntimeEnvironmentTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public void testBugPattern() {
279279
@Test
280280
public void testReviewPage() {
281281
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
282-
String page = "http://www.opensolaris.org/os/community/arc/caselog/";
282+
String page = "http://arc.opensolaris.org/caselog/PSARC/";
283283
assertEquals(page, instance.getReviewPage());
284284
instance.setReviewPage(page.substring(5));
285285
assertEquals(page.substring(5), instance.getReviewPage());

test/org/opensolaris/opengrok/index/IndexerTest.java

+43
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.opensolaris.opengrok.history.Repository;
4444
import org.opensolaris.opengrok.history.RepositoryFactory;
4545
import org.opensolaris.opengrok.history.RepositoryInfo;
46+
import org.opensolaris.opengrok.util.Executor;
4647
import org.opensolaris.opengrok.util.FileUtilities;
4748
import org.opensolaris.opengrok.util.TestRepository;
4849
import static org.junit.Assert.*;
@@ -204,4 +205,46 @@ public void testBug3430() throws Exception {
204205
System.out.println("Skipping test. Could not find a ctags I could use in path.");
205206
}
206207
}
208+
209+
@Test
210+
public void testBug11896() throws Exception {
211+
212+
boolean test = true;
213+
Executor executor = new Executor(new String[] {"mkfifo"});
214+
215+
executor.exec(true);
216+
String output = executor.getErrorString();
217+
if (output == null || output.indexOf("mkfifo") == -1 || output.indexOf("command not found") > -1) {
218+
System.out.println("Error: No mkfifo found in PATH!\n");
219+
test = false;
220+
}
221+
222+
if (test) {
223+
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
224+
env.setSourceRoot(repository.getSourceRoot());
225+
env.setDataRoot(repository.getDataRoot());
226+
227+
executor = new Executor(new String[] {"mkdir", "-p", repository.getSourceRoot()+"/testBug11896"});
228+
executor.exec(true);
229+
230+
executor = new Executor(new String[] {"mkfifo", repository.getSourceRoot()+"/testBug11896/FIFO"});
231+
executor.exec(true);
232+
233+
if (env.validateExuberantCtags()) {
234+
Project project = new Project();
235+
project.setPath("/testBug11896");
236+
IndexDatabase idb = new IndexDatabase(project);
237+
assertNotNull(idb);
238+
MyIndexChangeListener listener = new MyIndexChangeListener();
239+
idb.addIndexChangedListener(listener);
240+
System.out.println("Trying to index a special file - FIFO in this case.");
241+
idb.update();
242+
assertEquals(0, listener.files.size());
243+
} else {
244+
System.out.println("Skipping test. Could not find a ctags I could use in path.");
245+
}
246+
} else {
247+
System.out.println("Skipping test for bug 11896. Could not find a mkfifo in path.");
248+
}
249+
}
207250
}

0 commit comments

Comments
 (0)