Skip to content

Commit 948e37d

Browse files
feat: Migrate cat.ddk.sample.helloworld.ui.test to Junit5
removed junit4 dependencies removed dependency to DiscerningSuite
1 parent 43c8d09 commit 948e37d

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

com.avaloq.tools.ddk.sample.helloworld.ui.test/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Bundle-SymbolicName: com.avaloq.tools.ddk.sample.helloworld.ui.test;singleton:=t
88
Bundle-ActivationPolicy: lazy
99
Require-Bundle: com.avaloq.tools.ddk.sample.helloworld,
1010
com.avaloq.tools.ddk.sample.helloworld.ui,
11-
org.junit,
1211
org.eclipse.xtext.ui.testing,
1312
org.eclipse.xtext.testing,
1413
org.eclipse.xtext.xbase.testing,
@@ -21,6 +20,7 @@ Require-Bundle: com.avaloq.tools.ddk.sample.helloworld,
2120
org.eclipse.xtext.xbase.ui.testing,
2221
junit-jupiter-api,
2322
junit-jupiter-engine,
23+
junit-platform-suite-api,
2424
junit-vintage-engine
2525
Bundle-RequiredExecutionEnvironment: JavaSE-21
2626
Export-Package: com.avaloq.tools.ddk.sample.helloworld.test,

com.avaloq.tools.ddk.sample.helloworld.ui.test/src/com/avaloq/tools/ddk/sample/helloworld/label/IssueLabelTest.xtend

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ package com.avaloq.tools.ddk.sample.helloworld.label
1212

1313
import com.google.inject.AbstractModule
1414
import com.google.inject.Guice
15-
import org.junit.Test
1615

17-
import static org.junit.Assert.assertEquals
18-
import static org.junit.Assert.assertNotNull
1916
import com.avaloq.tools.ddk.sample.helloworld.validation.LibraryChecksIssueCodes
2017
import com.avaloq.tools.ddk.check.runtime.label.ICheckRuleLabelProvider
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
2121

2222
/**
2323
* End-to-end test for getting Check labels.
@@ -49,8 +49,8 @@ class IssueLabelTest {
4949
val label = checkRuleLabelProvider.getLabel(entry.key);
5050

5151
// ASSERT
52-
assertNotNull("Label should be returned for key " + entry.key, label);
53-
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);
5454
}
5555
}
5656
}

com.avaloq.tools.ddk.sample.helloworld.ui.test/src/com/avaloq/tools/ddk/sample/helloworld/test/HelloWorldSampleTestSuite.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,21 @@
1111

1212
package com.avaloq.tools.ddk.sample.helloworld.test;
1313

14-
import org.junit.runner.RunWith;
15-
import org.junit.runners.Suite;
16-
17-
import com.avaloq.tools.ddk.sample.helloworld.check.CheckConfigurationIsAppliedTest;
18-
import com.avaloq.tools.ddk.sample.helloworld.check.CheckExecutionEnvironmentProjectTest;
19-
import com.avaloq.tools.ddk.sample.helloworld.label.IssueLabelTest;
14+
import org.junit.platform.suite.api.SelectPackages;
15+
import org.junit.platform.suite.api.Suite;
2016

2117

2218
/**
23-
* Empty class serving only as holder for JUnit4 annotations.
19+
* Junit5 version of test suites. does not implement the logic in our DiscerningSuite.
2420
*/
25-
@RunWith(Suite.class)
26-
@Suite.SuiteClasses({
21+
@Suite
22+
@SelectPackages({
2723
// @Format-Off
28-
IssueLabelTest.class,
29-
CheckConfigurationIsAppliedTest.class,
30-
CheckExecutionEnvironmentProjectTest.class
31-
// @Format-On
24+
"com.avaloq.tools.ddk.sample.helloworld.check",
25+
"com.avaloq.tools.ddk.sample.helloworld.label"
26+
// @Format-On
3227
})
28+
3329
public class HelloWorldSampleTestSuite {
3430

3531
}

0 commit comments

Comments
 (0)