32
32
import com .github .javaparser .ast .visitor .VoidVisitorAdapter ;
33
33
import org .apache .commons .lang3 .ClassUtils ;
34
34
import org .apache .commons .lang3 .StringUtils ;
35
+ import org .junit .Assert ;
36
+ import org .junit .Assume ;
35
37
import org .junit .Test ;
36
38
import org .lightjason .agentspeak .common .CCommon ;
37
39
63
65
import java .util .stream .Stream ;
64
66
65
67
import static org .junit .Assert .assertFalse ;
66
- import static org .junit .Assert .assertTrue ;
67
68
import static org .junit .Assume .assumeTrue ;
68
69
69
70
@@ -183,7 +184,8 @@ public void testTranslation()
183
184
@ Test
184
185
public void testResourceString () throws IOException
185
186
{
186
- assumeTrue ( "no languages are defined for checking" , !LANGUAGEPROPERY .isEmpty () );
187
+ Assume .assumeTrue ( "no languages are defined for checking" , !LANGUAGEPROPERY .isEmpty () );
188
+ Assume .assumeTrue ( "language files does not exist" , LANGUAGEPROPERY .values ().stream ().anyMatch ( i -> new File ( i ).isFile () ) );
187
189
188
190
final Set <String > l_ignoredlabel = new HashSet <>();
189
191
@@ -202,7 +204,7 @@ public void testResourceString() throws IOException
202
204
}
203
205
catch ( final IOException l_excpetion )
204
206
{
205
- assertTrue ( MessageFormat .format ( "io error on file [{0}]: {1}" , i , l_excpetion .getMessage () ), false );
207
+ Assert . fail ( MessageFormat .format ( "io error on file [{0}]: {1}" , i , l_excpetion .getMessage () ) );
206
208
return Stream .empty ();
207
209
}
208
210
catch ( final ParseProblemException l_exception )
@@ -239,7 +241,7 @@ public void testResourceString() throws IOException
239
241
);
240
242
241
243
// --- check of any label is found
242
- assertFalse ( "translation labels are empty, check naming of translation method" , l_label .isEmpty () );
244
+ Assert . assertFalse ( "translation labels are empty, check naming of translation method" , l_label .isEmpty () );
243
245
244
246
// --- check label towards the property definition
245
247
if ( l_ignoredlabel .size () > 0 )
@@ -261,7 +263,7 @@ public void testResourceString() throws IOException
261
263
262
264
// --- check if all property items are within the parsed labels
263
265
l_parseditems .removeAll ( l_propertyitems );
264
- assertTrue (
266
+ Assert . assertTrue (
265
267
MessageFormat .format (
266
268
"the following {1,choice,1#key|1<keys} in language [{0}] {1,choice,1#is|1<are} not existing within the language file:\n {2}" ,
267
269
k ,
@@ -280,7 +282,7 @@ public void testResourceString() throws IOException
280
282
.allMatch ( l -> false )
281
283
)
282
284
.collect ( Collectors .toSet () );
283
- assertTrue (
285
+ Assert . assertTrue (
284
286
MessageFormat .format (
285
287
"the following {1,choice,1#key|1<keys} in language [{0}] {1,choice,1#is|1<are} not existing within the source code:\n {2}" ,
286
288
k ,
@@ -292,7 +294,7 @@ public void testResourceString() throws IOException
292
294
}
293
295
catch ( final IOException l_exception )
294
296
{
295
- assertTrue ( MessageFormat .format ( "io exception: {0}" , l_exception .getMessage () ), false );
297
+ Assert . fail ( MessageFormat .format ( "io exception: {0}" , l_exception .getMessage () ) );
296
298
}
297
299
} );
298
300
}
0 commit comments