This set of JUnit Multiple Choice Questions & Answers (MCQs) focuses on “Maven Plug-ins”.
1. ____________ translates ExpectationErrors into AssertionErrors that several test frameworks, including JUnit 4 and TestNG, use to report errors.
a) AssertionErrorTranslator
b) CamelCaseNamingScheme
c) CurrentStateMatcher
d) IdentityExpectationErrorTranslator
View Answer
Explanation: The AssertionErrorTranslator is a class that translates ExpectationErrors into AssertionErrors.
a) AssertionErrorTranslator
b) CamelCaseNamingScheme
c) CurrentStateMatcher
d) IdentityExpectationErrorTranslator
View Answer
Explanation: The CamelCaseNamingScheme is the class which defines a naming for mock objects.
3. __________ is an ExpectationErrorTranslator that doesn’t do any translation.
a) AssertionErrorTranslator
b) CamelCaseNamingScheme
c) CurrentStateMatcher
d) IdentityExpectationErrorTranslator
View Answer
Explanation: IdentityExpectationErrorTranslator returns the ExpectationError it is given.
4. __________ is an Imposteriser that uses the Proxy class of the Java Reflection API.
a) AssertionErrorTranslator
b) CamelCaseNamingScheme
c) JavaReflectionImposteriser
d) IdentityExpectationErrorTranslator
View Answer
Explanation: The JavaReflectionImposteriser class makes use of the Proxy class of the Java Reflection API.
5. ___________ is a naming scheme in which the implicit name for a mock object is the last word of the mocked type’s name in lower case.
a) AssertionErrorTranslator
b) CamelCaseNamingScheme
c) JavaReflectionImposteriser
d) LastWordNamingScheme
View Answer
Explanation: The LastWordNamingScheme class defines a naming scheme for mock objects.
6. __________ is a naming scheme in which the implicit name for a mock object is the mocked type’s name prepend with “mock”.
a) RetroNamingScheme
b) CamelCaseNamingScheme
c) JavaReflectionImposteriser
d) LastWordNamingScheme
View Answer
Explanation: The RetroNamingScheme class defines a naming scheme with the prefix of “mock” for mock objects.
7. __________ function translates the given ExpectationError into an error type compatible with another testing framework.
a) change()
b) translate()
c) compatible()
d) mock()
View Answer
Explanation: Translate() returns an error that is compatible with another testing framework and contains the same message and stack trace as the passed parameter.
8. ___________ interface defines a sequence of expectations.
a) Sequence
b) States
c) Expectations
d) Mockery
View Answer
Explanation: Invocations can be constrained to occur in a strict order defined by a sequence.
9. __________ is an interface which defines a state machine that is used to constrain the order of invocations.
a) Sequence
b) States
c) Expectations
d) Mockery
View Answer
Explanation: The States interface defines the state machine.
10. ____________ class represents the context, or neighborhood, of the object(s) under test.
a) Sequence
b) States
c) Expectations
d) Mockery
View Answer
Explanation: The Mockery class represents the context under test.
Sanfoundry Global Education & Learning Series – JUnit.
To practice all areas of Junit, here is complete set of 1000+ Multiple Choice Questions and Answers.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Apply for Computer Science Internship
- Practice Programming MCQs
- Check JUnit Books
- Check Programming Books