ANT/ANT Mcq Sample Test,Sample questions

Question:
 createMock(String name, Class<T> toMock) throws _________________ exception.

1.IndexOutOfBounds

2.IllegalArgumentException

3.NullPointer

4.Arithmetic


Question:
 Mocks are Trojan horses because they replace real ___________ from the inside, without the calling classes being aware of it.

1.Methods

2.Objects

3.Variables

4.Classes


Question:
 The ____________ interface is used in the creation of partial mocks with EasyMock.
a) IMockBuilder<T>
b) IMocker<T>
c) IBuilder<T>expect(T value)
d) MockBuilder<T>

1. IMockBuilder<T>

2.IMocker<T>

3. IBuilder<T>expect(T value)

4. MockBuilder<T>


Question:
 The _______________ interface decides whether an actual argument is accepted.

1.IMockBuilder<T>

2. IMocker<T>

3.IBuilder<T>expect(T value)

4.IArgumentMatcher


Question:
 _______________ expect the last invocation between min and max times.

1.times(int count)

2.times(int min, int max)

3.once()

4. asStub()


Question:
. The __________ interface allows setting expectations for an associated expected invocation.

1.IMocksControl

2.IExpectationSetters<T>

3.IExpectation<T>

4.Isetters<T>


Question:
5. ____________ expect the last invocation a specified number of times.

1. times(int count)

2.times(int min, int max)

3.once()

4.asStub()


Question:
EasyMock relies heavily on the __________import feature of Java.

1.Dynamic

2.Static

3.Class

4.Object


Question:
To use the createMock method of EasyMock we need to import ___________

1.org.easymock.EasyMock.createMock

2.org.EasyMock.createMock

3. org.easymock.createMock

4.org.createMock


Question:
When we’re talking about mock objects, a/an _________ is a feature built into the mock that verifies whether the external class calling this mock has the correct behavior.

1.Expectation

2.Explanation

3.Behavior

4.Amorous


Question:
__________ is used for the creation of a mock object, with the specification of it being of the requested type, which has implementations of the given interface or extends the given class.

1.createMock(Class<T> toMock)

2.createMock(MockType type, Class<T> toMock)

3.createMock(String name, Class<T>toMock)

4.createMock(String name, MockType type, Class<T>toMock)


Question:
__________ method creates a mock object that implements the given interface, order checking is enabled by default.

1.createNiceControl

2.createMockBuilder

3.createNiceMock

4.createStrictMock


Question:
____________ creates a control of the requested type.

1. createControl()

2.createControl(MockType type)

3.createNiceControl()

4. createNiceMock(Class<T> toMock)


Question:
____________ function expect the last invocation any times.

1.andStubReturn(T value)

2.andThrow(Throwable throwable)

3.anyTimes()

4.asStub()


Question:
____________ records a call but returns nothing.

1.andVoid()

2.times(int min, int max)

3.once()

4.asStub()


Question:
_____________ creates a mock object that implements the given interface with the specification is that order checking is disabled by default.

1.createMock(Class<T> toMock)

2.createMock(MockType type, Class<T>toMock)

3.createMock(String name, Class<T> toMock)

4.createMock(String name, MockType type, Class<T> toMock)


Question:
_____________ expects the last invocation once.

1.andVoid()

2. times(int min, int max)

3.once()

4.asStub()


Question:
_____________ returns the expectation setter for the last expected invocation in the current thread.

1.createControl()

2.createControl(MockType type)

3.createNiceControl()

4.expect(T value)


Question:
_____________ sets a stub object that will be used for the calculation of the answer for the expected invocation.

1.andAnswer(IAnswer<? extends T>answer)

2.andDelegateTo(Object delegateTo)

3.andStubAnswer(IAnswer<? extends T> answer)

4.andThrow(Throwable throwable)


Question:
_____________ sets stub behavior for the expected invocation.

1.andStubReturn(T value)

2.andThrow(Throwable throwable)

3.anyTimes()

4.asStub()


Question:
______________ sets a return value that will be returned for the expected invocation.

1.andReturn(T value)

2.times(int min, int max)

3.once()

4.asStub()


Question:
_______________ sets a stub object implementing the same interface as the mock.

1.andAnswer(IAnswer<? extends T> answer)

2.andDelegateTo(Object delegateTo)

3.andStubAnswer(IAnswer<? extends T> answer)

4. andStubDelegateTo(Object delegateTo)


Question:
________________ creates a mock builder allowing to create a partial mock for the given class or interface.

1.createMockBuilder(Class<T> toMock)

2.createMock(Class<T> toMock)

3.createNiceControl()

4.createNiceMock(Class<T> toMock)


Question:
__________________ 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.

1.createMock(Class <T> toMock)

2.createMock(MockType type, Class<T> toMock)

3.createMock(String name, Class<T> toMock)

4.createMock(String name, MockType type, Class<T> toMock)


More MCQS

  1. ANT Mcq Question Set 1
  2. ANT Mcq Question Set 2
  3. ANT Mcq
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!