Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated JUnit related support in TestNG #3022

Closed
3 of 7 tasks
krmahadevan opened this issue Dec 27, 2023 · 3 comments · Fixed by #3023
Closed
3 of 7 tasks

Remove deprecated JUnit related support in TestNG #3022

krmahadevan opened this issue Dec 27, 2023 · 3 comments · Fixed by #3023
Milestone

Comments

@krmahadevan
Copy link
Member

TestNG Version

Note: only the latest version is supported

7.9.0

Expected behavior

TestNG need not support JUnit anymore now.

Actual behavior

Is the issue reproducible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

JUnit3/JUnit4 support in TestNG was deprecated as of v7.7.0. This was done because the JUnit team have enhanced JUnit5 to support running TestNG using JUnit itself. So there's no need for TestNG to do the reverse of this and TestNG users can switch over to using JUnit5 if they have a mixture of JUnit and TestNG tests and need both of them to be executed by the same test runner (JUnit5 would be the driver which would internally invoke TestNG)

For more details please refer to the official documentation of the testng-engine by JUnit at https://github.com/junit-team/testng-engine

@krmahadevan krmahadevan added this to the 7.10.0 milestone Dec 27, 2023
@krmahadevan krmahadevan changed the title Remove JUnit related support in TestNG Remove deprecated JUnit related support in TestNG Dec 27, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Dec 27, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Dec 27, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Dec 28, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Jan 5, 2024
@bobshie
Copy link
Contributor

bobshie commented Jun 12, 2024

That's to say, the Junit4 Testcase will not running with TestNG 7.10.0~. should Junit5 work well with TestNG latest version.

@juherr
Copy link
Member

juherr commented Jun 12, 2024

@bobshie Yes. With https://github.com/junit-team/testng-engine JUnit5 should be able to run JUnit4, JUnit5 et TestNG test cases together. Please share your experience on testng-engine if something is not working as expected.

@bobshie
Copy link
Contributor

bobshie commented Jun 13, 2024

Hello, We have Junit4 test cases that based on Junit4, but after we uplift testng to 7.10.2, these test cases aren't running.

I changed the dependent from

    <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>${junit.version}</version>
         <scope>${junit.scope}</scope>
     </dependency>

to

   <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>5.10.2</version>
        <scope>${junit.scope}</scope>
    </dependency>

then it works.
the whole dependency list is:

    <dependency>
         <groupId>org.testng</groupId>
         <artifactId>testng</artifactId>
        <version>7.10.2</version>
     </dependency>
    <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>5.10.2</version>
        <scope>${junit.scope}</scope>
    </dependency>
    <!--
    <dependency>
        <groupId>org.junit.support</groupId>
        <artifactId>testng-engine</artifactId>
        <version>1.0.5</version>
        <scope>test</scope>
    </dependency>
     <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>${junit.version}</version>
         <scope>${junit.scope}</scope>
     </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.10.2</version>
        <scope>${junit.scope}</scope>
    </dependency>
    -->
 </dependencies>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants