Top "Junit4" questions

Version 4 of the popular Junit Java Unit testing framework

Spring JUnit Test Error

I am receiving the following error when I attempt to run my Spring JUnit test. I am just trying to …

spring junit4
JUnit 4 @BeforeClass & @AfterClass when using Suites

When using this approach below, by setting up the jUnit with Suites. We got the problem when all @BeforeClass in …

java junit junit4
How to make JUnit test cases to run in sequential order?

I am using JUnit4. I have a set of test methods in a test case. Each test method inserts some …

java junit operating-system junit4
Why can't I import AndroidJUnit4 and ActivityTestRule into my unit test class?

I'm having trouble importing some of the Android UI testing framework classes - I just can't figure out what is …

android android-support-library junit4 android-espresso
How to get Junit 4 to ignore a Base Test Class?

I have a base class for many tests that has some helper methods they all need. It does not by …

junit junit4
PowerMock throws NoSuchMethodError (setMockName)

I'm trying to mock a constructor using PowerMockito but every time I run the test I get the following error: …

java mockito junit4 powermock
JUnit assertions : make the assertion between floats

I need to compare two values : one a string and the other is float so I convert the string to …

java junit junit4
Test expected exceptions in Kotlin

In Java, the programmer can specify expected exceptions for JUnit test cases like this: @Test(expected = ArithmeticException.class) public void …

unit-testing kotlin testing exception junit4
Run all tests in Junit 4

I want to be able to run all tests in a project programmatically. I know Eclipse has a "Run as …

java eclipse junit junit4
Junit assert OR condition in my test case

In my test case, I get an integer value: int val = getXXX(); Then, I would like to check if val …

java unit-testing junit junit4 junit3