Skip to content

Commit c086b61

Browse files
authored
Merge pull request #1209 from markdomeng/check_test_runtime_j5
feat: Migrate cat.ddk.check.test.runtime.test to Junit5
2 parents 43c8d09 + 1f234b6 commit c086b61

File tree

6 files changed

+23
-32
lines changed

6 files changed

+23
-32
lines changed

com.avaloq.tools.ddk.check.runtime.core.test/META-INF/MANIFEST.MF

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Require-Bundle: org.eclipse.ui,
1313
com.google.guava,
1414
junit-jupiter-api,
1515
junit-jupiter-engine,
16-
junit-vintage-engine,
1716
junit-platform-suite-api
1817
Export-Package: com.avaloq.tools.ddk.check.runtime.test.core
1918
Import-Package: org.mockito,

com.avaloq.tools.ddk.check.test.runtime.tests/META-INF/MANIFEST.MF

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@ Require-Bundle: com.avaloq.tools.ddk.check.runtime.core,
1414
org.eclipse.xtext,
1515
org.eclipse.xtext.testing,
1616
org.eclipse.xtext.ui.testing,
17-
org.junit,
1817
org.eclipse.ui.workbench;resolution:=optional,
1918
org.eclipse.xtend.lib,
2019
org.eclipse.xtext.xbase.lib,
2120
junit-jupiter-api,
2221
junit-jupiter-engine,
22+
junit-platform-suite-api,
2323
junit-vintage-engine
24-
Import-Package: org.junit.runner;version="4.5.0",
25-
org.junit.runner.manipulation;version="4.5.0",
26-
org.junit.runner.notification;version="4.5.0",
27-
org.junit.runners;version="4.5.0",
28-
org.junit.runners.model;version="4.5.0",
29-
org.hamcrest.core
24+
Import-Package: org.hamcrest.core
3025
Bundle-RequiredExecutionEnvironment: JavaSE-21
3126
Export-Package: com.avaloq.tools.ddk.check.test.runtime,
3227
com.avaloq.tools.ddk.check.test.runtime.tests,

com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/label/IssueLabelTest.xtend

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import com.avaloq.tools.ddk.check.runtime.label.ICheckRuleLabelProvider
1515
import com.avaloq.tools.ddk.check.validation.LibraryChecksIssueCodes
1616
import com.google.inject.AbstractModule
1717
import com.google.inject.Guice
18-
import org.junit.Test
19-
20-
import static org.junit.Assert.assertEquals
21-
import static org.junit.Assert.assertNotNull
18+
import org.junit.jupiter.api.Test
19+
import static org.junit.jupiter.api.Assertions.assertNotNull;
20+
import static org.junit.jupiter.api.Assertions.assertEquals;
2221

2322
/**
2423
* End-to-end test for getting Check labels.
@@ -50,8 +49,8 @@ class IssueLabelTest {
5049
val label = checkRuleLabelProvider.getLabel(entry.key);
5150

5251
// ASSERT
53-
assertNotNull("Label should be returned for key " + entry.key, label);
54-
assertEquals("Correct label should be returned for key " + entry.key, entry.value, label);
52+
assertNotNull(label, "Label should be returned for key " + entry.key);
53+
assertEquals( entry.value, label, "Correct label should be returned for key " + entry.key);
5554
}
5655
}
5756
}

com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckExecutionEnvironmentTestSuite.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@
1010
*******************************************************************************/
1111
package com.avaloq.tools.ddk.check.test.runtime.tests;
1212

13-
import org.junit.runner.RunWith;
14-
import org.junit.runners.Suite;
15-
16-
import com.avaloq.tools.ddk.check.test.runtime.CheckConfigurationIsAppliedTest;
17-
import com.avaloq.tools.ddk.check.test.runtime.CheckExecutionEnvironmentProjectTest;
13+
import org.junit.platform.suite.api.SelectPackages;
14+
import org.junit.platform.suite.api.Suite;
1815

1916

2017
/**
21-
* Empty class serving only as holder for JUnit4 annotations.
18+
* Junit5 version of test suites. does not implement the logic in our DiscerningSuite.
2219
*/
23-
@RunWith(Suite.class)
24-
@Suite.SuiteClasses({CheckExecutionEnvironmentProjectTest.class, CheckConfigurationIsAppliedTest.class})
20+
@Suite
21+
@SelectPackages({
22+
// @Format-Off
23+
"com.avaloq.tools.ddk.check.test.runtime"
24+
// @Format-On
25+
})
2526
public class CheckExecutionEnvironmentTestSuite {
2627

2728
}

com.avaloq.tools.ddk.check.test.runtime.tests/src/com/avaloq/tools/ddk/check/test/runtime/tests/CheckLibraryChecksTestSuite.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@
1111

1212
package com.avaloq.tools.ddk.check.test.runtime.tests;
1313

14-
import org.junit.runner.RunWith;
15-
import org.junit.runners.Suite;
16-
17-
import com.avaloq.tools.ddk.check.test.runtime.label.IssueLabelTest;
14+
import org.junit.platform.suite.api.SelectPackages;
15+
import org.junit.platform.suite.api.Suite;
1816

1917

2018
/**
21-
* Empty class serving only as holder for JUnit4 annotations.
19+
* Junit5 version of test suites. does not implement the logic in our DiscerningSuite.
2220
*/
23-
@RunWith(Suite.class)
24-
@Suite.SuiteClasses({
21+
@Suite
22+
@SelectPackages({
2523
// @Format-Off
26-
IssueLabelTest.class
27-
// @Format-On
24+
"com.avaloq.tools.ddk.check.test.runtime.label"
25+
// @Format-On
2826
})
2927
public class CheckLibraryChecksTestSuite {
3028

com.avaloq.tools.ddk.typesystem.test/META-INF/MANIFEST.MF

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Require-Bundle: com.google.inject,
1111
com.google.guava,
1212
junit-jupiter-api,
1313
junit-jupiter-engine,
14-
junit-vintage-engine,
1514
junit-platform-suite-api
1615
Export-Package: com.avaloq.tools.ddk.typesystem.test
1716
Automatic-Module-Name: com.avaloq.tools.ddk.typesystem.test

0 commit comments

Comments
 (0)