300+ Top EasyMock MCQ Questions and Answers Quiz

EasyMock Multiple Choice Questions

1. Does Mocking require a database connection?

  1. Yes
  2. No

Answer: B No

Explanation: Mocking does not require a database connection.

2. ____- are simulated objects that imitate the behavior of actual objects in the system under test?

  1. Mock object
  2. Nice Mock
  3. Strict Mock

Answer: A Mock object

Explanation: Mock objects are simulated objects that imitate the behavior of actual objects in the system under test.

3. Is it possible to create a mock by calling one of its constructors?

  1. Yes
  2. No

Answer: A Yes

Explanation: Yes, it is possible to create a mock by calling one of its constructors.

4. ____ annotation specifies the item that will be tested?

  1. @test
  2. @tested
  3. @object_test

Answer: B @tested

Explanation: @tested annotation specifies the item that will be tested.

5. Which programming language is the foundation of the EasyMock Library?

  1. Java
  2. Python
  3. Ruby
  4. C++
  5. C#

Answer: A Java

Explanation: Java is the foundation of the EasyMock library.

6. EasyMock library is used for ____?

  1. Developing a Software
  2. Deploying a software application
  3. Unit testing
  4. None

Answer: C Unit testing

Explanation: EasyMock library is used for unit testing.

7. ____ is a technique for testing a class’s functionality in isolation.

  1. Nice Mock
  2. Disparaging
  3. Replay
  4. Mocking

Answer: D Mocking

Explanation: Mocking is a technique for testing a class’s functionality in isolation.

8. Which of the following annotation is used to generate a mock class object?

  1. @object
  2. @mock_object
  3. @object@mock
  4. @mock

Answer: D @mock

Explanation: @mock annotation is used to generate a mock class object.

9. EasyMock determines whether or not a mock is being utilized by using which method.

  1. Check()
  2. CheckMock()
  3. Verify()
  4. VerifyMock()

Answer: C Verify()

Explanation: Verify() method is used to determine whether or not a mock is being utilized.

10. A ____ object replicates the behavior of only certain of its methods.

  1. Partial Mock
  2. Nice Mock
  3. Strict Mock

Answer: A Partial Mock

Explanation: A partial mock object replicates the behaviour of only certain of its methods.

11. Private methods cannot be mocked?

  1. True
  2. False

Answer: A True

Explanation: Private methods cannot be mocked.

12. If easymock.notThreadSafeByDefault=True then ____?

  1. By default, a mock will be thread-safe.
  2. By default, a mock will not be thread-safe.
  3. None

Answer: B By default, a mock will not be thread-safe.

Explanation: If easymock.notThreadSafeByDefault=True then, By default, a mock will not be thread-safe.

13. Mock Objects can be reset using ____?

  1. refresh (mock)
  2. reboot (mock)
  3. reset (mock)

Answer: C reset (mock)

Explanation: Mock Objects can be reset using reset (mock).

14. Which of the following are the alternatives to EasyMock?

  1. Mockito
  2. PowerMock
  3. WireMock
  4. All of the above

Answer: D All of the above

Explanation: Following are the alternatives to EasyMock:

  • Mockito
  • PowerMock
  • WireMock

15. Can Easymock be used on Android?

  1. Yes
  2. No

Answer: A Yes

Explanation: Yes, Easymock can be used on Android.

16. ____ can be used as an OSGi bundle.

  1. Easy object jar
  2. Mock jar Object
  3. EasyMock Object
  4. EasyMock jar

Answer: D EasyMock jar

Explanation: EasyMock jar can be used as an OSGi bundle.

17. Mocks are thread-safe by default during the replay phase.

  1. True
  2. False

Answer: A True

Explanation: Mocks are thread-safe by default during the replay phase.

18. A mock is ____ thread-safe during recording.

  1. Purely
  2. Partially
  3. Not
  4. None of the above

Answer: C Not

Explanation: A mock is not thread-safe during recording.

19. Mocks can be serialized at any point throughout their lifespan?

  1. True
  2. False

Answer: A True

Explanation: True, Mocks can be serialized at any point throughout their lifespan.

20. After being created, a ____ Mock Object has order checking enabled.

  1. Normal
  2. Strict
  3. Partial

Answer: B Strict

Explanation: After being created, a strict Mock Object has order checking enabled.

EasyMock objective questions with answers pdf download online exam test

Leave a Reply

Your email address will not be published. Required fields are marked *