Concordion Concordion Fixtures 1 — Questions and Answers
Question 1: What is the minimum requirement for a class to act as a Concordion fixture?
- Annotate it with @RunWith(ConcordionRunner.class) (Correct answer)
- Extend ConcordionFixture base class
- Implement the IFixture interface
- Place it in the concordion package
Correct answer: Annotate it with @RunWith(ConcordionRunner.class)
Applying @RunWith(ConcordionRunner.class) to a plain Java class is all that is needed to make it a Concordion fixture.
Question 2: What access modifier should Concordion fixture methods have?
- public (Correct answer)
- private
- protected
- package-private
Correct answer: public
Fixture methods must be public so Concordion can invoke them reflectively from the specification commands.
Question 3: Can a Concordion fixture class extend another class?
- Yes, normal Java inheritance applies (Correct answer)
- No, it must extend Object directly
- Only if the parent also has @RunWith
- Only abstract parent classes are allowed
Correct answer: Yes, normal Java inheritance applies
Concordion fixture classes are ordinary Java classes and can use inheritance freely to share setup or utility methods.
Question 4: How does a Concordion fixture method return a result to the spec?
- By returning a value from the method (Correct answer)
- By writing to a shared field
- By calling a Concordion API method
- By throwing a specific exception
Correct answer: By returning a value from the method
The fixture method simply returns a value; concordion:assertEquals and similar commands compare that return value to the spec text.
Question 5: What is the purpose of @BeforeEach or @Before annotated methods in a Concordion fixture?
- Set up shared state before each spec assertion or table row (Correct answer)
- Define the specification file path
- Register Concordion extensions
- Configure the HTML output directory
Correct answer: Set up shared state before each spec assertion or table row
Standard JUnit setup annotations work in Concordion fixtures to initialize state before each test interaction.
Question 6: Can a Concordion fixture method accept multiple parameters?
- Yes, multiple variables can be passed as arguments (Correct answer)
- No, only single-argument methods are supported
- Only if parameters are String type
- Only if parameters are annotated with @Param
Correct answer: Yes, multiple variables can be passed as arguments
Fixture methods can accept any number of parameters, each corresponding to a concordion: variable passed in the expression.
What is the minimum requirement for a class to act as a Concordion fixture?