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

Citrus for java 11 does not support later versions of TestNG #1146

Closed
itsMCD opened this issue Apr 12, 2024 · 8 comments
Closed

Citrus for java 11 does not support later versions of TestNG #1146

itsMCD opened this issue Apr 12, 2024 · 8 comments
Assignees
Labels
State: WIP Type: Dependencies Pull requests that update a dependency file Type: Maintenance

Comments

@itsMCD
Copy link

itsMCD commented Apr 12, 2024

Citrus Version
6.4.0

Expected behavior
Be able to use (initialise and run tests) with testNG version 7.x

Actual behavior
Throws the following exception:

org.testng.TestNGException: 
Native Injection is NOT supported for @BeforeSuite annotated beforeSuite.
For more information on native dependency injection please refer to https://testng.org/#_dependency_injection

	at org.testng.internal.Parameters.checkParameterTypes(Parameters.java:442)
	at org.testng.internal.Parameters.createParametersForMethod(Parameters.java:347)
	at org.testng.internal.Parameters.createParameters(Parameters.java:699)
	at org.testng.internal.Parameters.createConfigurationParameters(Parameters.java:163)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:313)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:358)
	at org.testng.SuiteRunner.run(SuiteRunner.java:312)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1274)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1208)
	at org.testng.TestNG.runSuites(TestNG.java:1112)
	at org.testng.TestNG.run(TestNG.java:1079)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:65)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)

(this was previously mentioned in issue #3029
but was only fixed for the latest Java 17 version of Citrus. A lot of projects still use a java version below 17 and want to avoid using testNG 6.x due to vulnerabilities.
Test case sample

Use testNG and relevant setup with the following test class

import com.consol.citrus.annotations.CitrusTest;
import com. consol. citrus. testng. spring.TestNGCitrusSpringSupport
import org.testng.annotations.Test;

public class ITtest extends TestNGCitrusSpringSupport{ 

   @Test
   @CitrusTest
   public void testTest() throws Exception {
      //request
   }

}
@bbortt
Copy link
Collaborator

bbortt commented Apr 15, 2024

I agree that this is a reasonable request. @christophd and I anticipated that such a request might arise eventually. Our consensus was to evaluate backports as they become necessary, which applies to the current situation.

I am willing to attempt a backport of the fix to v3.x. I remember the fix for JDK >= 17 as being rather little. Maybe a cherry-pick is enough, even.

Given that the release scripts are available in the repository, @christophd, do you think it would be feasible to manage a backport fix release without significant effort?

@bbortt bbortt self-assigned this Apr 15, 2024
@bbortt bbortt added Type: Maintenance Type: Dependencies Pull requests that update a dependency file State: WIP labels Apr 15, 2024
@bbortt
Copy link
Collaborator

bbortt commented Apr 15, 2024

just for clarification @itsMCD: you are using citrus 3.4.0 (reference)?

because it contains <testng.version>7.7.1</testng.version> (reference). I assume you meant that, because version v6.4.0 of citrus does not exist (yet). and testng version v6.x is from 2018 (reference).

I then assume you would love to see it being upgraded to the latest version (as of today), e.g. v7.10.1.

@itsMCD
Copy link
Author

itsMCD commented Apr 15, 2024

@bbortt yes sorry, We are currently using Citrus 3.4.0 which which does not support TestNG v 7.x and the versions of TestNG 6.X contains vulnerabilities.
Thus yes, I would like to see it upgraded to TestNG V 7.10.1.
Thank you
tl:dr
Current latest citrus version compatible with Java 11 is 3.4.0 which does not support TestNG 7.X, and would thus request support for TestNG 7.x

bbortt added a commit to postfinance/citrus that referenced this issue Apr 15, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in citrusframework#1090.

closes citrusframework#1146.
@bbortt
Copy link
Collaborator

bbortt commented Apr 15, 2024

Current latest citrus version compatible with Java 11 is 3.4.0 which does not support TestNG 7.X, and would thus request support for TestNG 7.x

it is already on [email protected], as mentioned (see pom.xml). I've opened #1148 which upgrades it to v7.10.1.

that fulfils your request, right? or am I missing something here?

bbortt added a commit to postfinance/citrus that referenced this issue Apr 15, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in citrusframework#1090.

closes citrusframework#1146.
@christophd
Copy link
Member

@bbortt yes, I can do a release then

bbortt added a commit to postfinance/citrus that referenced this issue Apr 15, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in citrusframework#1090.

closes citrusframework#1146.
bbortt added a commit to postfinance/citrus that referenced this issue Apr 15, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in citrusframework#1090.

closes citrusframework#1146.
bbortt added a commit to postfinance/citrus that referenced this issue Apr 15, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in citrusframework#1090.

closes citrusframework#1146.
bbortt added a commit that referenced this issue Apr 15, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in #1090.

closes #1146.
@bbortt
Copy link
Collaborator

bbortt commented Apr 15, 2024

@christophd backport has been merged into https://github.com/citrusframework/citrus/tree/support/3.0.0.

@christophd
Copy link
Member

@bbortt cool, thanks! I am traveling a lot this week, so hopefully I find some time next week to do the release.

christophd pushed a commit that referenced this issue Apr 23, 2024
backport fix of a4a1a5d for citrus `v3.4.0`.
bug has originally been reported in #1090.

closes #1146.
@christophd
Copy link
Member

The release is done. v3.4.1 is available!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: WIP Type: Dependencies Pull requests that update a dependency file Type: Maintenance
Projects
None yet
Development

No branches or pull requests

3 participants