This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “Dependency Management with Ivy”.
1. _______________ contains implementations of the core interfaces that are used to adjust or extend jMock’s basic functionality.
a) org.jmock
b) org.jmock.api
c) org.jmock.lib
d) org.jmock.integration.junit3
View Answer
Explanation: The org.jmock.lib package contains implementations of the core interfaces.
2. ______________ integrates jMock with JUnit 3.
a) org.jmock
b) org.jmock.api
c) org.jmock.lib
d) org.jmock.integration.junit3
View Answer
Explanation: org.jmock.integration.junit4 is used to integrate jMock with JUnit 4.
3. Which package contains interfaces that define jMock’s Domain Specific Embedded Language?
a) org.jmock
b) org.jmock.syntax
c) org.jmock.lib
d) org.jmock.integration.junit3
View Answer
Explanation: org.jmock.syntax defines interfaces that define jMock’s Domain Specific Embedded Language.
4. ________________ contains classes to help test concurrent code with jMock.
a) org.jmock.concurrent
b) org.jmock.syntax
c) org.jmock.lib
d) org.jmock.integration.junit3
View Answer
Explanation: The classes defined under org.jmock.concurrent help test concurrent code with jMock.
5. ______________ is a class that “blitzes” an object by calling it many times, from multiple threads.
a) Blitzer
b) DeterministicExecutor
c) DeterministicScheduler
d) Synchroniser
View Answer
Explanation: The Blitzer class calls an object many times from different and multiple threads.
6. __________ class is an Executor that executes commands on the thread that calls runPendingCommands or runUntilIdle.
a) Blitzer
b) DeterministicExecutor
c) DeterministicScheduler
d) Synchroniser
View Answer
Explanation: The DeterministicExecutor executes commands on the thread calling runPendingCommands.
7. ____________ Exception is thrown to report that a DeterministicScheduler has been asked to perform a blocking wait, which is not supported.
a) UnsupportedSynchronousOperationException
b) ArrayIndexOutOfBounds
c) StringIndexoutOfBounds
d) Arithmetic
View Answer
Explanation: UnsupportedSynchronousOperationException reports that a DeterministicSchedular has been asked to perform a blocking wait.
8. ______________ is a ScheduledExecutorService that executes commands on the thread that calls runNextPendingCommand, runUntilIdle or tick.
a) Blitzer
b) DeterministicExecutor
c) DeterministicScheduler
d) Synchroniser
View Answer
Explanation: DeterministicScheduler executes on the thread calling runNextPendingCommand.
9. ___________ is a ThreadingPolicy that makes the Mockery thread-safe and helps tests synchronize with background threads.
a) Blitzer
b) DeterministicExecutor
c) DeterministicScheduler
d) Synchroniser
View Answer
Explanation: The Synchroniser class is used to make mockery thread safe.
10. ____________ Interface objects executes submitted Runnable tasks.
a) Executor
b) Execution
c) Runner
d) RunWith
View Answer
Explanation: Executor interface provides a way of decoupling task submission.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Computer Science Internship
- Check Programming Books
- Practice Programming MCQs
- Check JUnit Books