Skip to content

Commit f7eaca8

Browse files
committed
Use JUnit 5 convention for test method visibility
1 parent 3a9bfb0 commit f7eaca8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+331
-331
lines changed

src/test/java/org/apache/commons/jxpath/BasicNodeSetTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected void setUp() throws Exception {
111111
* Test adding pointers.
112112
*/
113113
@Test
114-
public void testAdd() {
114+
void testAdd() {
115115
addPointers("/bean/integers");
116116
assertEquals(list("/bean/integers[1]", "/bean/integers[2]", "/bean/integers[3]", "/bean/integers[4]").toString(), nodeSet.getPointers().toString());
117117
assertEquals(list(Integer.valueOf(1), Integer.valueOf(2), Integer.valueOf(3), Integer.valueOf(4)), nodeSet.getValues());
@@ -122,7 +122,7 @@ public void testAdd() {
122122
* Demonstrate when nodes != values: in XML models.
123123
*/
124124
@Test
125-
public void testNodes() {
125+
void testNodes() {
126126
addPointers("/document/vendor/contact");
127127
assertEquals(
128128
list("/document/vendor[1]/contact[1]", "/document/vendor[1]/contact[2]", "/document/vendor[1]/contact[3]", "/document/vendor[1]/contact[4]")
@@ -137,7 +137,7 @@ public void testNodes() {
137137
* Test removing a pointer.
138138
*/
139139
@Test
140-
public void testRemove() {
140+
void testRemove() {
141141
addPointers("/bean/integers");
142142
removePointers("/bean/integers[4]");
143143
assertEquals(list("/bean/integers[1]", "/bean/integers[2]", "/bean/integers[3]").toString(), nodeSet.getPointers().toString());

src/test/java/org/apache/commons/jxpath/issues/JXPath113Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private static DocumentBuilder getDocumentBuilder() throws ParserConfigurationEx
5656
}
5757

5858
@Test
59-
public void testIssue113() throws Exception {
59+
void testIssue113() throws Exception {
6060
final Document doc = JAXP.getDocument("<xml/>");
6161
final JXPathContext context = JXPathContext.newContext(doc);
6262
final List result = context.selectNodes("//following-sibling::node()");

src/test/java/org/apache/commons/jxpath/issues/JXPath118Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void setFoo(final int foo) {
6262
}
6363

6464
@Test
65-
public void testJXPATH118IssueWithAsPath() throws Exception {
65+
void testJXPATH118IssueWithAsPath() throws Exception {
6666
final Object contextBean = new SomeChildClass();
6767
final JXPathContext context = JXPathContext.newContext(contextBean);
6868
final Iterator<Pointer> iteratePointers = context.iteratePointers("//*");

src/test/java/org/apache/commons/jxpath/issues/JXPath149Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
public class JXPath149Test extends AbstractJXPathTest {
2525

2626
@Test
27-
public void testComplexOperationWithVariables() {
27+
void testComplexOperationWithVariables() {
2828
final JXPathContext context = JXPathContext.newContext(null);
2929
context.getVariables().declareVariable("a", Integer.valueOf(0));
3030
context.getVariables().declareVariable("b", Integer.valueOf(0));

src/test/java/org/apache/commons/jxpath/issues/JXPath172DynamicTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private JXPathContext getContext(final String val, final boolean lenient) {
4848
}
4949

5050
@Test
51-
public void testIssue172_nestedpropertyDoesNotExist_Lenient() {
51+
void testIssue172_nestedpropertyDoesNotExist_Lenient() {
5252
final JXPathContext context = getContext(null, true);
5353
final Object bRet = context.selectSingleNode("value.unexisting");
5454
assertNull(bRet);
@@ -58,7 +58,7 @@ public void testIssue172_nestedpropertyDoesNotExist_Lenient() {
5858
}
5959

6060
@Test
61-
public void testIssue172_nestedpropertyDoesNotExist_NotLenient() {
61+
void testIssue172_nestedpropertyDoesNotExist_NotLenient() {
6262
final JXPathContext context = getContext(null, false);
6363
final Object bRet = context.selectSingleNode("value.unexisting");
6464
assertNull(bRet);
@@ -68,7 +68,7 @@ public void testIssue172_nestedpropertyDoesNotExist_NotLenient() {
6868
}
6969

7070
@Test
71-
public void testIssue172_propertyDoesNotExist() {
71+
void testIssue172_propertyDoesNotExist() {
7272
final JXPathContext context = getContext(null, false);
7373
final Object bRet = context.selectSingleNode("unexisting");
7474
assertNull(bRet);
@@ -78,7 +78,7 @@ public void testIssue172_propertyDoesNotExist() {
7878
}
7979

8080
@Test
81-
public void testIssue172_propertyDoesNotExist_Lenient() {
81+
void testIssue172_propertyDoesNotExist_Lenient() {
8282
final JXPathContext context = getContext(null, true);
8383
final Object bRet = context.selectSingleNode("unexisting");
8484
assertNull(bRet);
@@ -88,7 +88,7 @@ public void testIssue172_propertyDoesNotExist_Lenient() {
8888
}
8989

9090
@Test
91-
public void testIssue172_propertyExistAndIsNotNull() {
91+
void testIssue172_propertyExistAndIsNotNull() {
9292
final JXPathContext context = getContext("ciao", false);
9393
final Object bRet = context.selectSingleNode("value");
9494
assertNotNull(bRet, "null!!");
@@ -100,7 +100,7 @@ public void testIssue172_propertyExistAndIsNotNull() {
100100
}
101101

102102
@Test
103-
public void testIssue172_propertyExistAndIsNull() {
103+
void testIssue172_propertyExistAndIsNull() {
104104
final JXPathContext context = getContext(null, false);
105105
final Object bRet = context.selectSingleNode("value");
106106
assertNull(bRet, "not null!!");

src/test/java/org/apache/commons/jxpath/issues/JXPath172Test.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private JXPathContext getContext(final String val, final boolean lenient) {
6161
}
6262

6363
@Test
64-
public void testIssue172_NestedPropertyUnexisting() {
64+
void testIssue172_NestedPropertyUnexisting() {
6565
final JXPathContext context = getContext(null, true);
6666
final Object bRet = context.selectSingleNode("value.child");
6767
assertNull(bRet, "not null!!");
@@ -72,15 +72,15 @@ public void testIssue172_NestedPropertyUnexisting() {
7272
}
7373

7474
@Test
75-
public void testIssue172_propertyDoesNotExist_NotLenient() {
75+
void testIssue172_propertyDoesNotExist_NotLenient() {
7676
final JXPathContext context = getContext(null, false);
7777
assertThrows(JXPathNotFoundException.class, () -> context.selectSingleNode("unexisting"));
7878
assertThrows(JXPathNotFoundException.class, () -> context.getPointer("unexisting"));
7979
assertThrows(JXPathNotFoundException.class, () -> context.getPointer("value.unexisting"));
8080
}
8181

8282
@Test
83-
public void testIssue172_propertyExistAndIsNotNull() {
83+
void testIssue172_propertyExistAndIsNotNull() {
8484
final JXPathContext context = getContext("ciao", false);
8585
final Object bRet = context.selectSingleNode("value");
8686
assertNotNull(bRet, "null!!");
@@ -92,7 +92,7 @@ public void testIssue172_propertyExistAndIsNotNull() {
9292
}
9393

9494
@Test
95-
public void testIssue172_propertyExistAndIsNull() {
95+
void testIssue172_propertyExistAndIsNull() {
9696
final JXPathContext context = getContext(null, false);
9797
final Object bRet = context.selectSingleNode("value");
9898
assertNull(bRet, "not null!!");
@@ -103,7 +103,7 @@ public void testIssue172_propertyExistAndIsNull() {
103103
}
104104

105105
@Test
106-
public void testIssue172_PropertyUnexisting() {
106+
void testIssue172_PropertyUnexisting() {
107107
final JXPathContext context = getContext(null, true);
108108
final Object bRet = context.selectSingleNode("unexisting");
109109
assertNull(bRet, "not null!!");

src/test/java/org/apache/commons/jxpath/issues/JXPath177Test.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,19 @@ private void doTest(final String xp, final String expected) {
8888
}
8989

9090
@Test
91-
public void testJx177() {
91+
void testJx177() {
9292
doTest("name", "ROOT name");
9393
doTest("/x/name", "X name");
9494
doTest("$__root/x/name", "X name");
9595
}
9696

9797
@Test
98-
public void testJx177_Union1() {
98+
void testJx177_Union1() {
9999
doTest("$__root/x/name|name", "X name");
100100
}
101101

102102
@Test
103-
public void testJx177_Union2() {
103+
void testJx177_Union2() {
104104
doTest("$__root/x/unexisting|name", "ROOT name");
105105
}
106106
}

src/test/java/org/apache/commons/jxpath/ri/ExceptionHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void setUp() throws Exception {
6464
}
6565

6666
@Test
67-
public void testHandleBarBaz() throws Exception {
67+
void testHandleBarBaz() throws Exception {
6868
Throwable t = assertThrows(Throwable.class, () -> context.getValue("bar/baz"), "expected Throwable");
6969
while (t != null) {
7070
if ("baz unavailable".equals(t.getMessage())) {
@@ -76,7 +76,7 @@ public void testHandleBarBaz() throws Exception {
7676
}
7777

7878
@Test
79-
public void testHandleFoo() throws Exception {
79+
void testHandleFoo() throws Exception {
8080
Throwable t = assertThrows(Throwable.class, () -> context.getValue("foo"), "expected Throwable");
8181
while (t != null) {
8282
if ("foo unavailable".equals(t.getMessage())) {

0 commit comments

Comments
 (0)