Behaviour SwRS-MDOKFSTUDIO-DIAG-046
PlantUML includes are read through the extension and refusals reach the diagram
When a built-in diagram contains !include, !include_many, !include_once or !includesub of a local file, the page SHALL ask the extension host for the file with a previewPlantUmlInclude message, draw the diagram with the text returned, make no network request, and give the engine the reason exactly once when the host refuses, does not answer within 10 seconds or sends an answer that is not well formed.
Step 1 of path 1 in StRS-MDOKFSTUDIO-DIAG-009: from “A diagram includes a local file” to “The assembled picture is drawn”.
Scenarios 5
The situations the tests check; open one to read it.
nominalNested include and diagram file include
Givena diagram that includes a file which includes another file, and a {uml} diagram whose file includes a style file
Whenthe diagram is drawn
Thenthe host is asked for the first file with from null and for the nested file with from equal to the id of the first, and the picture shows the nested content
for the {uml} diagram the style file is asked with from equal to the id of the diagram file
no network request is made
for the {uml} diagram the style file is asked with from equal to the id of the diagram file
no network request is made
boundaryThe from field of the request
| Input | Outcome |
|---|---|
| a request with a string path and from set to a number | the host message carries from null |
| a request with from equal to an absolute path | the host message carries that path |
| a request for the diagram's own include | from is null |
refusalThe host refuses an include
| Input | Outcome |
|---|---|
| a host answer ok false with a reason | the engine receives that reason once |
| a second answer for the same request | it is ignored and the engine still received the reason once |
refusalSilence and malformed answers
| Input | Outcome |
|---|---|
| no answer from the host for 10 seconds | the engine receives The editor did not answer. Try again. |
| an ok answer without a text | the engine receives the file name followed by could not be read |
refusalMalformed include requests are ignored
| Input | Outcome |
|---|---|
| a request whose path is not a string | no host message is sent and the request is not marked accepted |
| a file request dispatched without a respond function | it is ignored |
| a file request dispatched without a request object | it is ignored |
Implemented in 4
Tested by 3
Known limits (1)
- The page without a connection to the editor answers with its own reason (see SwRS-MDOKFSTUDIO-DIAG-032).
Replaces
SwRS-MDOKFSTUDIO-DIAG-048A host refusal of an include reaches the diagram as its reason superseded superseded by SwRS-MDOKFSTUDIO-DIAG-046 Markdown file
SwRS-MDOKFSTUDIO-DIAG-049Malformed include requests are ignored superseded superseded by SwRS-MDOKFSTUDIO-DIAG-046 Markdown file
SwRS-MDOKFSTUDIO-DIAG-113Include silence and malformed answers reach the diagram as reasons superseded superseded by SwRS-MDOKFSTUDIO-DIAG-046 Markdown file
SwRS-MDOKFSTUDIO-DIAG-114A non-string from is sent as null superseded superseded by SwRS-MDOKFSTUDIO-DIAG-046 Markdown file