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

CSE MCQs :: JUnit MCQs

  1. What is the output of following set of code ?

    int a,b;
    a = (b = 10) + 5;
  2. A.
    b = 10, a = 5
    B.
    b = 15, a = 5
    C.
    a = 15, b = 10
    D.
    a = 10, b = 10

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What will be output of the following conversion ?

    static void Main(string[] args)
     {
         char a = 'A';
         string b = "a";
         Console.WriteLine(Convert.ToInt32(a));
         Console.WriteLine(Convert.ToInt32(Convert.Tochar(b)));
         Console.ReadLine();
     }

  4. A.
    1, 97
    B.
    65, 95
    C.
    65, 97
    D.
    97, 1

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. _________ is a class to represent a null and to stop the chain of lookups.
  6. A.
    LocalPropertyStack
    B.
    ResolvePropertyMap
    C.
    NullReturn
    D.
    ParseProperties

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. ___________ is the class to resolve properties in a map.
  8. A.
    LocalPropertyStack
    B.
    ResolvePropertyMap
    C.
    NullReturn
    D.
    ParseProperties

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. The __________ package contains plugins that make it easier to write custom actions by scripting their behaviour with BeanShell.
  10. A.
    org.jmock.api
    B.
    org.jmock.lib.action
    C.
    org.jmock.lib.script
    D.
    org.jmock.lib.legacy

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. ______________ method performs an action in response to an invocation.
  12. A.
    describeTo(Description description)
    B.
    invoke(Invocation invocation)
    C.
    perform(String script)
    D.
    where(String name, Object value)

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. __________ is a naming scheme in which the implicit name for a mock object is the mocked type's name prepend with "mock.
  14. A.
    RetroNamingScheme
    B.
    CamelCaseNamingScheme
    C.
    JavaReflectionImposteriser
    D.
    LastWordNamingScheme

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. ____________ is a TestCase that verifies postconditions after the test has run and before the fixture has been torn down.
  16. A.
    JUnit3ErrorTranslator
    B.
    JUnit3Mockery
    C.
    MockObjectTestCase
    D.
    VerifyingTestCase

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. _____________ returns the next of a sequence of elements each time it is invoked.
  18. A.
    ActionSequence
    B.
    CustomAction
    C.
    DoAllAction
    D.
    ReturnValueAction

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. _____________ performs multiple actions every time it is invoked.
  20. A.
    ActionSequence
    B.
    CustomAction
    C.
    DoAllAction
    D.
    ReturnValueAction

    View Answer

    Workspace

    Discuss Discuss in Forum