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 ;
37- import org .junit .Test ;
35+ import org .junit .jupiter . api . Assertions ;
36+ import org .junit .jupiter . api . Assumptions ;
37+ import org .junit .jupiter . api . Test ;
3838import org .lightjason .agentspeak .common .CCommon ;
3939
4040import javax .annotation .Nonnull ;
6565import java .util .stream .IntStream ;
6666import java .util .stream .Stream ;
6767
68- import static org .junit .Assert .assertFalse ;
69- import static org .junit .Assume .assumeTrue ;
70-
71-
7268/**
7369 * test all resource strings
7470 */
@@ -97,7 +93,7 @@ public final class TestCLanguageLabel extends IBaseTest
9793 }
9894 catch ( final Exception l_exception )
9995 {
100- assumeTrue ( MessageFormat .format ( "source directory cannot be read: {0}" , l_exception .getMessage () ), false );
96+ Assumptions . assumeTrue ( false , MessageFormat .format ( "source directory cannot be read: {0}" , l_exception .getMessage () ) );
10197 }
10298
10399 // read all possible languages and define the first as default
@@ -128,7 +124,7 @@ public final class TestCLanguageLabel extends IBaseTest
128124 }
129125 catch ( final Exception l_exception )
130126 {
131- assumeTrue ( MessageFormat .format ( "source directory cannot be read: {0}" , l_exception .getMessage () ), false );
127+ Assumptions . assumeTrue ( false , MessageFormat .format ( "source directory cannot be read: {0}" , l_exception .getMessage () ) );
132128 }
133129 } );
134130
@@ -141,7 +137,7 @@ public final class TestCLanguageLabel extends IBaseTest
141137 @ Test
142138 public void testTranslation ()
143139 {
144- assumeTrue ( "no languages are defined for checking" , ! LANGUAGEPROPERY . isEmpty () );
140+ Assumptions . assumeTrue ( ! LANGUAGEPROPERY . isEmpty (), "no languages are defined for checking" );
145141
146142 // --- read language definitions of the configuration
147143 final Set <String > l_translation = Collections .unmodifiableSet (
@@ -154,26 +150,26 @@ public void testTranslation()
154150 // --- check if a test (language resource) exists for each definied language
155151 final Set <String > l_translationtesting = new HashSet <>( l_translation );
156152 l_translationtesting .removeAll ( LANGUAGEPROPERY .keySet () );
157- assertFalse (
153+ Assertions .assertFalse (
154+ !l_translationtesting .isEmpty (),
158155 MessageFormat .format (
159156 "configuration defines {1,choice,1#translation|1<translations} {0} that {1,choice,1#is|1<are} not tested" ,
160157 l_translationtesting ,
161158 l_translationtesting .size ()
162- ),
163- !l_translationtesting .isEmpty ()
159+ )
164160 );
165161
166162
167163 // --- check unused language resource files
168164 final Set <String > l_translationusing = new HashSet <>( LANGUAGEPROPERY .keySet () );
169165 l_translationusing .removeAll ( l_translation );
170- assertFalse (
166+ Assertions .assertFalse (
167+ !l_translationusing .isEmpty (),
171168 MessageFormat .format (
172169 "{1,choice,1#translation|1<translations} {0} {1,choice,1#is|1<are} checked, which will not be used within the package configuration" ,
173170 l_translationusing ,
174171 l_translationusing .size ()
175- ),
176- !l_translationusing .isEmpty ()
172+ )
177173 );
178174 }
179175
@@ -185,8 +181,8 @@ public void testTranslation()
185181 @ Test
186182 public void testResourceString () throws IOException
187183 {
188- Assume .assumeTrue ( "no languages are defined for checking" , ! LANGUAGEPROPERY . isEmpty () );
189- Assume .assumeTrue ( "language files does not exist" , LANGUAGEPROPERY .values ().stream ().anyMatch ( i -> new File ( i ).isFile () ) );
184+ Assumptions .assumeTrue ( ! LANGUAGEPROPERY . isEmpty (), "no languages are defined for checking" );
185+ Assumptions .assumeTrue ( LANGUAGEPROPERY .values ().stream ().anyMatch ( i -> new File ( i ).isFile () ), "language files does not exist" );
190186
191187 final Set <String > l_ignoredlabel = new HashSet <>();
192188
@@ -197,7 +193,7 @@ public void testResourceString() throws IOException
197193 .flatMap ( i -> labels ( i , l_ignoredlabel ) ).collect ( Collectors .toUnmodifiableSet () );
198194
199195 // --- check of any label is found
200- Assert .assertFalse ( "translation labels are empty, check naming of translation method" , l_label . isEmpty () );
196+ Assertions .assertFalse ( l_label . isEmpty (), "translation labels are empty, check naming of translation method" );
201197
202198 // --- check label towards the property definition
203199 if ( l_ignoredlabel .size () > 0 )
@@ -219,14 +215,14 @@ public void testResourceString() throws IOException
219215
220216 // --- check if all property items are within the parsed labels
221217 l_parseditems .removeAll ( l_propertyitems );
222- Assert .assertTrue (
218+ Assertions .assertTrue (
219+ l_parseditems .isEmpty (),
223220 MessageFormat .format (
224221 "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}" ,
225222 k ,
226223 l_parseditems .size (),
227224 StringUtils .join ( l_parseditems , ", " )
228- ),
229- l_parseditems .isEmpty ()
225+ )
230226 );
231227
232228
@@ -238,19 +234,19 @@ public void testResourceString() throws IOException
238234 .allMatch ( l -> false )
239235 )
240236 .collect ( Collectors .toSet () );
241- Assert .assertTrue (
237+ Assertions .assertTrue (
238+ l_ignoredpropertyitems .isEmpty (),
242239 MessageFormat .format (
243240 "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}" ,
244241 k ,
245242 l_ignoredpropertyitems .size (),
246243 StringUtils .join ( l_ignoredpropertyitems , ", " )
247- ),
248- l_ignoredpropertyitems .isEmpty ()
244+ )
249245 );
250246 }
251247 catch ( final IOException l_exception )
252248 {
253- Assert .fail ( MessageFormat .format ( "io exception: {0}" , l_exception .getMessage () ) );
249+ Assertions .fail ( MessageFormat .format ( "io exception: {0}" , l_exception .getMessage () ) );
254250 }
255251 } );
256252 }
@@ -272,7 +268,7 @@ private static Stream<String> labels( @Nonnull final Path p_file, @Nonnull final
272268 }
273269 catch ( final IOException l_excpetion )
274270 {
275- Assert .fail ( MessageFormat .format ( "io error on file [{0}]: {1}" , p_file , l_excpetion .getMessage () ) );
271+ Assertions .fail ( MessageFormat .format ( "io error on file [{0}]: {1}" , p_file , l_excpetion .getMessage () ) );
276272 return Stream .empty ();
277273 }
278274 catch ( final ParseProblemException l_exception )
0 commit comments