Portlet Mvc Framework(Engineering > Computer Science And Engineering > Spring > Grails > Roo > Testing ) Questions and Answers
Question 1. In order for this custom tag to function properly in JSP, it's necessary to add it to the corresponding Tag Library Definition (TLD) grails.tld.
True
False
Error
None
Explanation:-
Answer: Option A. -> True
TLDs are located in an application's /web-app/WEB-INF/tld/ directory.
Question 2. To create a Grails application, command:-
grails create-app
grails create-app grailsappname
grails create-app default
none of the mentioned
Explanation:-
Answer: Option B. -> grails create-app grailsappname
To create a Grails application, invoke the following command wherever you wish to create an application: grails create-app grailsappname.
Question 3. Annotation for SpringJUnit4ClassRunner:-
@Run
@RunWith
All of the mentioned
None of the mentioned
Explanation:-
Answer: Option B. -> @RunWith
For this option, you have to explicitly specify a Spring-specific test runner for running your test”SpringJUnit4ClassRunner. You can specify this in the @RunWith annotation at the class level.
Question 4. The command domain class name in creation of domain classes generates a file named domain class name.groovy.
True
False
Error
None
Explanation:-
Answer: Option A. -> True
It generates a skeleton domain class file named domain class name.groovy inside the /grails-app/domain/ directory.
Question 5. There is no default configuration present in an application's resource.groovy file.
True
False
Error
None
Explanation:-
Answer: Option A. -> True
Since the explicit configuration of an application's locale takes precedence over a user's browser language preferences, there is no default configuration present in an application's resource.groovy file.
Question 6. Log4J configuration parameters are specified inside:-
Config.groovy
Conf.groovy
Log.groovy
None of the mentioned
Explanation:-
Answer: Option A. -> Config.groovy
Log4J configuration parameters are specified inside the Config.groovy file.
Question 7. Maven Directory which holds classpath resources that aren't Java class files.
src/main/java
src/main/resources
src/main/webapp
src/test/java
Explanation:-
Answer: Option B. -> src/main/resources
Note, this is for classpath resources and is not appropriate, for example, for web application resources. For that you need src/main/webapp.
Question 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
Explanation:-
Answer: Option D. -> Test execution listener
The TestContext framework provides several test execution listeners for common testing features, but you are free to create your own.
Question 9. To deploy the application to a web container:-
mvn tomcat:run
mvn jetty:run
all of the mentioned
none of the mentioned
Explanation:-
Answer: Option C. -> all of the mentioned
In the project directory, in the standard shell, run mvn tomcat:run or mvn jetty:run, and open http://localhost:8080 in your browser.
Question 10. Maps each request to a handler through one or more handler mapping beans.
DispatcherServlet
DispatcherPortlet
All of the mentioned
None of the mentioned
Explanation:-
Answer: Option B. -> DispatcherPortlet
Once it has picked an appropriate handler, it will invoke this handler to handle the request.