Skip to content

Commit 50ce59c

Browse files
committed
JUnit 5 conversion - valgrind
1 parent 53eb9e9 commit 50ce59c

File tree

57 files changed

+643
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+643
-503
lines changed

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Bundle-Name: %Bundle-Name.0
44
Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.cachegrind.tests
55
Bundle-Version: 1.0.0.qualifier
66
Bundle-Vendor: %Bundle-Vendor.0
7-
Require-Bundle: org.junit;bundle-version="4.7.0"
7+
Require-Bundle: junit-jupiter-api
88
Bundle-RequiredExecutionEnvironment: JavaSE-21
99
Bundle-ActivationPolicy: lazy
1010
Bundle-Localization: plugin

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<useUIHarness>true</useUIHarness>
3434
<useUIThread>true</useUIThread>
3535
<product>org.eclipse.platform.ide</product>
36-
<testClass>org.eclipse.linuxtools.internal.valgrind.cachegrind.tests.AllTests</testClass>
3736
</configuration>
3837
</plugin>
3938
</plugins>

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/AllTests.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/BasicCachegrindTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1414

15-
import static org.junit.Assert.assertEquals;
16-
import static org.junit.Assert.assertNotNull;
15+
import static org.junit.jupiter.api.Assertions.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1717

1818
import org.eclipse.core.runtime.CoreException;
1919
import org.eclipse.debug.core.ILaunchConfiguration;
2020
import org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart;
2121
import org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile;
2222
import org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput;
2323
import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
24-
import org.junit.After;
25-
import org.junit.Before;
26-
import org.junit.Test;
24+
import org.junit.jupiter.api.AfterEach;
25+
import org.junit.jupiter.api.BeforeEach;
26+
import org.junit.jupiter.api.Test;
2727

2828
public class BasicCachegrindTest extends AbstractCachegrindTest {
2929

30-
@Before
30+
@BeforeEach
3131
public void prep() throws Exception {
3232
proj = createProjectAndBuild("cpptest"); //$NON-NLS-1$
3333
}
3434

3535
@Override
36-
@After
36+
@AfterEach
3737
public void tearDown() throws CoreException {
3838
deleteProject(proj);
3939
super.tearDown();

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/CModelLabelsTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1414

15-
import static org.junit.Assert.assertEquals;
16-
import static org.junit.Assert.assertTrue;
15+
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertTrue;
1718

1819
import org.eclipse.cdt.core.model.IFunction;
1920
import org.eclipse.cdt.core.model.IMethod;
@@ -33,19 +34,19 @@
3334
import org.eclipse.linuxtools.internal.valgrind.cachegrind.model.ICachegrindElement;
3435
import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
3536
import org.eclipse.swt.widgets.TreeItem;
36-
import org.junit.After;
37-
import org.junit.Before;
38-
import org.junit.Test;
37+
import org.junit.jupiter.api.AfterEach;
38+
import org.junit.jupiter.api.BeforeEach;
39+
import org.junit.jupiter.api.Test;
3940

4041
public class CModelLabelsTest extends AbstractCachegrindTest {
4142

42-
@Before
43+
@BeforeEach
4344
public void prep() throws Exception {
4445
proj = createProjectAndBuild("cpptest"); //$NON-NLS-1$
4546
}
4647

4748
@Override
48-
@After
49+
@AfterEach
4950
public void tearDown() throws CoreException {
5051
deleteProject(proj);
5152
super.tearDown();

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/DoubleClickTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1414

15-
import static org.junit.Assert.assertEquals;
15+
import static org.junit.jupiter.api.Assertions.assertEquals;
1616

1717
import java.io.File;
1818

@@ -40,18 +40,18 @@
4040
import org.eclipse.ui.IFileEditorInput;
4141
import org.eclipse.ui.PlatformUI;
4242
import org.eclipse.ui.texteditor.ITextEditor;
43-
import org.junit.After;
44-
import org.junit.Before;
45-
import org.junit.Test;
43+
import org.junit.jupiter.api.AfterEach;
44+
import org.junit.jupiter.api.BeforeEach;
45+
import org.junit.jupiter.api.Test;
4646

4747
public class DoubleClickTest extends AbstractCachegrindTest {
48-
@Before
48+
@BeforeEach
4949
public void prep() throws Exception {
5050
proj = createProjectAndBuild("cpptest"); //$NON-NLS-1$
5151
}
5252

5353
@Override
54-
@After
54+
@AfterEach
5555
public void tearDown() throws CoreException {
5656
deleteProject(proj);
5757
super.tearDown();

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/ExpandCollapseTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1414

15-
import static org.junit.Assert.assertFalse;
16-
import static org.junit.Assert.assertTrue;
15+
import static org.junit.jupiter.api.Assertions.assertFalse;
16+
import static org.junit.jupiter.api.Assertions.assertTrue;
1717

1818
import org.eclipse.core.runtime.CoreException;
1919
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -26,22 +26,22 @@
2626
import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
2727
import org.eclipse.swt.SWT;
2828
import org.eclipse.swt.widgets.Menu;
29-
import org.junit.After;
30-
import org.junit.Before;
31-
import org.junit.Test;
29+
import org.junit.jupiter.api.AfterEach;
30+
import org.junit.jupiter.api.BeforeEach;
31+
import org.junit.jupiter.api.Test;
3232

3333
public class ExpandCollapseTest extends AbstractCachegrindTest {
3434

3535
private TreeViewer viewer;
3636
private Menu contextMenu;
3737

38-
@Before
38+
@BeforeEach
3939
public void prep() throws Exception {
4040
proj = createProjectAndBuild("cpptest"); //$NON-NLS-1$
4141
}
4242

4343
@Override
44-
@After
44+
@AfterEach
4545
public void tearDown() throws CoreException {
4646
deleteProject(proj);
4747
super.tearDown();

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/LaunchConfigTabTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1414

15-
import static org.junit.Assert.assertEquals;
16-
import static org.junit.Assert.assertFalse;
17-
import static org.junit.Assert.assertTrue;
15+
import static org.junit.jupiter.api.Assertions.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertFalse;
17+
import static org.junit.jupiter.api.Assertions.assertTrue;
1818

1919
import java.util.Arrays;
2020

@@ -31,9 +31,9 @@
3131
import org.eclipse.swt.layout.GridLayout;
3232
import org.eclipse.swt.widgets.Display;
3333
import org.eclipse.swt.widgets.Shell;
34-
import org.junit.After;
35-
import org.junit.Before;
36-
import org.junit.Test;
34+
import org.junit.jupiter.api.AfterEach;
35+
import org.junit.jupiter.api.BeforeEach;
36+
import org.junit.jupiter.api.Test;
3737

3838
public class LaunchConfigTabTest extends AbstractCachegrindTest {
3939

@@ -42,7 +42,7 @@ public class LaunchConfigTabTest extends AbstractCachegrindTest {
4242
private ValgrindOptionsTab tab;
4343
private CachegrindToolPage dynamicTab;
4444

45-
@Before
45+
@BeforeEach
4646
public void prep() throws Exception {
4747
proj = createProjectAndBuild("cpptest"); //$NON-NLS-1$
4848

@@ -54,7 +54,7 @@ public void prep() throws Exception {
5454
}
5555

5656
@Override
57-
@After
57+
@AfterEach
5858
public void tearDown() throws CoreException {
5959
tab.dispose();
6060
testShell.dispose();
@@ -85,7 +85,7 @@ public void testDefaults() throws Exception {
8585
ILaunchConfigurationWorkingCopy wc = initConfig();
8686
ILaunch launch = saveAndLaunch(wc, "testDefaults"); //$NON-NLS-1$
8787
IProcess[] p = launch.getProcesses();
88-
assertTrue("process array should not be empty", p.length > 0);
88+
assertTrue(p.length > 0, "process array should not be empty");
8989
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
9090
assertEquals(0, p[0].getExitValue());
9191
assertTrue(cmd.contains("--tool=cachegrind")); //$NON-NLS-1$
@@ -122,7 +122,7 @@ public void testBranchSim() throws Exception {
122122

123123
ILaunch launch = saveAndLaunch(wc, "testBranchSim"); //$NON-NLS-1$
124124
IProcess[] p = launch.getProcesses();
125-
assertTrue("process array should not be empty", p.length > 0);
125+
assertTrue(p.length > 0, "process array should not be empty");
126126
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
127127
assertEquals(0, p[0].getExitValue());
128128
assertTrue(cmd.contains("--branch-sim=yes")); //$NON-NLS-1$
@@ -145,7 +145,7 @@ public void testI1Cache() throws Exception {
145145

146146
ILaunch launch = saveAndLaunch(wc, "testI1Cache"); //$NON-NLS-1$
147147
IProcess[] p = launch.getProcesses();
148-
assertTrue("process array should not be empty", p.length > 0);
148+
assertTrue(p.length > 0, "process array should not be empty");
149149
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
150150
assertTrue(cmd.contains("--I1=16384,1,16")); //$NON-NLS-1$
151151
}
@@ -167,7 +167,7 @@ public void testD1Cache() throws Exception {
167167

168168
ILaunch launch = saveAndLaunch(wc, "testD1Cache"); //$NON-NLS-1$
169169
IProcess[] p = launch.getProcesses();
170-
assertTrue("process array should not be empty", p.length > 0);
170+
assertTrue(p.length > 0, "process array should not be empty");
171171
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
172172
assertTrue(cmd.contains("--D1=16384,1,16")); //$NON-NLS-1$
173173
}
@@ -189,7 +189,7 @@ public void testL2Cache() throws Exception {
189189

190190
ILaunch launch = saveAndLaunch(wc, "testL2Cache"); //$NON-NLS-1$
191191
IProcess[] p = launch.getProcesses();
192-
assertTrue("process array should not be empty", p.length > 0);
192+
assertTrue(p.length > 0, "process array should not be empty");
193193
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
194194
assertTrue(cmd.contains("--L2=16384,1,16")); //$NON-NLS-1$
195195
}

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/MultiProcessTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*******************************************************************************/
1313
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1414

15-
import static org.junit.Assert.assertEquals;
16-
import static org.junit.Assert.assertNotNull;
15+
import static org.junit.jupiter.api.Assertions.assertEquals;
16+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1717

1818
import org.eclipse.cdt.core.model.ICProject;
1919
import org.eclipse.core.runtime.CoreException;
@@ -24,21 +24,21 @@
2424
import org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput;
2525
import org.eclipse.linuxtools.internal.valgrind.launch.LaunchConfigurationConstants;
2626
import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
27-
import org.junit.After;
28-
import org.junit.Before;
29-
import org.junit.Test;
27+
import org.junit.jupiter.api.AfterEach;
28+
import org.junit.jupiter.api.BeforeEach;
29+
import org.junit.jupiter.api.Test;
3030

3131
public class MultiProcessTest extends AbstractCachegrindTest {
3232
private ICProject refProj;
3333

34-
@Before
34+
@BeforeEach
3535
public void prep() throws Exception {
3636
refProj = createProjectAndBuild("cpptest"); //$NON-NLS-1$
3737
proj = createProjectAndBuild("multiProcTest"); //$NON-NLS-1$
3838
}
3939

4040
@Override
41-
@After
41+
@AfterEach
4242
public void tearDown() throws CoreException {
4343
deleteProject(proj);
4444
deleteProject(refProj);

valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests/ShortcutTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.linuxtools.internal.valgrind.cachegrind.tests;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertNotNull;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
1818

1919
import org.eclipse.core.resources.IFile;
2020
import org.eclipse.core.runtime.CoreException;
@@ -28,19 +28,19 @@
2828
import org.eclipse.ui.IWorkbenchPage;
2929
import org.eclipse.ui.PlatformUI;
3030
import org.eclipse.ui.ide.IDE;
31-
import org.junit.After;
32-
import org.junit.Before;
33-
import org.junit.Test;
31+
import org.junit.jupiter.api.AfterEach;
32+
import org.junit.jupiter.api.BeforeEach;
33+
import org.junit.jupiter.api.Test;
3434

3535
public class ShortcutTest extends AbstractCachegrindTest {
3636

37-
@Before
37+
@BeforeEach
3838
public void prep() throws Exception {
3939
proj = createProjectAndBuild("basicTest"); //$NON-NLS-1$
4040
}
4141

4242
@Override
43-
@After
43+
@AfterEach
4444
public void tearDown() throws CoreException {
4545
deleteProject(proj);
4646
super.tearDown();

0 commit comments

Comments
 (0)