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.

Questions and Answers

Ant Mock Test

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.

Answer : A

Explanation

The clean target clears all the previously built files.

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 4 - Can you execute java code using ant task?

A - Yes

B - No

Answer : A

Explanation

Yes.

Q 5 - Can you execute junit test cases using ant task?

A - Yes

B - No

Answer : A

Explanation

Yes.

Answer : C

Explanation

Dir - Where to invoke the VM from. This is ignored when fork is disabled.

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.

B - Runs the test in same JVM.

C - Both of the above.

D - None of the above.

Answer : A

Explanation

fork - Runs the test in a separate JVM.

Answer : A

Explanation

errorproperty - The name of the property to set if there is a JUnit error.

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.

B - Stops execution when a failure occurs.

C - Both of the above.

D - None of the above.

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.

B - Stops execution when a failure occurs.

C - Both of the above.

D - None of the above.

Answer : B

Explanation

haltonfailure - Stops execution when a failure occurs.

Answer : A

Explanation

printsummary - Advises Ant to display simple statistics for each test.

Answer : B

Explanation

showoutput - Advises Ant to send the output to its logs and formatters.

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
ant_questions_answers.htm
Advertisements