Home »
MCQs
EasyMock Multiple-Choice Questions (MCQs)
EasyMock is an open-source testing framework for Java released under the Apache License. The framework allows the creation of test double objects for the purpose of Test-driven Development or Behavior Driven Development. (Wikipedia)
EasyMock MCQs: This section contains multiple-choice questions and answers on the various topics of EasyMock. Practice these MCQs to test and enhance your skills on EasyMock.
List of EasyMock MCQs
1. Which programming language is the foundation of the EasyMock Library?
- Java
- Python
- Ruby
- C++
- C#
Answer: A) Java
Explanation:
Java is the foundation of the EasyMock library.
Discuss this Question
2. EasyMock library is used for ____?
- Developing a Software
- Deploying a software application
- Unit testing
- None
Answer: C) Unit testing
Explanation:
EasyMock library is used for unit testing.
Discuss this Question
3. ____ is a technique for testing a class's functionality in isolation.
- Nice Mock
- Disparaging
- Replay
- Mocking
Answer: D) Mocking
Explanation:
Mocking is a technique for testing a class's functionality in isolation.
Discuss this Question
4. Does Mocking require a database connection?
- Yes
- No
Answer: B) No
Explanation:
Mocking does not require a database connection.
Discuss this Question
5. ____- are simulated objects that imitate the behavior of actual objects in the system under test?
- Mock object
- Nice Mock
- Strict Mock
Answer: A) Mock object
Explanation:
Mock objects are simulated objects that imitate the behavior of actual objects in the system under test.
Discuss this Question
6. Is it possible to create a mock by calling one of its constructors?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, it is possible to create a mock by calling one of its constructors.
Discuss this Question
7. ____ annotation specifies the item that will be tested?
- @test
- @tested
- @object_test
Answer: B) @tested
Explanation:
@tested annotation specifies the item that will be tested.
Discuss this Question
8. Which of the following annotation is used to generate a mock class object?
- @object
- @mock_object
- @object@mock
- @mock
Answer: D) @mock
Explanation:
@mock annotation is used to generate a mock class object.
Discuss this Question
9. EasyMock determines whether or not a mock is being utilized by using which method.
- Check()
- CheckMock()
- Verify()
- VerifyMock()
Answer: C) Verify()
Explanation:
Verify() method is used to determine whether or not a mock is being utilized.
Discuss this Question
10. A ____ object replicates the behavior of only certain of its methods.
- Partial Mock
- Nice Mock
- Strict Mock
Answer: A) Partial Mock
Explanation:
A partial mock object replicates the behaviour of only certain of its methods.
Discuss this Question
11. Private methods cannot be mocked?
- True
- False
Answer: A) True
Explanation:
Private methods cannot be mocked.
Discuss this Question
12. If easymock.notThreadSafeByDefault=True then ____?
- By default, a mock will be thread-safe.
- By default, a mock will not be thread-safe.
- 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.
Discuss this Question
13. Mock Objects can be reset using ____?
- refresh (mock)
- reboot (mock)
- reset (mock)
Answer: C) reset (mock)
Explanation:
Mock Objects can be reset using reset (mock).
Discuss this Question
14. Which of the following are the alternatives to EasyMock?
- Mockito
- PowerMock
- WireMock
- All of the above
Answer: D) All of the above
Explanation:
Following are the alternatives to EasyMock:
- Mockito
- PowerMock
- WireMock
Discuss this Question
15. Can Easymock be used on Android?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, Easymock can be used on Android.
Discuss this Question
16. ____ can be used as an OSGi bundle.
- Easy object jar
- Mock jar Object
- EasyMock Object
- EasyMock jar
Answer: D) EasyMock jar
Explanation:
EasyMock jar can be used as an OSGi bundle.
Discuss this Question
17. Mocks are thread-safe by default during the replay phase.
- True
- False
Answer: A) True
Explanation:
Mocks are thread-safe by default during the replay phase.
Discuss this Question
18. A mock is ____ thread-safe during recording.
- Purely
- Partially
- Not
- None of the above
Answer: C) Not
Explanation:
A mock is not thread-safe during recording.
Discuss this Question
19. Mocks can be serialized at any point throughout their lifespan?
- True
- False
Answer: A) True
Explanation:
True, Mocks can be serialized at any point throughout their lifespan.
Discuss this Question
20. After being created, a ____ Mock Object has order checking enabled.
- Normal
- Strict
- Partial
Answer: B) Strict
Explanation:
After being created, a strict Mock Object has order checking enabled.
Discuss this Question