Is it possible to integrate Maven Surefire with a custom testing framework? - maven

From the Surefire documentation I understand that it can auto-detect basically only JUnit & TestNG. Is it possible to connect it to another testing framework?
Would appreciate links to any samples.

Related

What maven plugin to use in pom.xml for automation tests testNG, java, rest-assured framework?

I have created maven based testNG, rest-assured framework using Java. Now I want to integrate with Jenkins. What maven plugin to use in order to run via Jenkins?

Integrating Junit with Ruby-Cucumber-Watir?

Is it possible to integrate Junit with Ruby-Cucumber framework? If so, is there any documentation available for this?

Allure gradle integration

I'm trying to integrate Allure reports into a Gradle build. It seems there is no direct support for Gradle overall (all Maven) and only some recent support for TestNG. Digging further I see a number of issues with Gradle not supporting JUnit listeners, but they do support TestNG listeners (because TestNG does). I've tried a gradle integration following the Maven pom as guideline for the JUnit plugin, but it obviously produces no output.
So I guess my question is :
Will there be any gradle support coming soon or will we have to wait for Gradle to enable some sort of JUNit listener facility first?
If none of the above, has anyone done a custom integration ?
Allure TestNG Gradle example here https://github.com/allure-examples/allure-gradle-testng-example
It's works because TestNG supports Java SPI for adding test listeners. But JUnit does't have such feature. You can check out the following PR to JUnit https://github.com/junit-team/junit/pull/923
If you need Gradle support for JUnit right now you can try to implement Gradle Test Listener (http://www.gradle.org/docs/current/javadoc/org/gradle/api/tasks/testing/TestListener.html)
Hope it helps

RepositorySystemSession Null in Maven 3 Plugin Unit Test

I am attempting to write a unit test for a Maven 3 Plugin with a dependency on Aether using the Maven Plugin Testing Harness. When executing my tests though the RepositorySystemSession is null and after an extensive search I can not figure out how to inject a session into the unit tests plugin harness.
I am using Maven 3.0.3 core APIs, Maven Plugin Test Harness 2.0 and Aether 1.12. I have tried other various combinations but appear to be missing a critical component somewhere along the line.
The code base for the example can be found here: http://www.sonatype.com/people/2011/01/how-to-use-aether-in-maven-plugins/.
The documentation for the plugin harness can be found here: http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/getting-started/index.html.
My example code can be seen here:
MyAetherMojo
MyAetherMojoTest
Any ideas on how to get the RepositorySystemSession injected into the container for the unit test?
TIA,
Scott ES
The plugin testing harness does not support Aether testing. You have to use the Maven Invoker Plugin as demonstrated in the How To Use Aether in Maven Plugins demo code.

Jersey Test Framework

I have a non maven project. I would like to test my jersey rest services using the Jersey Test Framework. The jersey docs only relate to maven for the jersey test framework. Is it possible to add a jar or library to the project to use this framework?
Using Jersey client instead of Jersey Test Framework have two advantages:
It's well documented and only needs the jersey-client JAR
The written code is standard and can be use by the Java clients of your services
I would suggest you to add Maven to your project for some reasons
ability to use and helpful dependencies
having mechanism to create a build of you application with one command like mvn clean package
If you use Ant scripts you can easily call old Ant scripts from Maven with Apache Maven AntRun Plugin without significant Ant scripts rebuilding.

Resources