|
28 | 28 | import javax.swing.tree.DefaultMutableTreeNode; |
29 | 29 | import javax.swing.tree.MutableTreeNode; |
30 | 30 | import javax.swing.tree.TreePath; |
31 | | -import junit.framework.*; |
| 31 | +import org.junit.jupiter.api.*; |
| 32 | +import static org.junit.jupiter.api.Assertions.*; |
32 | 33 | import java.util.Map; |
33 | 34 | import java.util.Vector; |
34 | 35 |
|
35 | 36 | /** |
36 | 37 | * test parsing of log files from sun vms. |
37 | 38 | * @author irockel |
38 | 39 | */ |
39 | | -public class SunJDKParserTest extends TestCase { |
| 40 | +public class SunJDKParserTest { |
40 | 41 |
|
41 | | - public SunJDKParserTest(String testName) { |
42 | | - super(testName); |
43 | | - } |
44 | | - |
| 42 | + @BeforeEach |
45 | 43 | protected void setUp() throws Exception { |
46 | 44 | } |
47 | 45 |
|
| 46 | + @AfterEach |
48 | 47 | protected void tearDown() throws Exception { |
49 | 48 | } |
50 | 49 |
|
51 | | - public static Test suite() { |
52 | | - TestSuite suite = new TestSuite(SunJDKParserTest.class); |
53 | | - |
54 | | - return suite; |
55 | | - } |
56 | | - |
57 | 50 | /** |
58 | 51 | * Test of hasMoreDumps method, of class de.grimmfrost.tda.SunJDKParser. |
59 | 52 | */ |
| 53 | + @Test |
60 | 54 | public void testDumpLoad() throws FileNotFoundException, IOException { |
61 | 55 | System.out.println("dumpLoad"); |
62 | 56 | FileInputStream fis = null; |
@@ -89,6 +83,7 @@ public void testDumpLoad() throws FileNotFoundException, IOException { |
89 | 83 | /** |
90 | 84 | * Test of isFoundClassHistograms method, of class de.grimmfrost.tda.SunJDKParser. |
91 | 85 | */ |
| 86 | + @Test |
92 | 87 | public void testIsFoundClassHistograms() throws FileNotFoundException, IOException { |
93 | 88 | System.out.println("isFoundClassHistograms"); |
94 | 89 | DumpParser instance = null; |
@@ -116,6 +111,7 @@ public void testIsFoundClassHistograms() throws FileNotFoundException, IOExcepti |
116 | 111 | } |
117 | 112 | } |
118 | 113 |
|
| 114 | + @Test |
119 | 115 | public void test64BitDumpLoad() throws FileNotFoundException, IOException { |
120 | 116 | System.out.println("64BitDumpLoad"); |
121 | 117 | FileInputStream fis = null; |
@@ -145,6 +141,7 @@ public void test64BitDumpLoad() throws FileNotFoundException, IOException { |
145 | 141 | } |
146 | 142 | } |
147 | 143 |
|
| 144 | + @Test |
148 | 145 | public void testJava8DumpLoad() throws FileNotFoundException, IOException { |
149 | 146 | System.out.println("Java8DumpLoad"); |
150 | 147 | FileInputStream fis = null; |
@@ -174,6 +171,7 @@ public void testJava8DumpLoad() throws FileNotFoundException, IOException { |
174 | 171 | } |
175 | 172 | } |
176 | 173 |
|
| 174 | + @Test |
177 | 175 | public void testJava11DumpLoad() throws FileNotFoundException, IOException { |
178 | 176 | System.out.println("Java11DumpLoad"); |
179 | 177 | FileInputStream fis = null; |
@@ -203,6 +201,7 @@ public void testJava11DumpLoad() throws FileNotFoundException, IOException { |
203 | 201 | } |
204 | 202 | } |
205 | 203 |
|
| 204 | + @Test |
206 | 205 | public void testHPDumps() throws FileNotFoundException, IOException { |
207 | 206 | System.out.println("HPDumpLoad"); |
208 | 207 | FileInputStream fis = null; |
@@ -232,6 +231,7 @@ public void testHPDumps() throws FileNotFoundException, IOException { |
232 | 231 | } |
233 | 232 | } |
234 | 233 |
|
| 234 | + @Test |
235 | 235 | public void testRemoteVisualVMDumps() throws FileNotFoundException, IOException { |
236 | 236 | System.out.println("VisualVMDumpLoad"); |
237 | 237 | FileInputStream fis = null; |
@@ -261,6 +261,7 @@ public void testRemoteVisualVMDumps() throws FileNotFoundException, IOException |
261 | 261 | } |
262 | 262 | } |
263 | 263 |
|
| 264 | + @Test |
264 | 265 | public void testURLThreadNameDumps() throws FileNotFoundException, IOException { |
265 | 266 | System.out.println("URLThreadNameDumpLoad"); |
266 | 267 | FileInputStream fis = null; |
@@ -290,6 +291,7 @@ public void testURLThreadNameDumps() throws FileNotFoundException, IOException |
290 | 291 | } |
291 | 292 | } |
292 | 293 |
|
| 294 | + @Test |
293 | 295 | public void testVirtualThreadDumps() throws FileNotFoundException, IOException { |
294 | 296 | System.out.println("VirtualThreadDumpLoad"); |
295 | 297 | FileInputStream fis = null; |
@@ -319,6 +321,7 @@ public void testVirtualThreadDumps() throws FileNotFoundException, IOException { |
319 | 321 | } |
320 | 322 | } |
321 | 323 |
|
| 324 | + @Test |
322 | 325 | public void testLongRunningDetectionWithVariableFields() throws FileNotFoundException, IOException { |
323 | 326 | System.out.println("testLongRunningDetectionWithVariableFields"); |
324 | 327 | FileInputStream fis = null; |
@@ -364,11 +367,11 @@ public void testLongRunningDetectionWithVariableFields() throws FileNotFoundExce |
364 | 367 | instance.findLongRunningThreads(root, dumpMap, paths, 2, null); |
365 | 368 |
|
366 | 369 | // Check if long running threads were found |
367 | | - assertTrue("Should have children", root.getChildCount() > 0); |
| 370 | + assertTrue(root.getChildCount() > 0, "Should have children"); |
368 | 371 | DefaultMutableTreeNode resultNode = (DefaultMutableTreeNode) root.getChildAt(0); |
369 | 372 |
|
370 | 373 | // We expect at least 2 long running threads ("C2 CompilerThread0" and "VM Periodic Task Thread") |
371 | | - assertTrue("Should find at least one long running thread, found: " + resultNode.getChildCount(), resultNode.getChildCount() > 0); |
| 374 | + assertTrue(resultNode.getChildCount() > 0, "Should find at least one long running thread, found: " + resultNode.getChildCount()); |
372 | 375 |
|
373 | 376 | } finally { |
374 | 377 | if(instance != null) { |
|
0 commit comments