Maven/Maven Mcq Set 3 Sample Test,Sample questions

Question:
 The _________ rule can be used to test both exception type and message.

1. Expected

2.ExpectedException

3.CatchException

4.Catch


Question:
 ______ is used only to improve the readability of the statements.

1.anything

2.is

3. sameInstance

4.nullValue


Question:
@Test(timeout = 130) implies a time limit of ______

1.130 milliseconds

2. 130 minutes

3. 130 seconds

4.1.30 minutes


Question:
A Timeout Rule is initialized by _______

1.@Rule public Timeout object = new Timeout()

2.@Rule public Timeout object = Timeout.seconds()

3. public Timeout object = Timeout.seconds()

4. public Timeout object = new Timeout()


Question:
A/An __________ property is an array instead of a single value.

1.Indexed

2. valued

3.null

4.variable


Question:
AOP forms a basis for ______

1.Functional Development

2. Object Oriented Programming

3.Datafield Development

4.Aspect Oriented Software Development


Question:
assertThat(0.03, is(closeTo(1.0, 0.03))) is _____

1. True

2. False

3. Null

4. Error


Question:
assertThat(1.03, is(closeTo(1.0, 0.03))) is _____

1.True

2.False

3.Null

4. Error


Question:
Class JUnitMatchers extends _______

1. java.lang.Object

2. java.lang.String

3.java.util.*

4.java.util.Arrays


Question:
Custom JUnit rules can be created using _______

1.TestRule Interface

2.TestRule Interface

3.RuleCreate Interface

4.RuleInitialize Interface


Question:
ExpectedException is found under which package?

1.org.junit.ExpectedException

2.org.junit.Test.ExpectedException

3. org.junit.Rule.ExpectedException

4.org.junit.rules.ExpectedException


Question:
Hamcrest is not a _______ framework in itself.

1.Matching

2.Testing

3.Asserting

4.Checking


Question:
If a timeout which has been specified lapses before the completion of the test, its execution is interrupted with _____

1. Interrupt()

2.Thread.interrupt()

3.Thread.interruptable()

4.Threads.interruptable()


Question:
The closeTo function is found under which package?

1.org.hamcrest.TypeSafeMatcher

2.org.hamcrest.BaseMatcher

3.org.hamcrest.number.IsCloseTo

4.org.hamcrest.number.CloseTo


Question:
The correct way to initialise an ExpectedException object is _____

1.public ExpectedException thrown = ExpectedException.none()

2. @Rule public ExpectedException thrown

3.@Rule public ExpectedException thrown = ExpectedException.none()

4.public ExpectedException thrown = ExpectedException.none()


Question:
The instanceOf matcher is equivalent to ________

1.isCompatibleType

2.isCompatible

3.isInstance

4. isSame


Question:
The isCloseTo class extends which base class?

1.Matcher

2.HamcrestCore

3.TypeMatcher

4.TypeSafeMatcher


Question:
The JUnit hasItem() function is a _______

1.Hamcrest Matcher

2.Instance Function

3. JUnitMatcher

4.Matcher


Question:
The package for the assertThat() function is?

1.org.hamcrest.CoreMatchers.assertThat

2.org.junit.Assert.assertThat

3.org.junit.JunitMatchers.assertThat

4.org.junit.hasItem.assertThat


Question:
The package to which hasItem() function belongs is ________

1. org.junit.JUnitMatchers.hasItem

2. org.junit.JUnitMatchers.hasItem

3.org.junit.Junit.hasItem

4.org.junit.hamcrest.hasItem


Question:
The Timeout Rule implements which interface?

1.Timeout

2. Test

3.TestingTimeout

4.TestRule


Question:
The TypeSafeMatcher implements the __________ interface.

1.Self

2.Describing

3.EqulityCheck

4. SelfDescribing


Question:
The _____ parameter is used along with the @Test annotation to test for timeouts.

1.Expected

2.Timeout

3.NoLimit

4.Time


Question:
The ___________ method of the TypeSafeMatcher class is made final.

1.matches

2.matchesSafely

3.describeMismatchSafely

4.No mehtod


Question:
The ____________ matcher checks if a given key is in a map.

1.hasEntry

2.hasValue

3.hasKey

4. isKey


Question:
Timeout testing is _____

1.Software Dependent

2. Hardware Dependent

3. Software and Hardware Dependent

4.Software and Hardware Independent


Question:
To define a ________ in a JavaBean class, public getter and setter methods have to be supplied.

1.Class

2.Object

3.Value

4.Property


Question:
To write custom matcher _____________ has to be implemented.

1. Matcher Interface

2.Hamcrest Interface

3.HamcrestMatching Interface

4.Not possible to implement


Question:
What applies the same timeout to every test method of a class?

1. @Timeout

2.@Expected

3. Timeout Rule

4.Not possible to apply same timeout


Question:
What are exceptions?

1. Anomalous conditions requiring special processing

2.Extra methods written to increase functionality

3. Commented lines describing exceptional cases

4.Null objects


Question:
What does a specified timeout of 0 imply?

1.130 milliseconds

2.130 minutes

3.130 seconds

4. Not set


Question:
What is timeout testing?

1.Testing for exceptions

2.Testing code execution within time limits

3.Testing code correctness

4.Testing code with time functions


Question:
Where is the Timeout class present?

1.org.junit.rules.Timeout

2.org.junit.Timeout

3.org.Timeout

4.org.junit.RuleClasses.Timeout


Question:
Which Hamcrest core matcher checks if a number is equal to a number of some acceptable error?

1.closeTo

2.equals

3.errorBy

4.similarTo


Question:
Which Hamcrest matcher is just like the && operator?

1.Is

2.Anything

3.sameInstance

4.allOf


Question:
With the ‘expected’ argument, one cannot ________

1. Test a method

2. Test for exception type

3.Test the value of the message in the exception

4.Test for specific exception


Question:
_____ is used for combining those matchers which must both pass.

1.all

2.both

3. justTwo

4.matchTwo


Question:
______ checks to see if any of the contained matchers match.

1.anyOf

2.allOf

3. instanceOf

4.notNull


Question:
______ Hamcrest matcher can be used to match absolutely everything.

1. Is

2.AnyOf

3. Anything

4. Not set


Question:
______ is a library that contains a lot of helpful matcher objects , ported in several languages.

1.Java

2.Pygame

3.AllenWake

4.Hamcrest


Question:
______ is a programming paradigm which allows the separation of cross cutting concerns, hence, increasing modularity.

1. Functional Programming

2. Object Oriented Programming

3.Aspect Oriented Programming

4.Data Injections


Question:
______ is used to test object identity.

1. instanceOf

2. isCompatibleType

3.type

4. sameInstance


Question:
______ tests whether a JavaBean has a particular property.

1.isProperty

2. porperty

3. hasProperty

4.isPresent


Question:
_______ describes a class of functions which when run modify other functions.

1.Class

2.Advice

3.Modifiers

4.Changers


Question:
_______ Hamcrest matcher tests for null values.

1. isNull

2. nullValue

3. isNullValue

4.isNullable


Question:
_______ is the base class for all Matcher implementations.

1.MatcherBase

2.Base

3.Matcher

4.BaseMatcher


Question:
_______ tests whether a given Map has a given entry.

1.hasItem

2.hasItems

3.hasValue

4.hasEntry


Question:
________ can be useful in adding additional functionality which applies to every test within a test class.

1.Copy

2.Rules

3.Exceptions

4.Boundaries


Question:
________ traverses the meaning of the contained matchers.

1.not

2.or

3. allOf

4.andAll


Question:
__________ tests whether a given string equals another one, ignoring the case.

1. stringEqual

2. equalToIgnoringCase

3.ignoringCaseEqual

4.equalToCase


More MCQS

  1. Maven Mcq Set 1
  2. Maven Mcq Set 2
  3. Maven Mcq Set 3
  4. Maven Mcq Set 4
  5. Maven Mcq Set 5
  6. Maven Mcq Set 6
  7. Maven Mcq Set 7
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite 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!