Spring Questions and Answers – Spring Roo

This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Spring Roo”.

1. The main mission of Spring Roo is fundamentally and sustainably improve Java developer productivity without compromising engineering integrity or flexibility.
a) True
b) False
View Answer

Answer: a
Explanation: This has a lot of implications. Applications built in Roo are Java applications that benefit from the mature Java language and platform.

2. Library which helps Spring Roo in using of the command line shell.
a) JTag
b) JLine
c) JHib
d) None of the mentioned
View Answer

Answer: b
Explanation: The shell is quite smart, featuring tab completion, line history, and much more. These features are surfaced pretty consistently on all platforms, thanks to the excellent JLine library (http://jline.sourceforge.net). JLine handles some features inconsistently, however, on Windows—nothing fundamentally irresolvable, mind you, just nuisances like shell color differences and line history glitches. Proceed full speed ahead, but if you’re not using a Unix-like operating system, be aware of the (ever diminishing) possibility of issues.

3. To check version of Maven.
a) mvn –v
b) mvn -v
c) mvn –version
d) all of the mentioned
View Answer

Answer: c
Explanation: Start a new shell session and confirm that you can issue the following command without error, in any directory on your system: mvn –version.
advertisement
advertisement

4. To confirm Roo version.
a) roo.sh
b) roo
c) roo quit
d) roo.sh quit
View Answer

Answer: d
Explanation: Confirm that you saw output. On my system, the output looked like this:
$ roo.sh quit
____ ____ ____
/ __ \/ __ \/ __ \
/ /_/ / / / / / / /
/ _, _/ /_/ / /_/ /
/_/ |_|\____/\____/
1.0.2.RELEASE [rev 638] Welcome to Spring Roo. For assistance press TAB or type “hint” then hit ENTER.

5. The Spring Roo shell is a blank slate. It represents the ultimate user interface for Spring Roo to facilitate development.
a) True
b) False
View Answer

Answer: a
Explanation: A custom command line shell to facilitate the developer. This shell can be intimidating to the uninitiated.

6. Spring Roo supports tab completion.
a) True
b) False
View Answer

Answer: a
Explanation: It supports tab completion, which will enable you to tab your way to a completely specified command.

7. You can ask Roo questions using:-
a) tab
b) hint
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: b
Explanation: You can ask it questions using the hint command, and it does its best to direct you in response.
advertisement

8. Spring Roo file extension is:-
a) .xml
b) .xhtml
c) .roo
d) .groovy
View Answer

Answer: c
Explanation: The Spring Roo shell is pretty darned handy, and even fun, but on the surface, it would appear to lack the reusability we developers have come to expect from our tools.

9. To run the script:-
a) roo.sh script –file ~/Desktop/myapp.roo
b) roo.sh –file ~/Desktop/myapp.roo
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: a
Explanation: To run the script, simply invoke the Roo shell as follows (changing the path of the file as appropriate):
roo.sh script –file ~/Desktop/myapp.roo.
advertisement

10. Maven Directory to hold the non–unit-test Java files for your application.
a) src/main/java
b) src/main/resources
c) src/main/webapp
d) src/test/java
View Answer

Answer: a
Explanation: A directory to hold the non–unit-test Java files for your application.

11. Maven Directory which holds classpath resources that aren’t Java class files.
a) src/main/java
b) src/main/resources
c) src/main/webapp
d) src/test/java
View Answer

Answer: b
Explanation: Note, this is for classpath resources and is not appropriate, for example, for web application resources. For that you need src/main/webapp.

12. Maven Directory which is used to hold the rest of a web application’s structure.
a) src/main/java
b) src/main/resources
c) src/main/webapp
d) src/test/java
View Answer

Answer: c
Explanation: If you were going to develop a web application, put everything except what you would put in WEB-INF/classes in this folder.

13. This directory holds artifacts intended to test the Java classes under the src/main/java folder.
a) src/test/java
b) src/main/resources
c) src/main/webapp
d) src/test/java
View Answer

Answer: a
Explanation: Typically, the package structures mirrors the package structure in src/main/java, allowing your tests to have package-friendly visibility to the classes under test.

14. This directory holds resources needed by your test classes at test time.
a) src/test/java
b) src/test/resources
c) src/main/webapp
d) src/test/java
View Answer

Answer: b
Explanation: This directory holds resources needed by your test classes at test time, in the same way that src/main/resources works.

15. To package the project using the Roo shell.
a) perform package
b) roo.sh
c) all of the mentioned
d) none of the mentioned
View Answer

Answer: c
Explanation: spring Roo also lets you perform certain operations using Maven from within the Roo shell. To package the project using the Roo shell, launch it again (using roo.sh), and invoke the following command:
$ roo perform package

Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.