Home / CSE MCQs / JUnit MCQs :: JUnit Running JUnit Tests from Ant

CSE MCQs :: JUnit MCQs

  1. The ____________ interface is used in the creation of partial mocks with EasyMock.
  2. A.
    IMockBuilder
    B.
    IMocker
    C.
    IBuilder
    D.
    MockBuilder

  3. ______________ create a new capture instance that will keep only the last captured value.
  4. A.
    newCapture()
    B.
    makeThreadSafe()
    C.
    createNiceControl()
    D.
    createNiceMock(Class toMock)

  5. EasyMock relies heavily on the __________import feature of Java.
  6. A.
    Dynamic
    B.
    Static
    C.
    Class
    D.
    Object

  7. __________________ 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.
  8. A.
    createMock(Class toMock)
    B.
    createMock(MockType type, Class toMock)
    C.
    createMock(String name, Class toMock)
    D.
    createMock(String name, MockType type, Class toMock)

  9. _____________ exception is thrown while invokeAll() is interrupted while waiting.
  10. A.
    InterruptedException
    B.
    NullPointerException
    C.
    RejectedExecutionException
    D.
    ArrayIndexOutOfBoundsException

  11. _______________ is used for the execution of the given tasks, returning a list of Futures holding their status and results after completion.
  12. A.
    isShutdown
    B.
    isTerminated
    C.
    invokeAll(Collection? extends Callable tasks)
    D.
    invokeAll(Collection extends Callable tasks, long timeout, TimeUnit unit)

  13. Other than RejectedExecutionException, the execute(Runnable command) function can also throw which exception?
  14. A.
    Arithmetic
    B.
    ArrayIndexOutOfBounds
    C.
    StringIndexOutOfBounds
    D.
    NullPointerException

  15. __________ class is an Executor that executes commands on the thread that calls runPendingCommands or runUntilIdle.
  16. A.
    Blitzer
    B.
    DeterministicExecutor
    C.
    DeterministicScheduler
    D.
    Synchroniser

  17. _____________ expects the last invocation once.
  18. A.
    andVoid()
    B.
    times(int min, int max)
    C.
    once()
    D.
    asStub()

  19. ____________ expect the last invocation a specified number of times.
  20. A.
    times(int count)
    B.
    times(int min, int max)
    C.
    once()
    D.
    asStub()