Skip to content

Commit 9030e27

Browse files
shaehnVladimir Kotal
authored andcommitted
Dash B option enhancement (#1780)
fixes #1770
1 parent 5224503 commit 9030e27

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/org/opensolaris/opengrok/configuration/Configuration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public Configuration() {
357357
cmds = new HashMap<>();
358358
setAllowedSymlinks(new HashSet<>());
359359
setAuthorizationWatchdogEnabled(false);
360-
setBugPage("http://bugs.myserver.org/bugdatabase/view_bug.do?bug_id=");
360+
//setBugPage("http://bugs.myserver.org/bugdatabase/view_bug.do?bug_id=");
361361
setBugPattern("\\b([12456789][0-9]{6})\\b");
362362
setCachePages(5);
363363
setCommandTimeout(600); // 10 minutes
@@ -392,7 +392,7 @@ public Configuration() {
392392
setRamBufferSize(defaultRamBufferSize); //MB
393393
setRemoteScmSupported(RemoteSCM.OFF);
394394
setRepositories(new ArrayList<>());
395-
setReviewPage("http://arc.myserver.org/caselog/PSARC/");
395+
//setReviewPage("http://arc.myserver.org/caselog/PSARC/");
396396
setReviewPattern("\\b(\\d{4}/\\d{3})\\b"); // in form e.g. PSARC 2008/305
397397
setRevisionMessageCollapseThreshold(200);
398398
setScanningDepth(defaultScanningDepth); // default depth of scanning for repositories
@@ -403,7 +403,7 @@ public Configuration() {
403403
setTagsEnabled(false);
404404
setUrlPrefix("/source/s?");
405405
//setUrlPrefix("../s?"); // TODO generate relative search paths, get rid of -w <webapp> option to indexer !
406-
setUserPage("http://www.myserver.org/viewProfile.jspa?username=");
406+
//setUserPage("http://www.myserver.org/viewProfile.jspa?username=");
407407
// Set to empty string so we can append it to the URL
408408
// unconditionally later.
409409
setUserPageSuffix("");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public CommandLineOptions() {
7474
options.add(new Option('?', null, "Help"));
7575
options.add(new Option('A', ".ext|prefix.:analyzer", "Files with the named prefix/extension should be analyzed with the specified class"));
7676
options.add(new Option('a', ON_OFF, "Allow or disallow leading wildcards in a search"));
77-
options.add(new Option('B', "url", "Base URL of the user Information provider. Default: \"http://www.myserver.org/viewProfile.jspa?username=\""));
77+
options.add(new Option('B', "url", "Base URL of the user Information provider. Example: \"http://www.myserver.org/viewProfile.jspa?username=\". Use \"none\" to disable link."));
7878
options.add(new Option('C', null, "Print per project percentage progress information(I/O extensive, since one read through dir structure is made before indexing, needs -v, otherwise it just goes to the log)"));
7979
options.add(new Option('c', "/path/to/ctags", "Path to Exuberant Ctags from http://ctags.sf.net by default takes the Exuberant Ctags in PATH."));
8080
options.add(new Option('d', "/path/to/data/root", "The directory where OpenGrok stores the generated data"));

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ public void testProjects() throws IOException {
139139
assertNull(instance.getDefaultProjects());
140140

141141
File file = new File("/opengrok_automatic_test/foo/bar");
142-
instance.setSourceRoot("/opengrok_automatic_test/foo");
142+
File folder = new File("/opengrok_automatic_test/foo");
143+
instance.setSourceRoot(folder.getCanonicalPath());
143144
Project p = new Project("bar");
144145
p.setPath("/bar");
145146
assertEquals("/bar", p.getId());
@@ -299,18 +300,18 @@ public void testIgnoredNames() {
299300
public void testUserPage() {
300301
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
301302
String page = "http://www.myserver.org/viewProfile.jspa?username=";
303+
assertNull(instance.getUserPage()); // default value is null
304+
instance.setUserPage(page);
302305
assertEquals(page, instance.getUserPage());
303-
instance.setUserPage(page.substring(5));
304-
assertEquals(page.substring(5), instance.getUserPage());
305306
}
306307

307308
@Test
308309
public void testBugPage() {
309310
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
310311
String page = "http://bugs.myserver.org/bugdatabase/view_bug.do?bug_id=";
312+
assertNull(instance.getBugPage()); // default value is null
313+
instance.setBugPage(page);
311314
assertEquals(page, instance.getBugPage());
312-
instance.setBugPage(page.substring(5));
313-
assertEquals(page.substring(5), instance.getBugPage());
314315
}
315316

316317
@Test
@@ -357,9 +358,9 @@ public void testInvalidBugPattern() {
357358
public void testReviewPage() {
358359
RuntimeEnvironment instance = RuntimeEnvironment.getInstance();
359360
String page = "http://arc.myserver.org/caselog/PSARC/";
361+
assertNull(instance.getReviewPage()); // default value is null
362+
instance.setReviewPage(page);
360363
assertEquals(page, instance.getReviewPage());
361-
instance.setReviewPage(page.substring(5));
362-
assertEquals(page.substring(5), instance.getReviewPage());
363364
}
364365

365366
@Test

0 commit comments

Comments
 (0)