Java Basic


  1. Which method is used to verify the actual and expected results in Junits?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    assert method is used to compare actual and expected results in Junit. It has various implementation like assertEquals, assertArrayEquals, assertFalse, assertNotNull, etc.


  1. Which of these is not a mocking framework?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    EasyMock, jMock, Mockito, Unitils Mock, PowerMock and JMockit are a various mocking framework.



  1. Which of the below is an incorrect annotation with respect to JUnits?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    @Test is used to annotate method under test, @BeforeEach and @AfterEach are called before and after each method respectively. @BeforeClass and @AfterClass are called only once for each class.


  1. Which of the below statement about JUnit is false?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    JUnits test can be run automatically and they check their own results and provide immediate feedback.



  1. JUnits are used for which type of testing?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    JUnit is a testing framework for unit testing. It uses java as a programming platform. It is managed by junit.org community.