JUnit Questions and Answers – Maven Plug-ins

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

Answer: a
Explanation: The AssertionErrorTranslator is a class that translates ExpectationErrors into AssertionErrors.
2. _________ is a naming scheme wherein the implicit name for a mock object is the mocked type’s name with the first character represented in lower case.
a) AssertionErrorTranslator
b) CamelCaseNamingScheme
c) CurrentStateMatcher
d) IdentityExpectationErrorTranslator
View Answer
Answer: b
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

Answer: d
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

Answer: c
Explanation: The JavaReflectionImposteriser class makes use of the Proxy class of the Java Reflection API.
advertisement
advertisement

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

Answer: d
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

Answer: a
Explanation: The RetroNamingScheme class defines a naming scheme with the prefix of “mock” for mock objects.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: b
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

Answer: a
Explanation: Invocations can be constrained to occur in a strict order defined by a sequence.
advertisement

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

Answer: b
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

Answer: d
Explanation: The Mockery class represents the context under test.
advertisement

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]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.