@@ -60,9 +60,12 @@ public void setup() throws IOException {
60
60
temporaryFolder .create ();
61
61
}
62
62
63
+ /**
64
+ * @noinspection JUnitTestMethodWithNoAssertions
65
+ */
63
66
@ Test
64
67
public void testGenerateOnlyBreakingCompatibility () throws Exception {
65
- final List <String > errors = MainProcess .run (
68
+ final List <String > errors = MainProcess .runMainProcess (
66
69
createNotes (createAllNotes (), null , null , null , null ), createBaseCliOptions ()
67
70
.setGenerateAll (true ).build ());
68
71
@@ -75,9 +78,12 @@ public void testGenerateOnlyBreakingCompatibility() throws Exception {
75
78
assertFile ("githubPageBreakingCompatibility.txt" , MainProcess .GITHUB_FILENAME );
76
79
}
77
80
81
+ /**
82
+ * @noinspection JUnitTestMethodWithNoAssertions
83
+ */
78
84
@ Test
79
85
public void testGenerateOnlyNewFeature () throws Exception {
80
- final List <String > errors = MainProcess .run (
86
+ final List <String > errors = MainProcess .runMainProcess (
81
87
createNotes (null , createAllNotes (), null , null , null ), createBaseCliOptions ()
82
88
.setGenerateAll (true ).build ());
83
89
@@ -90,9 +96,12 @@ public void testGenerateOnlyNewFeature() throws Exception {
90
96
assertFile ("githubPageNew.txt" , MainProcess .GITHUB_FILENAME );
91
97
}
92
98
99
+ /**
100
+ * @noinspection JUnitTestMethodWithNoAssertions
101
+ */
93
102
@ Test
94
103
public void testGenerateOnlyBug () throws Exception {
95
- final List <String > errors = MainProcess .run (
104
+ final List <String > errors = MainProcess .runMainProcess (
96
105
createNotes (null , null , createAllNotes (), null , null ), createBaseCliOptions ()
97
106
.setGenerateAll (true ).build ());
98
107
@@ -105,9 +114,12 @@ public void testGenerateOnlyBug() throws Exception {
105
114
assertFile ("githubPageBug.txt" , MainProcess .GITHUB_FILENAME );
106
115
}
107
116
117
+ /**
118
+ * @noinspection JUnitTestMethodWithNoAssertions
119
+ */
108
120
@ Test
109
121
public void testGenerateOnlyMisc () throws Exception {
110
- final List <String > errors = MainProcess .run (
122
+ final List <String > errors = MainProcess .runMainProcess (
111
123
createNotes (null , null , null , createAllNotes (), null ), createBaseCliOptions ()
112
124
.setGenerateAll (true ).build ());
113
125
@@ -119,9 +131,12 @@ public void testGenerateOnlyMisc() throws Exception {
119
131
assertFile ("rssMlistMisc.txt" , MainProcess .MLIST_FILENAME );
120
132
}
121
133
134
+ /**
135
+ * @noinspection JUnitTestMethodWithNoAssertions
136
+ */
122
137
@ Test
123
138
public void testGenerateOnlyNewModule () throws Exception {
124
- final List <String > errors = MainProcess .run (
139
+ final List <String > errors = MainProcess .runMainProcess (
125
140
createNotes (null , null , null , null , createAllNotes ()), createBaseCliOptions ()
126
141
.setGenerateAll (true ).build ());
127
142
@@ -134,9 +149,12 @@ public void testGenerateOnlyNewModule() throws Exception {
134
149
assertFile ("githubPageNew.txt" , MainProcess .GITHUB_FILENAME );
135
150
}
136
151
152
+ /**
153
+ * @noinspection JUnitTestMethodWithNoAssertions
154
+ */
137
155
@ Test
138
156
public void testGenerateAll () throws Exception {
139
- final List <String > errors = MainProcess .run (
157
+ final List <String > errors = MainProcess .runMainProcess (
140
158
createNotes (
141
159
Collections .singletonList (createReleaseNotesMessage ("Title 1" , "Author 1" )),
142
160
Collections .singletonList (createReleaseNotesMessage (2 , "Title 2" , "Author 2" )),
@@ -154,9 +172,12 @@ public void testGenerateAll() throws Exception {
154
172
assertFile ("githubPageAll.txt" , MainProcess .GITHUB_FILENAME );
155
173
}
156
174
175
+ /**
176
+ * @noinspection JUnitTestMethodWithNoAssertions
177
+ */
157
178
@ Test
158
179
public void testGenerateOnlyXdoc () throws Exception {
159
- final List <String > errors = MainProcess .run (
180
+ final List <String > errors = MainProcess .runMainProcess (
160
181
createNotes (createAllNotes (), null , null , null , null ), createBaseCliOptions ()
161
182
.setGenerateXdoc (true ).build ());
162
183
@@ -169,9 +190,12 @@ public void testGenerateOnlyXdoc() throws Exception {
169
190
assertFile (MainProcess .GITHUB_FILENAME );
170
191
}
171
192
193
+ /**
194
+ * @noinspection JUnitTestMethodWithNoAssertions
195
+ */
172
196
@ Test
173
197
public void testGenerateOnlyTwitter () throws Exception {
174
- final List <String > errors = MainProcess .run (
198
+ final List <String > errors = MainProcess .runMainProcess (
175
199
createNotes (createAllNotes (), null , null , null , null ), createBaseCliOptions ()
176
200
.setGenerateTw (true ).build ());
177
201
@@ -184,9 +208,12 @@ public void testGenerateOnlyTwitter() throws Exception {
184
208
assertFile (MainProcess .GITHUB_FILENAME );
185
209
}
186
210
211
+ /**
212
+ * @noinspection JUnitTestMethodWithNoAssertions
213
+ */
187
214
@ Test
188
215
public void testGenerateOnlyRss () throws Exception {
189
- final List <String > errors = MainProcess .run (
216
+ final List <String > errors = MainProcess .runMainProcess (
190
217
createNotes (createAllNotes (), null , null , null , null ), createBaseCliOptions ()
191
218
.setGenerateRss (true ).build ());
192
219
@@ -199,9 +226,12 @@ public void testGenerateOnlyRss() throws Exception {
199
226
assertFile (MainProcess .GITHUB_FILENAME );
200
227
}
201
228
229
+ /**
230
+ * @noinspection JUnitTestMethodWithNoAssertions
231
+ */
202
232
@ Test
203
233
public void testGenerateOnlyMlist () throws Exception {
204
- final List <String > errors = MainProcess .run (
234
+ final List <String > errors = MainProcess .runMainProcess (
205
235
createNotes (createAllNotes (), null , null , null , null ), createBaseCliOptions ()
206
236
.setGenerateMlist (true ).build ());
207
237
@@ -214,6 +244,9 @@ public void testGenerateOnlyMlist() throws Exception {
214
244
assertFile ("rssMlistBreakingCompatibility.txt" , MainProcess .MLIST_FILENAME );
215
245
}
216
246
247
+ /**
248
+ * @noinspection JUnitTestMethodWithNoAssertions
249
+ */
217
250
@ Test
218
251
public void testGenerateOnlyGitHub () throws Exception {
219
252
final List <String > errors = MainProcess .run (
@@ -235,7 +268,7 @@ public void testGenerateCustomTemplate() throws Exception {
235
268
FileUtils .writeStringToFile (file , "hello world" );
236
269
final String template = file .getAbsolutePath ();
237
270
238
- final List <String > errors = MainProcess .run (
271
+ final List <String > errors = MainProcess .runMainProcess (
239
272
createNotes (createAllNotes (), createAllNotes (), createAllNotes (), createAllNotes (),
240
273
createAllNotes ()),
241
274
createBaseCliOptions ().setGenerateAll (true ).setXdocTemplate (template )
@@ -328,15 +361,17 @@ private void assertFile(String expectedName, String actualName) throws IOExcepti
328
361
.format (DateTimeFormatter .ofPattern ("dd.MM.yyyy" , Locale .US )),
329
362
"XX.XX.XXXX" );
330
363
331
- Assert .assertEquals (expectedXdoc , actualXdoc );
364
+ Assert .assertEquals ("Actual filename does not match expected filename" ,
365
+ expectedXdoc , actualXdoc );
332
366
}
333
367
334
368
private void assertFile (String actualName ) {
335
- Assert .assertFalse (new File (temporaryFolder .getRoot (), actualName ).exists ());
369
+ Assert .assertFalse ("File does not exist." ,
370
+ new File (temporaryFolder .getRoot (), actualName ).exists ());
336
371
}
337
372
338
373
private static String getFileContents (File file ) throws IOException {
339
- final StringBuilder result = new StringBuilder ();
374
+ final StringBuilder result = new StringBuilder (1024 );
340
375
341
376
try (BufferedReader br = Files .newBufferedReader (file .toPath ())) {
342
377
do {
0 commit comments