3131 * @run junit/othervm ExtractFilesTest
3232 */
3333
34- import org .junit .jupiter .api .AfterAll ;
35- import org .junit .jupiter .api .Assertions ;
36- import org .junit .jupiter .api .BeforeAll ;
37- import org .junit .jupiter .api .Test ;
38- import org .junit .jupiter .api .TestInstance ;
39- import org .junit .jupiter .api .TestInstance .Lifecycle ;
34+ import org .junit .*;
4035
4136import java .io .ByteArrayOutputStream ;
4237import java .io .IOException ;
5146import jdk .testlibrary .FileUtils ;
5247import sun .tools .jar .Main ;
5348
54- @ TestInstance (Lifecycle .PER_CLASS )
5549public class ExtractFilesTest {
5650 private final String nl = System .lineSeparator ();
5751 private final ByteArrayOutputStream baos = new ByteArrayOutputStream ();
5852 private final PrintStream out = new PrintStream (baos );
5953
60- @ BeforeAll
54+ @ Before
6155 public void setupJar () throws IOException {
6256 mkdir ("test1 test2" );
6357 echo ("testfile1" , "test1/testfile1" );
@@ -66,7 +60,7 @@ public void setupJar() throws IOException {
6660 rm ("test1 test2" );
6761 }
6862
69- @ AfterAll
63+ @ After
7064 public void cleanup () {
7165 rm ("test.jar" );
7266 }
@@ -83,7 +77,7 @@ public void testExtract() throws IOException {
8377 " inflated: testfile1" + nl +
8478 " inflated: testfile2" + nl ;
8579 rm ("META-INF testfile1 testfile2" );
86- Assertions .assertArrayEquals (baos .toByteArray (), output .getBytes ());
80+ Assert .assertArrayEquals (baos .toByteArray (), output .getBytes ());
8781 }
8882
8983 /**
@@ -98,9 +92,9 @@ public void testOverwrite() throws IOException {
9892 " inflated: META-INF/MANIFEST.MF" + nl +
9993 " inflated: testfile1" + nl +
10094 " inflated: testfile2" + nl ;
101- Assertions .assertEquals ("testfile1" , cat ("testfile1" ));
95+ Assert .assertEquals ("testfile1" , cat ("testfile1" ));
10296 rm ("META-INF testfile1 testfile2" );
103- Assertions .assertArrayEquals (baos .toByteArray (), output .getBytes ());
97+ Assert .assertArrayEquals (baos .toByteArray (), output .getBytes ());
10498 }
10599
106100 /**
@@ -115,10 +109,10 @@ public void testKeptOldFile() throws IOException {
115109 " inflated: META-INF/MANIFEST.MF" + nl +
116110 " skipped: testfile1 exists" + nl +
117111 " inflated: testfile2" + nl ;
118- Assertions .assertEquals ("" , cat ("testfile1" ));
119- Assertions .assertEquals ("testfile2" , cat ("testfile2" ));
112+ Assert .assertEquals ("" , cat ("testfile1" ));
113+ Assert .assertEquals ("testfile2" , cat ("testfile2" ));
120114 rm ("META-INF testfile1 testfile2" );
121- Assertions .assertArrayEquals (baos .toByteArray (), output .getBytes ());
115+ Assert .assertArrayEquals (baos .toByteArray (), output .getBytes ());
122116 }
123117
124118 /**
@@ -133,10 +127,10 @@ public void testGnuOptionsKeptOldFile() throws IOException {
133127 " inflated: META-INF/MANIFEST.MF" + nl +
134128 " skipped: testfile1 exists" + nl +
135129 " skipped: testfile2 exists" + nl ;
136- Assertions .assertEquals ("" , cat ("testfile1" ));
137- Assertions .assertEquals ("" , cat ("testfile2" ));
130+ Assert .assertEquals ("" , cat ("testfile1" ));
131+ Assert .assertEquals ("" , cat ("testfile2" ));
138132 rm ("META-INF testfile1 testfile2" );
139- Assertions .assertArrayEquals (baos .toByteArray (), output .getBytes ());
133+ Assert .assertArrayEquals (baos .toByteArray (), output .getBytes ());
140134 }
141135
142136 /**
@@ -152,8 +146,8 @@ public void testWarningOnInvalidKeepOption() throws IOException {
152146 "testfile1" + nl +
153147 "testfile2" + nl ;
154148
155- Assertions .assertArrayEquals (baos .toByteArray (), output .getBytes ());
156- Assertions .assertEquals ("Warning: The k option is not valid with current usage, will be ignored." + nl , err );
149+ Assert .assertArrayEquals (baos .toByteArray (), output .getBytes ());
150+ Assert .assertEquals ("Warning: The k option is not valid with current usage, will be ignored." + nl , err );
157151 }
158152
159153 private Stream <Path > mkpath (String ... args ) {
0 commit comments