Home
MCQS
Spring MCQ Quiz Hub
Spring Mcq Set 10
Choose a topic to test your knowledge and improve your Spring skills
1. The file which is the standard JPA configuration file to enable the Hibernate-based JPA implementation.
src/main/resources/META-INF/spring/database.properties
src/main/resources/META-INF/persistence.xml
src/main/resources/META-INF/pom.xml
None of the mentioned
2. Spring application context, src/main/resources/META-INF/spring/applicationContext.xml consists of:-
Data Source
JPA Transaction Manager
JPA entity manager factory
All of the mentioned
3. Command to create a Spring MVC controller that provides a UI:-
controller scaff –class ~.web.CustomerController –entity ~.domain.Customer
controller scaff –class ~.web.CustomerController –entity
none of the mentioned
All of the mentioned
4. To deploy the application to a web container:-
mvn tomcat:run
mvn jetty:run
all of the mentioned
none of the mentioned
5. Spring Roo’s root folder (or any of the source packages) is:-
src/main/java, src/main/resources
src/test/java
src/test/resources
all of the mentioned
6. This encapsulates the context of a test’s execution:-
Test context
Test context manager
Test context listener
Test execution listener
7. This manages a test context for a test and triggers test execution listeners:-
Test context
Test context manager
Test context listener
Test execution listener
8. This defines a listener interface; by implementing this, you can listen to test execution events.
Test context
Test context manager
Test context listener
Test execution listener
9. Spring provides convenient TestContext support classes for:-
JUnit3
JUnit4
TestNG5
All of the mentioned
10. JUnit 4 allows you to annotate your test methods with:-
@Test
@Autowire
@JTest
None of the mentioned
11. 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.
True
False
none
all the mentoined
12. Method to perform cleanup tasks:-
finalize
tearDown
all of the mentioned
None of the mentioned
13. The static assert methods is declared in the:-
org.junit.Assert
org.junit.*
all of the mentioned
none of the mentioned
14. Attribute which specifies the exception type:-
after
expected
before
Test execution listener
15. Test data sets are provided by data providers, which are methods with the:-
@DataProvider
@Autowire
@JTest
None of the mentioned
16. An object that simulates a dependent object:-
stub
mock
test
None of the mentioned
17. An Object which usually knows how its methods are expected to be called:-
stub
mock
test
none of the mentioned
18. Libraries that can help create mock objects:-
EasyMock
jMock
All of the mentioned
None of the mentioned
19. Test used to test several units in combination as a whole.
Integration tests
JUnit4
TestNG5
All of the mentioned
20. Spring supports web controller testing by providing Servlet API:-
MockHttpServletRequest
MockHttpServletResponse
MockHttpSession
MockHttpSession
21. Base class to access the managed application context through the inherited getApplicationContext() method.
AbstractSingleSpringContextTests
AbstractSingleSpring
Test context listener
Test execution listener
22. The TestContext framework provides two test execution listeners related to context management:-
DependencyInjectionTestExecutionListener
DirtiesContextTestExecutionListener
All of the mentioned
none of the mentioned
23. Interface which can provide access to the managed application context through the protected field applicationContext:-
ApplicationContextAware
ApplicationContext
ApplicationContextAwareContext
None of the mentioned
24. In JUnit 4, you can simply run your test with the test runner SpringJUnit4ClassRunner.
True
False
none
None of the mentioned
25. Method to indicate that the application context is dirty.
getDirty()
setDirty()
all of the mentioned
None of the mentioned
26. In JUnit4, to explicitly specify a Spring-specific test runner for running your test.
SpringJUnit4ClassRunner
SpringJUnit4Class
SpringJUnit4
none of the mentioned
27. Annotation for SpringJUnit4ClassRunner:-
@Run
@RunWith
All of the mentioned
None of the mentioned
28. This class implements the ApplicationContextAware interface, so you can get access to the managed application context:-
AbstractJUnit38SpringContext
AbstractJUnit38Spring
AbstractJUnit38SpringContextTests
none of the mentioned
29. AbstractJUnit38SpringContext class also implements the ApplicationContextAware interface.
True
False
none
all the mentoined
30. Spring JUnit 3 legacy support in releases prior to 2.5, your test class can extend the:-
AbstractDependencyInjectionSpringContextTests
AbstractSingleSpringContextTests
All of the mentioned
None of the mentioned
31. AbstractDependencyInjectionSpringContextTests supports dependency injection.
auto-wires beans by type via setter methods
auto-wires beans by name via protected fields
none of the mentioned
All of the mentioned
32. Test fixtures injected from the managed application context by annotating:-
@Autowired
@Resource
All of the mentioned
None of the mentioned
33. TestContext support class AbstractJUnit4SpringContextTests, you can also have test fixtures injected from the managed application context.
True
False
none
all the mentoined
34. Starting from Spring 2.5, the TestContext framework provides a test execution listener related to transaction management:-
TransactionalTestExecutionListener
TransactionalTestExecution
All of the mentioned
None of the mentioned
35. Annotation for TransactionalTestExecutionListener:-
@Transactional
@RunWith
@Run
None of the mentioned
36. DispatcherServtlet dispatches portlet requests to appropriate handlers that handle the requests.
True
False
none
all the mentoined
37. Maps each request to a handler through one or more handler mapping beans.
DispatcherServlet
DispatcherPortlet
All of the mentioned
None of the mentioned
38. In portlets, there are URLs:-
render
action
all of the mentioned
None of the mentioned
39. 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.
True
False
none
all the mentoined
40. When a user triggers an action URL in a portlet, the portlet container will first ask the target portlet to handle an action request.
True
False
none
all the mentoined
41. After Controller has finished handling a render request, it returns:-
model name
view name
view obect
All of the mentioned
42. DispatcherPortlet resolves a view name from one or more view resolver beans.
True
False
none
all the mentoined
43. portlet deployment descriptor file is:-
portlet.xml
portlet.config
portlet.xhtml
none of the mentioned
44. Servlet Listener to load the root application context at startup.
ContextLoader
ContextLoaderListener
All of the mentioned
None of the mentioned
45. Unlike in a web application, you can’t control URLs directly in a portlet.
True
False
none
all the mentoined
46. You can chain multiple handler mapping annotations as required to portlet.
True
False
none
all the mentoined
47. The preceding controller handles portlet requests:-
render requests
action requests
all of the mentioned
None of the mentioned
48. When handling a render request, it gets the time zone attribute from the portlet preference.
True
False
none
all the mentoined
49. When handling an action request, it gets the time zone parameter from the portlet request.
True
False
none
all the mentoined
50. The submission URL of this form should be a portlet action URL that will trigger an action request to the current portlet.
True
False
none
all the mentoined
Submit