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
2
votes
2 answers

Custom ClassLoader to proxy static library class in JUnit tests

Question Is it possible to provide an implementation of a class, using a custom ClassLoader, that will be properly utilized from a static context? Background I am working with a framework which recommends we use a static class to wire up…
Sean Connolly
  • 5,692
  • 7
  • 37
  • 74
1
vote
1 answer

junit custom runner implementation

I am trying to customize a runner for junit. I am using the Extended runner given here: http://codehowtos.blogspot.com/2011/04/run-junit-test-repeatedly.html adding my own created Filter Runner's code, which extends Runner, to the ExtendedRunner…
vpradhan
  • 161
  • 2
  • 7
1
vote
0 answers

Excluding Time Duration of @BeforeEach and @AfterEach in JUnit5

I Noticed, that JUnit5 @BeforeEach and @AfterEach is included into Test time duration. I am writing a Performance test, which results is presented on Jenkins Performance report, which takes data from JUnit5 results and draws a Graph, but problem is…
1
vote
1 answer

io.cucumber.core.exception.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter

I'm new on stackoverflow, I'm really in trouble and I need help! :) I'm developing a test automation program in Java using jdk-11 with Cucumber + Extent Reports. When I try to run my Runner class with JUnit, I got this error…
lucascologni
  • 11
  • 1
  • 2
1
vote
1 answer

Missing attribute in JUnit report

When I look the JUnit xsd into the JUnit project https://github.com/junit-team/junit5/blob/master/platform-tests/src/test/resources/jenkins-junit.xsd I see that the skipped attribute is not present into the testsuites node. Only the disabled is…
HugoBoss33
  • 11
  • 1
1
vote
1 answer

JUnit doesn't discover classes within a folder with --select-directory

I tried to run with junit5 with stand alone runner the following command: java -jar ex1/lib/junit-platform-console-standalone-1.6.0-M1.jar --select-directory="./ex1/test" with the following hierarchy: . ├── ex1 │ ├── lib │ │ ├──…
Mr P
  • 11
  • 2
1
vote
1 answer

Need to send Publish Test result chart in Email notification

I need to capture image form publish test result and that captured image needs to send in an email. is this possible in Azure DevOps ci/cd pipeline? I have attached below screenshot for reference. Please help me.
Mitul Patel
  • 66
  • 1
  • 1
  • 11
1
vote
1 answer

java.lang.NullPointerException is occuring due to property is not loading in Mockito when mocking a method

I am new to Mockito and i am facing a issue due to a property is not loading in from appication.properties file. Problem statement: I am trying to mock a method which uses a property from the application.properties file. When the control arrives at…
1
vote
1 answer

junit couldn't load the value in resource folder

I am using MockitoJUnit library to test my controller. there are some variables which are declared as: @Value("${mine.port}") private Integer port; when I run my test, it could not find the value mine.port in the resource folder as properties file.…
lin
  • 167
  • 1
  • 3
  • 13
1
vote
1 answer

Pragmatically allow User to pick which JUnit Test Classes will be run

I am trying to pass a list of classes as a parameter. (Can I do this?) I am using JUnit and Selenium, I have JUnit test classes that are called by a JUnit test suite class, using @SuiteClasses() and that test suite class is called by a class…
Alex
  • 160
  • 1
  • 2
  • 22
1
vote
0 answers

Android JUnit test error with Robotium

android jnuit test project import *** .... @SuppressWarnings("rawtypes") public class LoginTest extends ActivityInstrumentationTestCase2 { public Solo solo; public Activity activity; private static Class launchActivityClass; …
AsapRun
  • 11
  • 3
1
vote
1 answer

Run jqwik tests with Jupiter console launcher

For testing purposes (no pun intended) I run some tests outside the IDE or MAven using the Console Launcher that comes with JUnit Jupiter. It finds all the JUnit 4 (aka. Vintage) and JUnit 5 (aka. Jupiter) tests. However, it does not discover my…
Michael Piefel
  • 18,660
  • 9
  • 81
  • 112
1
vote
1 answer

How do I step into the source code of the JUnit plugin in IntelliJ?

When I run my test in debugging mode in IntelliJ (2017.2 Community Edition), the source code is only available for some of the code. In particular, when I step through code in the package com.intellij.junit4, the debugger shows the method name and…
bisgardo
  • 4,130
  • 4
  • 29
  • 38
1
vote
0 answers

Custom JUnit runner manually firing RunNotifier, but Maven Failsafe Plugin doesn't receive the right number of test results

I'm implementing a custom JUnit runner which extends BlockJUnit4ClassRunner, that can be executed using the Maven Failsafe Plugin. The runner sends the tests to a Java application server to run, then receives the test results back using Java…
Charles
  • 4,372
  • 9
  • 41
  • 80
1
vote
0 answers

SpringJUnit4ClassRunner context configuration with Resource values

I am trying to configure Spring, Junit and Hibernate (to enable @Autowire annotation for our test cases). My current setup is this: @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration({ …
sudshekhar
  • 1,576
  • 3
  • 18
  • 31
1 2 3
8 9