- Apache ANT Tutorial
- ANT - Home
- ANT - Introduction
- ANT - Environment Setup
- ANT - Build Files
- ANT - Property Task
- ANT - Property Files
- ANT - Data Types
- ANT - Building Projects
- ANT - Build Documentation
- ANT - Creating JAR files
- ANT - Create WAR Files
- ANT - Packaging Applications
- ANT - Deploying Applications
- ANT - Executing Java code
- ANT - Eclipse Integration
- ANT - JUnit Integration
- ANT - Extending Ant
- Apache ANT Useful Examples
- ANT - Using Token
- ANT - Using Command Line Arguments
- ANT - Using If Else arguments
- ANT - Custom Components
- ANT - Listeners and Loggers
- Apache ANT Resources
- ANT - Quick Guide
- ANT - Useful Resources
- ANT - Discussion
Ant Mock Test
This section presents you various set of Mock Tests related to Ant. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Ant Mock Test
Q 1 - Which of the following is correct about deploy target?
A - The deploy target copies the files from the web directory to the deploy directory.
B - It preserves the last date time stamp
C - This is useful when deploying to a server that supports hot deployment.
Answer : D
Explanation
The deploy target copies the files from the web directory to the deploy directory preserving the last modified date time stamp. This is useful when deploying to a server that supports hot deployment.
Q 2 - Which of the following is correct about clean target?
A - The clean target clears all the previously built files.
Answer : A
Explanation
The clean target clears all the previously built files.
Q 3 - Which of the following is correct about deploywar target?
A - The deploywar target builds the war file.
B - The deploywar target copies the war file to the deploy directory of the application server.
Answer : C
Explanation
The deploywar target builds the war file and then copies the war file to the deploy directory of the application server.
Q 6 - Which of the following is correct about dir property of junit task?
A - Represents location where to invoke the VM from.
Answer : C
Explanation
Dir - Where to invoke the VM from. This is ignored when fork is disabled.
Q 7 - Which of the following is correct about jvm property of junit task?
A - Represents command used to invoke the JVM.
Answer : C
Explanation
jvm - Command used to invoke the JVM. This is ignored when fork is disabled.
Q 8 - Which of the following is correct about fork property of junit task?
A - Runs the test in a separate JVM.
Answer : A
Explanation
fork - Runs the test in a separate JVM.
Q 9 - Which of the following is correct about errorproperty property of junit task?
A - The name of the property to set if there is a JUnit error.
B - The name of the property to set if there is a JUnit failure.
Answer : A
Explanation
errorproperty - The name of the property to set if there is a JUnit error.
Q 10 - Which of the following is correct about failureproperty property of junit task?
A - The name of the property to set if there is a JUnit error.
B - The name of the property to set if there is a JUnit failure.
Answer : B
Explanation
failureproperty - The name of the property to set if there is a JUnit failure.
Q 11 - Which of the following is correct about haltonerror property of junit task?
A - Stops execution when a test error occurs.
Answer : A
Explanation
haltonerror - Stops execution when a test error occurs.
Q 12 - Which of the following is correct about haltonfailure property of junit task?
A - Stops execution when a test error occurs.
Answer : B
Explanation
haltonfailure - Stops execution when a failure occurs.
Q 13 - Which of the following is correct about printsummary property of junit task?
A - Advises Ant to display simple statistics for each test.
B - Advises Ant to send the output to its logs and formatters.
Answer : A
Explanation
printsummary - Advises Ant to display simple statistics for each test.
Q 14 - Which of the following is correct about showoutput property of junit task?
A - Advises Ant to display simple statistics for each test.
B - Advises Ant to send the output to its logs and formatters.
Answer : B
Explanation
showoutput - Advises Ant to send the output to its logs and formatters.
Q 15 - Which of the following is correct about custom ant task?
A - Custom Ant Tasks should extend the org.apache.tools.ant.Task class.
Answer : C
Explanation
Custom Ant Tasks should extend the org.apache.tools.ant.Task class and should extend the execute() method.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | A |
3 | C |
4 | A |
5 | A |
6 | C |
7 | C |
8 | A |
9 | A |
10 | B |
11 | A |
12 | B |
13 | A |
14 | B |
15 | C |