Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a1f0a3

Browse filesBrowse files
committed
Cleanup tests
1 parent f6fc5ed commit 5a1f0a3
Copy full SHA for 5a1f0a3
Expand file treeCollapse file tree

16 files changed

+460
-454
lines changed

‎src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java
+16-15Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* @version $Id: $Id
4646
* @since 3.4.0
4747
*/
48-
public class PrettyPrintXMLWriterTest {
48+
class PrettyPrintXMLWriterTest {
4949
StringWriter w;
5050

5151
PrettyPrintXMLWriter writer;
@@ -54,15 +54,15 @@ public class PrettyPrintXMLWriterTest {
5454
* <p>setUp.</p>
5555
*/
5656
@BeforeEach
57-
public void setUp() {
57+
void setUp() {
5858
initWriter();
5959
}
6060

6161
/**
6262
* <p>tearDown.</p>
6363
*/
6464
@AfterEach
65-
public void tearDown() {
65+
void tearDown() {
6666
writer = null;
6767
w = null;
6868
}
@@ -76,7 +76,7 @@ private void initWriter() {
7676
* <p>testDefaultPrettyPrintXMLWriter.</p>
7777
*/
7878
@Test
79-
public void testDefaultPrettyPrintXMLWriter() {
79+
void defaultPrettyPrintXMLWriter() {
8080
writer.startElement(Tag.HTML.toString());
8181

8282
writeXhtmlHead(writer);
@@ -92,7 +92,7 @@ public void testDefaultPrettyPrintXMLWriter() {
9292
* <p>testPrettyPrintXMLWriterWithGivenLineSeparator.</p>
9393
*/
9494
@Test
95-
public void testPrettyPrintXMLWriterWithGivenLineSeparator() {
95+
void prettyPrintXMLWriterWithGivenLineSeparator() {
9696
writer.setLineSeparator("\n");
9797

9898
writer.startElement(Tag.HTML.toString());
@@ -110,7 +110,7 @@ public void testPrettyPrintXMLWriterWithGivenLineSeparator() {
110110
* <p>testPrettyPrintXMLWriterWithGivenLineIndenter.</p>
111111
*/
112112
@Test
113-
public void testPrettyPrintXMLWriterWithGivenLineIndenter() {
113+
void prettyPrintXMLWriterWithGivenLineIndenter() {
114114
writer.setLineIndenter(" ");
115115

116116
writer.startElement(Tag.HTML.toString());
@@ -128,7 +128,7 @@ public void testPrettyPrintXMLWriterWithGivenLineIndenter() {
128128
* <p>testEscapeXmlAttribute.</p>
129129
*/
130130
@Test
131-
public void testEscapeXmlAttribute() {
131+
void escapeXmlAttribute() {
132132
// Windows
133133
writer.startElement(Tag.DIV.toString());
134134
writer.addAttribute("class", "sect\r\nion");
@@ -154,13 +154,14 @@ public void testEscapeXmlAttribute() {
154154
* <p>testendElementAlreadyClosed.</p>
155155
*/
156156
@Test
157-
public void testendElementAlreadyClosed() {
158-
assertThrows(NoSuchElementException.class, () -> {
159-
writer.startElement(Tag.DIV.toString());
160-
writer.addAttribute("class", "someattribute");
161-
writer.endElement(); // Tag.DIV closed
162-
writer.endElement(); // Tag.DIV already closed, and there is no other outer tag!
163-
});
157+
void testendElementAlreadyClosed() {
158+
writer.startElement(Tag.DIV.toString());
159+
writer.addAttribute("class", "someattribute");
160+
writer.endElement();
161+
assertThrows(
162+
NoSuchElementException.class,
163+
() -> // Tag.DIV closed
164+
writer.endElement());
164165
}
165166

166167
/**
@@ -173,7 +174,7 @@ public void testendElementAlreadyClosed() {
173174
*/
174175
@Disabled("This test is only relevant on JDK 1.7, which is not supported anymore")
175176
@Test
176-
public void testIssue51DetectJava7ConcatenationBug() throws IOException {
177+
void issue51DetectJava7ConcatenationBug() throws IOException {
177178
File dir = new File("target/test-xml");
178179
if (!dir.exists()) {
179180
assertTrue(dir.mkdir(), "cannot create directory test-xml");

‎src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java
+14-14Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* @version $Id: $Id
3636
* @since 3.4.0
3737
*/
38-
public class XmlStreamReaderTest {
38+
class XmlStreamReaderTest {
3939
/** french */
4040
private static final String TEXT_LATIN1 = "eacute: \u00E9";
4141

@@ -115,7 +115,7 @@ private static void checkXmlStreamReader(String text, String encoding, String ef
115115
* @throws java.io.IOException if any.
116116
*/
117117
@Test
118-
public void testNoXmlHeader() throws IOException {
118+
void noXmlHeader() throws IOException {
119119
String xml = "<text>text with no XML header</text>";
120120
checkXmlContent(xml, "UTF-8");
121121
checkXmlContent(xml, "UTF-8", BOM_UTF8);
@@ -127,7 +127,7 @@ public void testNoXmlHeader() throws IOException {
127127
* @throws java.io.IOException if any.
128128
*/
129129
@Test
130-
public void testDefaultEncoding() throws IOException {
130+
void defaultEncoding() throws IOException {
131131
checkXmlStreamReader(TEXT_UNICODE, null, "UTF-8");
132132
checkXmlStreamReader(TEXT_UNICODE, null, "UTF-8", BOM_UTF8);
133133
}
@@ -138,7 +138,7 @@ public void testDefaultEncoding() throws IOException {
138138
* @throws java.io.IOException if any.
139139
*/
140140
@Test
141-
public void testUTF8Encoding() throws IOException {
141+
void utf8Encoding() throws IOException {
142142
checkXmlStreamReader(TEXT_UNICODE, "UTF-8");
143143
checkXmlStreamReader(TEXT_UNICODE, "UTF-8", BOM_UTF8);
144144
}
@@ -149,7 +149,7 @@ public void testUTF8Encoding() throws IOException {
149149
* @throws java.io.IOException if any.
150150
*/
151151
@Test
152-
public void testUTF16Encoding() throws IOException {
152+
void utf16Encoding() throws IOException {
153153
checkXmlStreamReader(TEXT_UNICODE, "UTF-16", "UTF-16BE", null);
154154
checkXmlStreamReader(TEXT_UNICODE, "UTF-16", "UTF-16LE", BOM_UTF16LE);
155155
checkXmlStreamReader(TEXT_UNICODE, "UTF-16", "UTF-16BE", BOM_UTF16BE);
@@ -161,7 +161,7 @@ public void testUTF16Encoding() throws IOException {
161161
* @throws java.io.IOException if any.
162162
*/
163163
@Test
164-
public void testUTF16BEEncoding() throws IOException {
164+
void utf16beEncoding() throws IOException {
165165
checkXmlStreamReader(TEXT_UNICODE, "UTF-16BE");
166166
}
167167

@@ -171,7 +171,7 @@ public void testUTF16BEEncoding() throws IOException {
171171
* @throws java.io.IOException if any.
172172
*/
173173
@Test
174-
public void testUTF16LEEncoding() throws IOException {
174+
void utf16leEncoding() throws IOException {
175175
checkXmlStreamReader(TEXT_UNICODE, "UTF-16LE");
176176
}
177177

@@ -181,7 +181,7 @@ public void testUTF16LEEncoding() throws IOException {
181181
* @throws java.io.IOException if any.
182182
*/
183183
@Test
184-
public void testLatin1Encoding() throws IOException {
184+
void latin1Encoding() throws IOException {
185185
checkXmlStreamReader(TEXT_LATIN1, "ISO-8859-1");
186186
}
187187

@@ -191,7 +191,7 @@ public void testLatin1Encoding() throws IOException {
191191
* @throws java.io.IOException if any.
192192
*/
193193
@Test
194-
public void testLatin7Encoding() throws IOException {
194+
void latin7Encoding() throws IOException {
195195
checkXmlStreamReader(TEXT_LATIN7, "ISO-8859-7");
196196
}
197197

@@ -201,7 +201,7 @@ public void testLatin7Encoding() throws IOException {
201201
* @throws java.io.IOException if any.
202202
*/
203203
@Test
204-
public void testLatin15Encoding() throws IOException {
204+
void latin15Encoding() throws IOException {
205205
checkXmlStreamReader(TEXT_LATIN15, "ISO-8859-15");
206206
}
207207

@@ -211,7 +211,7 @@ public void testLatin15Encoding() throws IOException {
211211
* @throws java.io.IOException if any.
212212
*/
213213
@Test
214-
public void testEUC_JPEncoding() throws IOException {
214+
void euc_jpEncoding() throws IOException {
215215
checkXmlStreamReader(TEXT_EUC_JP, "EUC-JP");
216216
}
217217

@@ -221,7 +221,7 @@ public void testEUC_JPEncoding() throws IOException {
221221
* @throws java.io.IOException if any.
222222
*/
223223
@Test
224-
public void testEBCDICEncoding() throws IOException {
224+
void ebcdicEncoding() throws IOException {
225225
checkXmlStreamReader("simple text in EBCDIC", "CP1047");
226226
}
227227

@@ -231,7 +231,7 @@ public void testEBCDICEncoding() throws IOException {
231231
* @throws java.io.IOException if any.
232232
*/
233233
@Test
234-
public void testInappropriateEncoding() throws IOException {
234+
void inappropriateEncoding() throws IOException {
235235
// expected failure, since the encoding does not contain some characters
236236
assertThrows(
237237
AssertionFailedError.class,
@@ -245,7 +245,7 @@ public void testInappropriateEncoding() throws IOException {
245245
* @throws java.io.IOException if any.
246246
*/
247247
@Test
248-
public void testEncodingAttribute() throws IOException {
248+
void encodingAttribute() throws IOException {
249249
String xml = "<?xml version='1.0' encoding='US-ASCII'?><element encoding='attribute value'/>";
250250
checkXmlContent(xml, "US-ASCII");
251251

‎src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* @version $Id: $Id
3131
* @since 3.4.0
3232
*/
33-
public class XmlStreamWriterTest {
33+
class XmlStreamWriterTest {
3434
/** french */
3535
private static final String TEXT_LATIN1 = "eacute: \u00E9";
3636

@@ -78,7 +78,7 @@ private static void checkXmlWriter(String text, String encoding) throws IOExcept
7878
* @throws java.io.IOException if any.
7979
*/
8080
@Test
81-
public void testNoXmlHeader() throws IOException {
81+
void noXmlHeader() throws IOException {
8282
String xml = "<text>text with no XML header</text>";
8383
checkXmlContent(xml, "UTF-8");
8484
}
@@ -89,7 +89,7 @@ public void testNoXmlHeader() throws IOException {
8989
* @throws java.io.IOException if any.
9090
*/
9191
@Test
92-
public void testEmpty() throws IOException {
92+
void empty() throws IOException {
9393
ByteArrayOutputStream out = new ByteArrayOutputStream();
9494
XmlStreamWriter writer = new XmlStreamWriter(out);
9595
writer.flush();
@@ -106,7 +106,7 @@ public void testEmpty() throws IOException {
106106
* @throws java.io.IOException if any.
107107
*/
108108
@Test
109-
public void testDefaultEncoding() throws IOException {
109+
void defaultEncoding() throws IOException {
110110
checkXmlWriter(TEXT_UNICODE, null);
111111
}
112112

@@ -116,7 +116,7 @@ public void testDefaultEncoding() throws IOException {
116116
* @throws java.io.IOException if any.
117117
*/
118118
@Test
119-
public void testUTF8Encoding() throws IOException {
119+
void utf8Encoding() throws IOException {
120120
checkXmlWriter(TEXT_UNICODE, "UTF-8");
121121
}
122122

@@ -126,7 +126,7 @@ public void testUTF8Encoding() throws IOException {
126126
* @throws java.io.IOException if any.
127127
*/
128128
@Test
129-
public void testUTF16Encoding() throws IOException {
129+
void utf16Encoding() throws IOException {
130130
checkXmlWriter(TEXT_UNICODE, "UTF-16");
131131
}
132132

@@ -136,7 +136,7 @@ public void testUTF16Encoding() throws IOException {
136136
* @throws java.io.IOException if any.
137137
*/
138138
@Test
139-
public void testUTF16BEEncoding() throws IOException {
139+
void utf16beEncoding() throws IOException {
140140
checkXmlWriter(TEXT_UNICODE, "UTF-16BE");
141141
}
142142

@@ -146,7 +146,7 @@ public void testUTF16BEEncoding() throws IOException {
146146
* @throws java.io.IOException if any.
147147
*/
148148
@Test
149-
public void testUTF16LEEncoding() throws IOException {
149+
void utf16leEncoding() throws IOException {
150150
checkXmlWriter(TEXT_UNICODE, "UTF-16LE");
151151
}
152152

@@ -156,7 +156,7 @@ public void testUTF16LEEncoding() throws IOException {
156156
* @throws java.io.IOException if any.
157157
*/
158158
@Test
159-
public void testLatin1Encoding() throws IOException {
159+
void latin1Encoding() throws IOException {
160160
checkXmlWriter(TEXT_LATIN1, "ISO-8859-1");
161161
}
162162

@@ -166,7 +166,7 @@ public void testLatin1Encoding() throws IOException {
166166
* @throws java.io.IOException if any.
167167
*/
168168
@Test
169-
public void testLatin7Encoding() throws IOException {
169+
void latin7Encoding() throws IOException {
170170
checkXmlWriter(TEXT_LATIN7, "ISO-8859-7");
171171
}
172172

@@ -176,7 +176,7 @@ public void testLatin7Encoding() throws IOException {
176176
* @throws java.io.IOException if any.
177177
*/
178178
@Test
179-
public void testLatin15Encoding() throws IOException {
179+
void latin15Encoding() throws IOException {
180180
checkXmlWriter(TEXT_LATIN15, "ISO-8859-15");
181181
}
182182

@@ -186,7 +186,7 @@ public void testLatin15Encoding() throws IOException {
186186
* @throws java.io.IOException if any.
187187
*/
188188
@Test
189-
public void testEUC_JPEncoding() throws IOException {
189+
void euc_jpEncoding() throws IOException {
190190
checkXmlWriter(TEXT_EUC_JP, "EUC-JP");
191191
}
192192

@@ -196,7 +196,7 @@ public void testEUC_JPEncoding() throws IOException {
196196
* @throws java.io.IOException if any.
197197
*/
198198
@Test
199-
public void testEBCDICEncoding() throws IOException {
199+
void ebcdicEncoding() throws IOException {
200200
checkXmlWriter("simple text in EBCDIC", "CP1047");
201201
}
202202
}

‎src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
import org.codehaus.plexus.util.StringUtils;
3030
import org.junit.jupiter.api.Test;
3131

32-
import static org.junit.jupiter.api.Assertions.*;
32+
import static org.junit.jupiter.api.Assertions.assertNotNull;
33+
import static org.junit.jupiter.api.Assertions.assertTrue;
3334

3435
/**
3536
* Test the {@link org.codehaus.plexus.util.xml.XmlUtil} class.
@@ -68,7 +69,7 @@ private File getTestOutputFile(String relPath) throws IOException {
6869
* @throws java.lang.Exception if any.
6970
*/
7071
@Test
71-
public void testPrettyFormatInputStreamOutputStream() throws Exception {
72+
void prettyFormatInputStreamOutputStream() throws Exception {
7273
File testDocument = new File(getBasedir(), "src/test/resources/testDocument.xhtml");
7374
assertTrue(testDocument.exists());
7475

@@ -89,7 +90,7 @@ public void testPrettyFormatInputStreamOutputStream() throws Exception {
8990
* @throws java.lang.Exception if any.
9091
*/
9192
@Test
92-
public void testPrettyFormatReaderWriter() throws Exception {
93+
void prettyFormatReaderWriter() throws Exception {
9394
File testDocument = new File(getBasedir(), "src/test/resources/testDocument.xhtml");
9495
assertTrue(testDocument.exists());
9596

@@ -109,7 +110,7 @@ public void testPrettyFormatReaderWriter() throws Exception {
109110
* @throws java.lang.Exception if any.
110111
*/
111112
@Test
112-
public void testPrettyFormatString() throws Exception {
113+
void prettyFormatString() throws Exception {
113114
File testDocument = new File(getBasedir(), "src/test/resources/testDocument.xhtml");
114115
assertTrue(testDocument.exists());
115116

@@ -135,7 +136,7 @@ public void testPrettyFormatString() throws Exception {
135136
* @throws java.lang.Exception if any.
136137
*/
137138
@Test
138-
public void testPrettyFormatReaderWriter2() throws Exception {
139+
void prettyFormatReaderWriter2() throws Exception {
139140
File testDocument = new File(getBasedir(), "src/test/resources/test.xdoc.xhtml");
140141
assertTrue(testDocument.exists());
141142

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.