Order of execution on tables

12 views
Skip to first unread message

Tony Peguero

unread,
Nov 12, 2020, 6:58:02 PM11/12/20
to concordion
Hello. I have a question about the special handling of the execute command on tables. The examples in the documentation show header cells containing a combination of set and assert commands. The examples only make any sense if it assumed that all the set commands are executed before the execute command, and all the asserts are evaluated after the execute command. But there does not appear to be any mechanism for specifying where the execute command gets inserted into the list. What is the internal logic for guaranteeing a sensible order of execution?

Nigel Charman

unread,
Nov 15, 2020, 4:10:57 AM11/15/20
to conco...@googlegroups.com
Hi Tony

For each row of the table, the commands from the table headers are run, with any set commands being run before the execute command, followed by the assert commands (see https://concordion.org/instrumenting/java/markdown/#execute-table).

This is a special case of the logic specified in Handling unusual sentence structures - "the execute command is designed to process commands on its child elements in a special order. First of all it processes any child set commands then it runs its own command, then any child execute commands and finally any child assert-equals commands."

Does that answer your question?

cheers,
Nigel

On 13/11/20 12:51 pm, Tony Peguero wrote:
Hello. I have a question about the special handling of the execute command on tables. The examples in the documentation show header cells containing a combination of set and assert commands. The examples only make any sense if it assumed that all the set commands are executed before the execute command, and all the asserts are evaluated after the execute command. But there does not appear to be any mechanism for specifying where the execute command gets inserted into the list. What is the internal logic for guaranteeing a sensible order of execution? --
You received this message because you are subscribed to the Google Groups "concordion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to concordion+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/concordion/1c7bf6aa-41a0-42af-97d9-d40e2c0c77afn%40googlegroups.com.

Tony Peguero

unread,
Nov 16, 2020, 12:54:38 AM11/16/20
to concordion
Hi Nigel. That does explain how the standard commands are treated, but how do extension commands fit in?. Are they equivalent to execute? Does an extension author have control over this?

Nigel Charman

unread,
Nov 16, 2020, 1:36:15 AM11/16/20
to conco...@googlegroups.com
Hi Tony, thanks for the clarification. Each Command has a setUp(), execute() and verify() method - depending which of these you implement in your extension command will affect when they are executed when they are children of an ExecuteCommand:
  • setUp() method - behave like the set command (called first)
  • verify() method - behave like an assert command (called last)
  • execute() method - used for other commands that don't behave like set or assert (eg. run command, execute command etc) (called in between commands implementing the setUp() method and commands implementing the verify() method)
Nigel
Reply all
Reply to author
Forward
0 new messages