Running JUnit Tests from an Eclipse Plugin - java

I am working on an Eclipse Plugin where I can select an Eclipse Project and run the JUnit Test Suite of this project. Currently I am using the ILaunchConfiguration to start the tests
Is there anointed way to start these tests? And how can I access the results?

Related

Does infinitest for IntelliJ IDEA honor the run tests settings in Gradle?

I have a Gradle project that I would like to use infinitest with. However, while all test pass using the Gradle test runner, many fail in infinitest. Is this because infinitest uses the IntelliJ test runner to run the tests?
I expect this is the case since I get similar results when I try to run tests manually using the IntelliJ test runner.
How can I configure infinitest to use Gradle as the test runner?
Infinitest starts a new JVM to run tests, it gets the project classpath from IntelliJ but does not know it is a Gradle project.
I don't know what the Gradle test runner does differently but it would be great if you could open an issue on the Infinitest bug tracker with the steps to reproduce the problem (ideally with a sample project).
In case the issue is with missing JVM options you can set them using the infinitest.args file

Can I add Jmeter to the project that use Gradle Java and Junit 5?

I have an Automation test project with an API test included.
I use for that JUnit, Retrofit2, Java, and Gradle.
I want to integrate Jmeter to those tests and run performance testing using those tests. It is possible?
Can I (for example) package all of those tests to the jar, and run it using plugin before running the tests?
I saw some topics on the stack overflow and other forums, but it was for Maven and Junit.

Compile Cucumber JUnit based runner classes

I've built a cucumber framework and using JUnit for creating Runner Classes. When I load & run N number of feature files, my runner class is executing all the scenarios & tests as expected.
But here I would like load tests alone in Eclipse JUnit explorer by compiling the tests and pick selective tests from there and run from Eclipse JUnit explorer.
Currently I could see that after running the tests only Eclipse JUnit explorer is populated with tests and from there I'm able to pick and run certain tests. But is there an option to compile and load tests in Eclipse JUnit explorer?

How can I view integration tests in the Netbeans Test Results?

My development environment is Netbeans 7.4 and Maven 3.0.5 (bundled with Netbeans). I'm using JUnit 4.11 to build unit (class names ending with Test) and integration tests (class names ending with IT). I'm running unit tests and excluding integration tests with the "-DskipITs" Maven option. I have a custom action which runs just the integration tests with the failsafe plugin. Both execute successfully. However, I only see the results in the "Test Results" window when running the unit tests. How can I get the integration tests to show in the "Test Results" window? With the integration tests, I'm only seeing the output in the console.
The maven-failsafe-plugin only executes in integration-test and verify (and of course the help) goal while the maven-surefire-plugin runs during test goal.
NetBeans Test Results window only shows the tests that were executed using the 'test' goal.
My solution for this situation is to categorize my integration tests into
testintegration - just lightweight ITs, I run them with surefire (to see them in Test Results window)
testheavy - those that will require me to bootstrap something I run with the fail-safe plugin
I hope you have the option of doing something close to that.

How to run Maven unit test (testng) on Eclipse?

I have a Maven project and I have included some unit tests. I can run those unit tests from command line using
mvn test -Dtest=AppTest
It will run the unit test (AppTest class) without any problems. But if I tried to run the test on Eclipse as JUnitTest, I got an error saying
"No Tests found with test runner 'JUnit 3'"
I know the test (AppTest) is not a JUnit test but I didn't see "maven" option if I right clicked on the test class.
Do you know how I could run the tests on Eclipse?
If those are testng tests, then you can download the eclipse plugin for TestNG and right click and run them as test class. Testng plugin here
If you want to run the command line way of maven, you would need the maven plugin for eclipse from here
Then you can right click your project and you should see an option of Run As -> Maven Test. You would need to set relevant arguments in the surefire plugin of pom or use run configuration to specify parameters like you did in -Dtest
I would suggest the testng plugin which would be simpler to just select the class and run the class or a single case or a package even.

Categories

Resources