3232import com .github .javaparser .ast .visitor .VoidVisitorAdapter ;
3333import org .apache .commons .lang3 .ClassUtils ;
3434import org .apache .commons .lang3 .StringUtils ;
35+ import org .junit .Assert ;
36+ import org .junit .Assume ;
3537import org .junit .Test ;
3638import org .lightjason .agentspeak .common .CCommon ;
3739
6365import java .util .stream .Stream ;
6466
6567import static org .junit .Assert .assertFalse ;
66- import static org .junit .Assert .assertTrue ;
6768import static org .junit .Assume .assumeTrue ;
6869
6970
7071/**
7172 * test all resource strings
7273 */
73- public final class CLanguageLabel extends IBaseTest
74+ public final class TestCLanguageLabel extends IBaseTest
7475{
7576 /**
7677 * classpath separator
@@ -91,7 +92,7 @@ public final class CLanguageLabel extends IBaseTest
9192 URI l_uri = null ;
9293 try
9394 {
94- l_uri = CLanguageLabel .concaturl ( CLanguageLabel .resourceurl (), "../../src/main/java/" ).toURI ();
95+ l_uri = TestCLanguageLabel .concaturl ( TestCLanguageLabel .resourceurl (), "../../src/main/java/" ).toURI ();
9596 }
9697 catch ( final Exception l_exception )
9798 {
@@ -108,8 +109,8 @@ public final class CLanguageLabel extends IBaseTest
108109 {
109110 LANGUAGEPROPERY .put (
110111 l_languages [i ],
111- CLanguageLabel .concaturl (
112- CLanguageLabel .resourceurl (),
112+ TestCLanguageLabel .concaturl (
113+ TestCLanguageLabel .resourceurl (),
113114 MessageFormat .format (
114115 "{0}/{1}/{2}" ,
115116 l_resource ,
@@ -183,7 +184,8 @@ public void testTranslation()
183184 @ Test
184185 public void testResourceString () throws IOException
185186 {
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 () ) );
187189
188190 final Set <String > l_ignoredlabel = new HashSet <>();
189191
@@ -202,7 +204,7 @@ public void testResourceString() throws IOException
202204 }
203205 catch ( final IOException l_excpetion )
204206 {
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 () ) );
206208 return Stream .empty ();
207209 }
208210 catch ( final ParseProblemException l_exception )
@@ -239,7 +241,7 @@ public void testResourceString() throws IOException
239241 );
240242
241243 // --- 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 () );
243245
244246 // --- check label towards the property definition
245247 if ( l_ignoredlabel .size () > 0 )
@@ -261,7 +263,7 @@ public void testResourceString() throws IOException
261263
262264 // --- check if all property items are within the parsed labels
263265 l_parseditems .removeAll ( l_propertyitems );
264- assertTrue (
266+ Assert . assertTrue (
265267 MessageFormat .format (
266268 "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}" ,
267269 k ,
@@ -280,7 +282,7 @@ public void testResourceString() throws IOException
280282 .allMatch ( l -> false )
281283 )
282284 .collect ( Collectors .toSet () );
283- assertTrue (
285+ Assert . assertTrue (
284286 MessageFormat .format (
285287 "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}" ,
286288 k ,
@@ -292,7 +294,7 @@ public void testResourceString() throws IOException
292294 }
293295 catch ( final IOException l_exception )
294296 {
295- assertTrue ( MessageFormat .format ( "io exception: {0}" , l_exception .getMessage () ), false );
297+ Assert . fail ( MessageFormat .format ( "io exception: {0}" , l_exception .getMessage () ) );
296298 }
297299 } );
298300 }
0 commit comments