250+ TOP MCQs on SpringSource Tool Suite and Answers

Java Spring Multiple Choice Questions & Answers (MCQs) on “SpringSource Tool Suite”.

1. The plugin, which provides Maven support to Eclipse
a) m2eclipse
b) m2plugin
c) plugin
d) none of the mentioned
Answer: a
Clarification: The m2eclipse plugin, which provides Maven support to Eclipse (and thus to SpringSource Tool Suite), can do all the heavy lifting of importing your project since it is just a stock-standard Maven project.

2. Spring Roo provides very powerful support to bootstrap most solutions.
a) True
b) False
Answer: a
Clarification: It’s entirely possible there’s a plugin that will do the job for you.

3. A database and some sort of persistence mechanism using command:-
a) persistence setup –database HYPERSONIC_IN_MEMORY –provider HIBERNATE
b) persistence setup –database HYPERSONIC_IN_MEMORY –provider
c) persistence setup –database HYPERSONIC_IN_MEMORY
d) persistence –database HYPERSONIC_IN_MEMORY –provider HIBERNATE
Answer: a
Clarification: Enter persistence setup as it suggests. On my console, I ended up entering the following command:
roo> persistence setup –database HYPERSONIC_IN_MEMORY –provider HIBERNATE

4. persistence setup –database HYPERSONIC_IN_MEMORY –provider HIBERNATE command creates files:-
a) src/main/resources/META-INF/persistence.xml
b) src/main/resources/META-INF/spring/database.properties
c) all of the mentioned
d) none of the mentioned
Answer: c
Clarification: In my project, the command created two new files (src/main/resources/META-INF/persistence.xml and src/main/resources/META-INF/spring/database.properties), and it updated two files (src/main/resources/META-INF/spring/applicationContext.xml and pom.xml).

5. The file which contains useful configuration for Hypersonic in-memory database.
a) src/main/resources/META-INF/spring/database.properties
b) src/main/resources/META-INF/persistence.xml
c) src/main/resources/META-INF/pom.xml
d) none of the mentioned
Answer: a
Clarification: The file src/main/resources/META-INF/spring/database.properties contains useful configuration to facilitate connection to the Hypersonic in-memory database.

6. The file which is the standard JPA configuration file to enable the Hibernate-based JPA implementation.
a) src/main/resources/META-INF/spring/database.properties
b) src/main/resources/META-INF/persistence.xml
c) src/main/resources/META-INF/pom.xml
d) none of the mentioned
Answer: b
Clarification: The file src/main/resources/META-INF/persistence.xml is the standard JPA configuration file to enable the Hibernate-based JPA implementation to do its work.

7. Spring application context, src/main/resources/META-INF/spring/applicationContext.xml consists of:-
a) Data Source
b) JPA Transaction Manager
c) JPA entity manager factory
d) All of the mentioned
Answer: d
Clarification: Finally, the Spring application context, src/main/resources/META-INF/spring/applicationContext.xml, has been updated to have a data source, a JPA transaction manager, and a JPA entity manager factory.

8. Command to create a Spring MVC controller that provides a UI:-
a) controller scaff –class ~.web.CustomerController –entity ~.domain.Customer
b) controller scaff –class ~.web.CustomerController –entity
c) none of the mentioned
d) all of the mentioned
Answer: a
Clarification: Type the following command to create a Spring MVC controller that provides a UI to manipulate Customer entities (and stand back!):
controller scaff –class ~.web.CustomerController –entity ~.domain.Customer

9. To deploy the application to a web container:-
a) mvn tomcat:run
b) mvn jetty:run
c) all of the mentioned
d) none of the mentioned
Answer: c
Clarification: In the project directory, in the standard shell, run mvn tomcat:run or mvn jetty:run, and open http://localhost:8080 in your browser.

10. Spring Roo’s root folder (or any of the source packages) is:-
a) src/main/java, src/main/resources
b) src/test/java
c) src/test/resources
d) all of the mentioned
Answer: d
Clarification: The root folder (or any of the source packages, e.g., src/main/java, src/main/resources, src/test/java, or src/test/resources).

Leave a Reply

Your email address will not be published. Required fields are marked *