Explore topic-wise MCQs in Junit.

This section includes 14 Mcqs, each offering curated multiple-choice questions to sharpen your Junit knowledge and support exam preparation. Choose a topic below to get started.

1.

The ResourceHandler is found in the package ________________

A. org.mortbay.jetty.handler.ResourceHandler
B. org.jetty.handler.ResourceHandler
C. org.mortbay.junit.handler.ResourceHandler
D. org.junit.jetty.handler.ResourceHandler
Answer» B. org.jetty.handler.ResourceHandler
2.

A _____________ handler is attached to the root to serve files from the file system.

A. SourceHandler
B. ResourceHandler
C. AttachHandler
D. RootHandler
Answer» C. AttachHandler
3.

The ______________ method sets the document root from which to serve resources.

A. setResourceBase
B. resourceBase
C. setResource
D. setBase
Answer» B. resourceBase
4.

To create a Jetty context object, we have to import _____________

A. org.mortbay.jetty.Context;
B. org.jetty.Context;
C. org.mortbay.jetty.servlet.Context;
D. org.junit.Server;
Answer» D. org.junit.Server;
5.

When unit testing, it’s important to be able to control as much as possible of the environment in which the tests execute.

A. True
B. False
Answer» B. False
6.

A_______________HANDLER_IS_ATTACHED_TO_THE_ROOT_TO_SERVE_FILES_FROM_THE_FILE_SYSTEM.?$

A. SourceHandler
B. ResourceHandler
C. AttachHandler
D. RootHandler
Answer» C. AttachHandler
7.

The_ResourceHandler_is_found_in_the_package_________________$

A. org.mortbay.jetty.handler.ResourceHandler
B. org.jetty.handler.ResourceHandler
C. org.mortbay.junit.handler.ResourceHandler
D. org.junit.jetty.handler.ResourceHandler
Answer» B. org.jetty.handler.ResourceHandler
8.

The ______________ method sets the document root from which to serve resources?

A. setResourceBase
B. resourceBase
C. setResource
D. setBase
Answer» B. resourceBase
9.

While creating a server object like- Server obj = new Server(8080), 8080 represents the number of connections.

A. True
B. False
Answer» C.
10.

In Jetty, ____________ object processes the HTTP requests.

A. Server
B. Context
C. Root
D. Handler
Answer» C. Root
11.

To create a Jetty server object, we have to import _____________

A. org.mortbay.jetty.Server;
B. org.jetty.Server;
C. org.junit.jetty.Server;
D. org.junit.Server;
Answer» B. org.jetty.Server;
12.

Jetty was originally called ________________

A. Eclipse
B. Maven
C. Ant
D. IssueTracker
Answer» E.
13.

_______________ is a Java HTTP (Web) server and Java Servlet container.

A. Maven
B. Ant
C. Jetty
D. Zimbra
Answer» D. Zimbra
14.

When unit testing, it’s important to be able to control as much as possible of the environment in which the tests execute.

A. True
B. False
Answer» B. False