jUnit/Junit Mcq Question Set 4 Sample Test,Sample questions

Question:
InterruptedException is thrown if any task cannot be scheduled for execution.

1.True

2.False

3.all of the above

4.none of the above


Question:
Mutation testing is a form of ________

1.Black Box Testing

2.Redundancy

3. White Box Testing

4.Loss Testing


Question:
NullPointerException is thrown if tasks or any of its elements are null.

1.True

2. False

3.all of the above

4.none of the above


Question:
Other than RejectedExecutionException, the execute(Runnable command) function can also throw which exception?

1.Arithmetic

2.ArrayIndexOutOfBounds

3.StringIndexOutOfBounds

4. NullPointerException


Question:
The _______ exception can be thrown by the execute(Runnable command) function.

1.Arithmetic

2.ArrayIndexOutOfBounds

3. StringIndexOutOfBounds

4.RejectedExecutionException


Question:
The __________ command executes the given command at some time in the future.

1.Execution()

2. execute(Runnable command)

3. scheduleNext()

4. poll()


Question:
When a call to tick returns, the executor will be idle.

1. True

2.False

3.all of the above

4.none of the above


Question:
____ submits a value-returning task for execution and returns a Future representing the pending results of the task.

1.submit(Callable<T> task)

2. awaitTermination

3.submit(Runnable task, T result)

4.invokeAll()


Question:
_____ runs executed commands until there are no commands pending execution.

1.runUntilIdle

2.runPendingCommands

3. execute

4. isIdle


Question:
_______ exception is thrown while invokeAll() is interrupted while waiting.

1.InterruptedException

2.NullPointerException

3. RejectedExecutionException

4.ArrayIndexOutOfBoundsException


Question:
_______ executes the given tasks, returning the result of one that has completed successfully.

1.isShutdown

2.invokeAny(Collection<? extends Callable<T>> tasks)

3.invokeAll(Collection<? extends Callable<T>> tasks)

4.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)


Question:
_______ initiates an orderly shutdown in which previously submitted tasks are executed.

1. Shutdown

2.invokeAny(Collection<? extends Callable<T>> tasks)

3. invokeAll(Collection<? extends Callable<T>> tasks)

4.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)


Question:
_______ returns true if all tasks have completed following shut down.

1.submit(Callable<T> task)

2. isTerminated

3.submit(Runnable task, T result)

4. invokeAll()


Question:
_______ runs all commands that are currently pending.

1.runUntilIdle

2.runPendingCommands

3. execute

4. isIdle


Question:
_______ runs time forwards by a given duration, executing any commands scheduled for execution during that time period.

1.runUntilIdle

2.runPendingCommands

3. tick

4.isIdle


Question:
_______ submits a Runnable task for execution and returns a Future representing that task.

1.submit(Callable<T> task)

2.awaitTermination

3. submit(Runnable task, T result)

4.invokeAll()


Question:
________ returns true if this executor has been shut down.

1.isShutdown

2.isTerminated

3. submit(Runnable task, T result)

4.invokeAll()


Question:
_________ blocks until all tasks have completed execution after a shutdown request, or the timeout occurs.

1.awaitTermination

2. runPendingCommands

3.tick

4.isIdle


Question:
_________ is used for the execution of the given tasks, returning a list of Futures holding their status and results after completion.

1. isShutdown

2. isTerminated

3.invokeAll(Collection<? extends Callable<T>> tasks)

4.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)


Question:
__________ returns whether this executor is idle.

1.runUntilIdle

2.runPendingCommands

3.execute

4.isIdle


More MCQS

  1. Junit Mcq Question Set 1
  2. Junit Mcq Question Set 2
  3. Junit Mcq Question Set 3
  4. Junit Mcq Question Set 4
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!