Junit Flashcards

1
Q

What is JUnit

A

JUnit is a popular open-source testing framework for Java. It provides a platform to write and run repeatable tests, making it easier to automate and validate Java code. JUnit supports annotations to define test methods, setup and teardown methods, and assertions to verify expected outcomes, helping developers ensure the correctness of their code through automated testing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What JUnit annotations do you know?

A

@Test, @Before, @After, @BeforeClass, @AfterClass, @Ignore.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What JUnit assert methods do you use?

A

Assert.assertTrue, Assert.assertFalse,
Assert.assertEquals
Assert.assertNotEquals,
Assert.Null.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you skip a test in JUnit?

A

You can skip a test in JUnit by using the @Ignore annotation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly