Java Test Automation / Quiz

TestNG @Test: The Annotation Arsenal

priority, timeOut, enabled, invocationCount, the @Test attributes that quietly control what runs, in what order, and for how long.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
8 min

// MISSION BRIEF

Your Mission

In TestNG, one annotation does a lot of driving. @Test decides what is a test, when it runs relative to its neighbors, how long it may take, and how many times it fires.

This quiz drills the attributes you will read in every Java framework code review: priority, enabled, timeOut, invocationCount, and expectedExceptions. Get the defaults right, they are where the surprises live.

// FIRST CONTACT

Battle teaser

What makes a method a TestNG test?

  1. AThe @Test annotation from org.testng.annotations on the method (or a class-level @Test covering its public methods)
  2. BBeing public, void, and parameterless
  3. CBeing listed in pom.xml under surefire
  4. DA name starting with the word test
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

javatestngannotations