Olete.in
Articles
Mock Tests
🧪 jUnit MCQ Quiz Hub
Junit Mcq Question Set 3
Choose a topic to test your knowledge and improve your jUnit skills
1. The _____________ is the list of work the Development Team must address during the next Sprint.
Sprint Review
Sprint Backlog
Product Increment
Product backlog
2. ______ checks if an attribute is blank or not.
BaseIfAttribute
IfBlankAttribute
IfTrueAttribute
IfSetAttribute
3. ______ check if an attribute value is true or not.
BaseIfAttribute
IfBlankAttribute
IfTrueAttribute
IfSetAttribute
4. ______ is an interface indicating that a reader may be chained to another one.
TokenFilter.Filter
BaseFilterReader
BaseParamFilterReader
ChainableReader
5. ________ is the base class for core filter readers.
TokenFilter.Filter
BaseFilterReader
BaseParamFilterReader
ChainableReader
6. ________ is a parameterized base class for core filter readers.
TokenFilter.Filter
BaseFilterReader
BaseParamFilterReader
ChainableReader
7. ______ class is used for assembling the constants declared in a Java class in key1=value1(line separator)key2=value2 format.
ClassConstants
BaseFilterReader
BaseParamFilterReader
ChainableReader
8. _______ converts text to local OS formatting conventions along with repairing the text damaged by file transfer programs.
ClassConstants
BaseFilterReader
BaseParamFilterReader
FixCrLfFilter
9. ______ reads the first n lines of a stream.
ClassConstants
HeadFilter
BaseParamFilterReader
FixCrLfFilter
10. _______ is a Sax2 based project reader.
AntXMLContext
DefaultExecutor
ProjectHelperImpl
ProjectHelper2
11. _______ is a “Single-check” Target executor implementation.
SingleCheckExecutor
DefaultExecutor
ProjectHelperImpl
ProjectHelper2
12. When we’re talking about mock objects, a/an _________ is a feature built into the mock that verifies whether the external class calling this mock has the correct behavior.
Expectation
Explanation
Behavior
Amorous
13. EasyMock instantiates an object based on an interface or class.
True
False
all of the above
none of the above
14. EasyMock relies heavily on the _______import feature of Java.
Dynamic
Static
Class
Object
15. To use the createMock method of EasyMock we need to import ______
org.easymock.EasyMock.createMock
org.EasyMock.createMock
org.easymock.createMock
org.createMock
16. ______ method creates a mock object that implements the given interface, order checking is enabled by default.
createNiceControl
createMockBuilder
createNiceMock
createStrictMock
17. ______ is used for the creation of a mock object, with the specification of it being of the requested type, which has implementations of the given interface or extends the given class.
createMock(Class<T> toMock)
createMock(MockType type, Class<T> toMock)
createMock(String name, Class<T>toMock)
createMock(String name, MockType type, Class<T>toMock)
18. ___________ creates a mock object, of the requested type and name which are passed, which also has implementations of the given interface or extends the given class.
createMock(Class <T> toMock)
createMock(MockType type, Class<T> toMock)
createMock(String name, Class<T> toMock)
createMock(String name, MockType type, Class<T> toMock)
19. _____ creates a mock object that implements the given interface with the specification is that order checking is disabled by default.
createMock(Class<T> toMock)
createMock(MockType type, Class<T>toMock)
createMock(String name, Class<T> toMock)
createMock(String name, MockType type, Class<T> toMock)
20. createMock(String name, Class<T> toMock) throws ______ exception.
IndexOutOfBounds
IllegalArgumentException
NullPointer
Arithmetic
21. ______ creates a mock builder allowing to create a partial mock for the given class or interface.
createMockBuilder(Class&lt;T&gt; toMock)
createMock(Class&lt;T&gt; toMock)
createNiceControl()
createNiceMock(Class&lt;T&gt; toMock)
22. The ____________ interface is used in the creation of partial mocks with EasyMock.
IMockBuilder&lt;T&gt;
IMocker&lt;T&gt;
IBuilder&lt;T&gt;expect(T value)
MockBuilder&lt;T&gt;
23. _________ creates a control of the requested type.
createControl()
createControl(MockType type)
createNiceControl()
createNiceMock(Class&lt;T&gt; toMock)
24. _____ returns the expectation setter for the last expected invocation in the current thread.
createControl()
createControl(MockType type)
createNiceControl()
expect(T value)
25. anyObject() expects any double argument.
True
False
all of the above
none of the above
26. ______ expects a comparable argument greater than or equal the given value.
anyObject()
anyString()
geq(Comparable&lt;T&gt; value)
anyDouble()
27. By default, a mock is thread safe.
True
False
all of the above
none of the above
28. ________ create a new capture instance that will keep only the last captured value.
newCapture()
makeThreadSafe()
createNiceControl()
createNiceMock(Class&lt;T&gt; toMock)
29. ______ reports an argument matcher.
newCapture()
makeThreadSafe()
reportMatcher(IArgumentMatcher matcher)
createNiceMock(Class&lt;T&gt; toMock)
30. The ______ interface decides whether an actual argument is accepted.
IMockBuilder&lt;T&gt;
IMocker&lt;T&gt;
IBuilder&lt;T&gt;expect(T value)
IArgumentMatcher
31. The __________ interface allows setting expectations for an associated expected invocation.
IMocksControl
IExpectationSetters&lt;T&gt;
IExpectation&lt;T&gt;
Isetters&lt;T&gt;
32. ______ function expect the last invocation any times.
andStubReturn(T value)
andThrow(Throwable throwable)
anyTimes()
asStub()
33. ______ sets stub behavior for the expected invocation.
andStubReturn(T value)
andThrow(Throwable throwable)
anyTimes()
asStub()
34. ________ expect the last invocation between min and max times.
times(int count)
times(int min, int max)
once()
asStub()
35. _____ expect the last invocation a specified number of times.
times(int count)
times(int min, int max)
once()
asStub()
36. ________ sets a stub object that will be used for the calculation of the answer for the expected invocation.
andAnswer(IAnswer&lt;? extends T&gt;answer)
andDelegateTo(Object delegateTo)
andStubAnswer(IAnswer&lt;? extends T&gt; answer)
andThrow(Throwable throwable)
37. __________ sets a stub object implementing the same interface as the mock.
andAnswer(IAnswer&lt;? extends T&gt; answer)
andDelegateTo(Object delegateTo)
andStubAnswer(IAnswer&lt;? extends T&gt; answer)
andStubDelegateTo(Object delegateTo)
38. _______ records a call but returns nothing.
andVoid()
times(int min, int max)
once()
asStub()
39. ______ expects the last invocation once.
andVoid()
times(int min, int max)
once()
asStub()
40. _____ sets a return value that will be returned for the expected invocation.
andReturn(T value)
times(int min, int max)
once()
asStub()
41. ______ contains implementations of the core interfaces that are used to adjust or extend jMock’s basic functionality.
org.jmock
org.jmock.api
org.jmock.lib
org.jmock.integration.junit3
42. ________ integrates jMock with JUnit 3.
org.jmock
org.jmock.api
org.jmock.lib
org.jmock.integration.junit3
43. ______ contains classes to help test concurrent code with jMock.
org.jmock.concurrent
org.jmock.syntax
org.jmock.lib
org.jmock.integration.junit3
44. ________ is a class that “blitzes” an object by calling it many times, from multiple threads.
Blitzer
DeterministicExecutor
DeterministicScheduler
Synchroniser
45. _____ class is an Executor that executes commands on the thread that calls runPendingCommands or runUntilIdle.
Blitzer
DeterministicExecutor
DeterministicScheduler
Synchroniser
46. ______ Exception is thrown to report that a DeterministicScheduler has been asked to perform a blocking wait, which is not supported.
UnsupportedSynchronousOperationException
ArrayIndexOutOfBounds
StringIndexoutOfBounds
Arithmetic
47. _______ is a ScheduledExecutorService that executes commands on the thread that calls runNextPendingCommand, runUntilIdle or tick.
Blitzer
DeterministicExecutor
DeterministicScheduler
Synchroniser
48. ______ is a ThreadingPolicy that makes the Mockery thread-safe and helps tests synchronize with background threads.
Blitzer
DeterministicExecutor
DeterministicScheduler
Synchroniser
49. _______ Interface objects executes submitted Runnable tasks.
Executor
Execution
Runner
RunWith
50. The Executor implementations provided implement ____________ which is a more extensive interface.
ExecutorService
ThreadPoolExecutor
ArrayDeque
SerialExecutor
Submit