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

    View Answer

    Workspace

    Discuss Discuss in Forum


  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)

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    View Answer

    Workspace

    Discuss Discuss in Forum


  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)

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    View Answer

    Workspace

    Discuss Discuss in Forum


  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)

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    View Answer

    Workspace

    Discuss Discuss in Forum


  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

    View Answer

    Workspace

    Discuss Discuss in Forum


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

    View Answer

    Workspace

    Discuss Discuss in Forum


  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()

    View Answer

    Workspace

    Discuss Discuss in Forum