File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
main/java/org/opengrok/indexer/configuration
test/java/org/opengrok/indexer/configuration Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,15 @@ public static String getSamples() throws RuntimeException {
92
92
mthd );
93
93
}
94
94
95
+ String propertyName = mthd .getName ().replaceFirst ("^set" , "" );
96
+
95
97
sample = conf .getXMLRepresentationAsString ();
96
98
sample = sample .replaceFirst (
97
99
"(?sx)^<\\ ?xml.*Configuration\\ d*\" >\\ n" , "" );
98
100
sample = sample .replaceFirst ("</object>\\ n</java>" , "" );
101
+ // With Java 11 the following excision is necessary.
102
+ sample = sample .replaceFirst ("(?isx)^.*\\ n(?=\\ s*<void\\ s+property=\" " +
103
+ propertyName + "\" )" , "" );
99
104
100
105
h .clear ();
101
106
h .append (XML_COMMENT_START );
Original file line number Diff line number Diff line change 18
18
*/
19
19
20
20
/*
21
- * Copyright (c) 2018, Chris Fraire <[email protected] >.
21
+ * Copyright (c) 2018, 2020, Chris Fraire <[email protected] >.
22
22
*/
23
23
24
24
package org .opengrok .indexer .configuration ;
25
25
26
+ import static org .junit .Assert .assertFalse ;
26
27
import static org .junit .Assert .assertTrue ;
27
28
import org .junit .Test ;
28
29
@@ -33,9 +34,12 @@ public class ConfigurationHelpTest {
33
34
@ Test
34
35
public void shouldCreateReadableUsage () {
35
36
String samples = ConfigurationHelp .getSamples ();
36
- assertTrue ("samples are not empty" , ! samples .isEmpty ());
37
+ assertFalse ("samples are not empty" , samples .isEmpty ());
37
38
assertTrue ("samples contains \" <?\" " , samples .contains ("<?" ));
38
39
assertTrue ("samples contains \" user-defined\" " ,
39
40
samples .contains ("user-defined" ));
41
+ assertTrue ("Java 11 nulls are removed" ,
42
+ samples .contains ("<!-- Sample for setWebappCtags. Default is false -->\n " +
43
+ " <void property=\" webappCtags\" >\n " ));
40
44
}
41
45
}
You can’t perform that action at this time.
0 commit comments