Questions tagged [junit-runner]

The JUnit runner checks, makes and launches the unit tests.

The default runner implementation guarantees that the instances of the test case class will be constructed immediately before running the test and that the runner will retain no reference to the test case instances, generally making them available for garbage collection

124 questions
6
votes
3 answers

Adding a setUp step for multiple JUnit test classes

In a project there are multiple test classes each containing multiple test methods. Say, I want to create a database connection before running each of these test classes. The connection should be made regardless of whether I run an individual test…
rclakmal
  • 1,872
  • 3
  • 17
  • 19
5
votes
1 answer

how to create test suite as in junit 4 using Junit5

as we are upgrading to junit5 from junit4 for unit testing purpose, i couldn't able to find solution to creating a test suite in junit5 like in junit4 : below is the our junit4 suite class : @RunWith(Suite.class) @SuiteClasses({ ClassA.class, …
Dhuruvan
  • 91
  • 10
5
votes
1 answer

Empty test suite. espresso

I am new to automation testing. I wanted to run a specific test class even though i am having the test suite, it gives me output as "Client not ready yet..Test running started... Tests ran to completion...Empty test suite.." I have searched and…
5
votes
2 answers

IntelliJ runs unit tests with Maven instead of JUnit

I have some Unit tests, that when I try to run, it automatically creates Maven run/debug configuration, instead of JUnit (the integrated IDEA tab). For some tests it does use JUnit run\debug configuration and manually - I can create both Maven and…
Nati
  • 1,034
  • 5
  • 19
  • 46
5
votes
1 answer

Junit Test Runner with Suite

Is it possible to get a TestRunner to run a Test Suite that's been created programmatically? The Block4JunitTestRunner for example takes the Suite class as the constructor argument. However, I can't do this since the Suite isn't a concrete Suite. I…
Nick
  • 1,269
  • 5
  • 31
  • 45
4
votes
0 answers

Custom Junit runner doesn't ignore tests with Assume.assumeTrue(someFalseCondition)

I have written a custom Junit runner to have control on how to run Parameterized Tests. Below is the source code for it. The problem is that now the class extending from it doesn't honor Assume.assumeTrue(someFalseCondition). Instead of the test…
Raghvendra Singh
  • 1,775
  • 4
  • 26
  • 53
4
votes
1 answer

Spock's @IgnoreIf Closure doesn't see System prop variable, set in jUnit's Suite

I Use Geb + Spock + jUnit runner + Maven My Specs are like: @Stepwise class My_Spec extends GebReportingSpec { @IgnoreIf({properties['sss'].contains('true')}) def "testFeature 1" (){ println ("--> Feature 1 runs") given: …
Uniqobot
  • 65
  • 6
4
votes
0 answers

How to get the JUnit surefire report programatically

I need to use JUnitCore to run unit tests from a standalone jar test tool. I have added the surefire jars as dependencies and there I found the class org.apache.maven.surefire.junitcore.JUnitCoreRunListener. In this github this is a sample of its…
Camilo Crespo
  • 615
  • 5
  • 15
4
votes
0 answers

how to merge these two RunWith runners?

I have created two Runners both of whom are inherited from BlockJUnit4ClassRunner. One is to filter some tests based on conditions. The other is to run test multiple methods concurrently. I want to apply both these runner so that the tests are run…
user389955
  • 9,605
  • 14
  • 56
  • 98
4
votes
1 answer

How to run scenarios in Cucumber-JVM in parallel?

I have a set of acceptance tests written for the Cucumber-JVM. In order to reduce the feedback time I would like to run the scenarios (of a feature) in parallel. How do I do that in the simplest and most convenient way? (I would prefer to be able to…
keyoxy
  • 4,423
  • 2
  • 21
  • 18
3
votes
0 answers

Espresso - Filtering tests with multiple annotations intersects instead of unifying

Update: Turns out that the annotation argument intersects the given filters, If anyone knows how to unify them instead I would be grateful I'm trying to filter my Espresso tests by annotations. For this purpose, I created 3 Annotations (One, Two &…
zwebie
  • 2,349
  • 1
  • 27
  • 43
3
votes
4 answers

org.openqa.selenium.remote.service.DriverService$Builder.createArgs()Lcom/google/common/collect/ImmutableList; with Selenium 3.5.3 Chrome 76

I'm writing Selenium Junit tests with IntelliJ. The tests run ok if I trigger from test directly. However, if I trigger tests from TestRunnerSuite with JunitCore, I encountered following weird error that I did not find a solution after researching…
user2751691
  • 401
  • 2
  • 10
  • 32
3
votes
1 answer

Android Studio doesn't import androidx testing classes properly

I have been working on sample UIAutomator project. I have created new Testcases using AndroidX Testing libraries. I am able to build, run the test cases from the command line. But when I tried to open the app from Android Studio I can see most of…
3
votes
0 answers

spring-boot testing - Could multiple test have a single context?

I have integration tests, that i want use single context. I know that all test initialize different beans therefore Spring restart on each tests. ( addded @DirtiesContext) But it's don't work? My parent class -…
3
votes
1 answer

Powermock: Notifications are not supported when all test-instances are created first

When I try to execute the below simplified JUnit test, it succeeds but i am getting an error message: Notifications are not supported when all test-instances are created…
M. Abbas
  • 6,409
  • 4
  • 33
  • 46
1
2
3
8 9