Spring MCQ Quiz Hub

Spring Mcq Set 10

Choose a topic to test your knowledge and improve your Spring skills

The file which is the standard JPA configuration file to enable the Hibernate-based JPA implementation.





✅ Correct Answer: 2

Spring application context, src/main/resources/META-INF/spring/applicationContext.xml consists of:-





✅ Correct Answer: 4

Command to create a Spring MVC controller that provides a UI:-





✅ Correct Answer: 1

To deploy the application to a web container:-





✅ Correct Answer: 3

Spring Roo’s root folder (or any of the source packages) is:-





✅ Correct Answer: 4

This encapsulates the context of a test’s execution:-





✅ Correct Answer: 1

This manages a test context for a test and triggers test execution listeners:-





✅ Correct Answer: 2

This defines a listener interface; by implementing this, you can listen to test execution events.





✅ Correct Answer: 4

Spring provides convenient TestContext support classes for:-





✅ Correct Answer: 4

JUnit 4 allows you to annotate your test methods with:-





✅ Correct Answer: 1

Usually, a test and its target class are located in the same package, but the source files of tests are stored in a separate directory.





✅ Correct Answer: 1

Method to perform cleanup tasks:-





✅ Correct Answer: 3

The static assert methods is declared in the:-





✅ Correct Answer: 3

Attribute which specifies the exception type:-





✅ Correct Answer: 2

Test data sets are provided by data providers, which are methods with the:-





✅ Correct Answer: 1

An object that simulates a dependent object:-





✅ Correct Answer: 1

An Object which usually knows how its methods are expected to be called:-





✅ Correct Answer: 2

Libraries that can help create mock objects:-





✅ Correct Answer: 3

Test used to test several units in combination as a whole.





✅ Correct Answer: 1

Spring supports web controller testing by providing Servlet API:-





✅ Correct Answer: 4

Base class to access the managed application context through the inherited getApplicationContext() method.





✅ Correct Answer: 1

The TestContext framework provides two test execution listeners related to context management:-





✅ Correct Answer: 3

Interface which can provide access to the managed application context through the protected field applicationContext:-





✅ Correct Answer: 1

In JUnit 4, you can simply run your test with the test runner SpringJUnit4ClassRunner.





✅ Correct Answer: 1

Method to indicate that the application context is dirty.





✅ Correct Answer: 2

In JUnit4, to explicitly specify a Spring-specific test runner for running your test.





✅ Correct Answer: 1

Annotation for SpringJUnit4ClassRunner:-





✅ Correct Answer: 2

This class implements the ApplicationContextAware interface, so you can get access to the managed application context:-





✅ Correct Answer: 3

AbstractJUnit38SpringContext class also implements the ApplicationContextAware interface.





✅ Correct Answer: 2

Spring JUnit 3 legacy support in releases prior to 2.5, your test class can extend the:-





✅ Correct Answer: 1

AbstractDependencyInjectionSpringContextTests supports dependency injection.





✅ Correct Answer: 3

Test fixtures injected from the managed application context by annotating:-





✅ Correct Answer: 3

TestContext support class AbstractJUnit4SpringContextTests, you can also have test fixtures injected from the managed application context.





✅ Correct Answer: 1

Starting from Spring 2.5, the TestContext framework provides a test execution listener related to transaction management:-





✅ Correct Answer: 1

Annotation for TransactionalTestExecutionListener:-





✅ Correct Answer: 1

DispatcherServtlet dispatches portlet requests to appropriate handlers that handle the requests.





✅ Correct Answer: 1

Maps each request to a handler through one or more handler mapping beans.





✅ Correct Answer: 2

In portlets, there are URLs:-





✅ Correct Answer: 3

When a user triggers a render URL, the portlet container will ask all the portlets in the same page to handle a render request to render its view.





✅ Correct Answer: 1

When a user triggers an action URL in a portlet, the portlet container will first ask the target portlet to handle an action request.





✅ Correct Answer: 1

After Controller has finished handling a render request, it returns:-





✅ Correct Answer: 4

DispatcherPortlet resolves a view name from one or more view resolver beans.





✅ Correct Answer: 1

portlet deployment descriptor file is:-





✅ Correct Answer: 1

Servlet Listener to load the root application context at startup.





✅ Correct Answer: 2

Unlike in a web application, you can’t control URLs directly in a portlet.





✅ Correct Answer: 1

You can chain multiple handler mapping annotations as required to portlet.





✅ Correct Answer: 1

The preceding controller handles portlet requests:-





✅ Correct Answer: 3

When handling a render request, it gets the time zone attribute from the portlet preference.





✅ Correct Answer: 1

When handling an action request, it gets the time zone parameter from the portlet request.





✅ Correct Answer: 1

The submission URL of this form should be a portlet action URL that will trigger an action request to the current portlet.





✅ Correct Answer: 1