JUnit Questions and Answers – Dependency Management with Ivy

«
»

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

Answer: c
Explanation: The org.jmock.lib package contains implementations of the core interfaces.
advertisement

2. ______________ integrates jMock with JUnit 3.
a) org.jmock
b) org.jmock.api
c) org.jmock.lib
d) org.jmock.integration.junit3
View Answer

Answer: d
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

Answer: b
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

Answer: a
Explanation: The classes defined under org.jmock.concurrent help test concurrent code with jMock.
advertisement

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

Answer: a
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

Answer: b
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

Answer: a
Explanation: UnsupportedSynchronousOperationException reports that a DeterministicSchedular has been asked to perform a blocking wait.
advertisement

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

Answer: a
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

Answer: d
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

Answer: a
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.

advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn