3232import org .apache .ibatis .migration .io .Resources ;
3333import org .apache .ibatis .migration .utils .TestUtil ;
3434import org .junit .jupiter .api .Test ;
35- import org .junit .jupiter .api .condition .EnabledOnOs ;
36- import org .junit .jupiter .api .condition .OS ;
3735
3836class BaseCommandTest {
3937 @ Test
@@ -46,8 +44,7 @@ void testNonexistentResource() throws Exception {
4644 }
4745
4846 @ Test
49- @ EnabledOnOs ({ OS .LINUX , OS .MAC })
50- void testNonexistentFileLinuxMac () throws Exception {
47+ void testNonexistentFile () throws Exception {
5148 String srcPath = TestUtil .getTempDir ().getAbsolutePath () + FileSystems .getDefault ().getSeparator ()
5249 + "NoSuchFile.sql" ;
5350 File dest = File .createTempFile ("Out" , ".sql" );
@@ -58,19 +55,6 @@ void testNonexistentFileLinuxMac() throws Exception {
5855 assertEquals (e .getMessage (), srcPath );
5956 }
6057
61- @ Test
62- @ EnabledOnOs (OS .WINDOWS )
63- void testNonexistentFileWindows () throws Exception {
64- String srcPath = TestUtil .getTempDir ().getAbsolutePath () + FileSystems .getDefault ().getSeparator ()
65- + "NoSuchFile.sql" ;
66- File dest = File .createTempFile ("Out" , ".sql" );
67- dest .deleteOnExit ();
68- NoSuchFileException e = assertThrows (NoSuchFileException .class , () -> {
69- BaseCommand .copyTemplate (Path .of (srcPath ).toFile (), dest , null );
70- });
71- assertEquals (e .getMessage (), srcPath + " (The system cannot find the file specified)" );
72- }
73-
7458 @ Test
7559 void testCopyResource () throws Exception {
7660 File src = Resources .getResourceAsFile ("org/apache/ibatis/migration/commands/TestTemplate.sql" );
0 commit comments