Behaviour SwRS-MDOKFSTUDIO-DIAG-089
JAR failures are reported on the diagram and in the status line
When the JAR pipeline cannot draw a PlantUML diagram, the extension SHALL show on that diagram the message of the cause with the state error or unavailable, and report a warning with the code plantuml-render and the document path in addition to the message on the diagram.
Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-DIAG-007, in the state “The JAR pipeline is selected”.
Scenarios 8
The situations the tests check; open one to read it.
nominalAn existing JAR file is run
GivenjarPath naming a regular file
Whenthe preview is rendered
Thenthe JAR is run
when every diagram is rendered no PlantUML warning is reported
when every diagram is rendered no PlantUML warning is reported
refusalThe jarPath does not exist
GivenjarPath naming missing.jar and two PlantUML diagrams
Whenthe preview is rendered
Thenboth diagrams show The PlantUML JAR could not be found followed by the resolved path, with state error, and no process starts
refusalThe jarPath is a directory
GivenjarPath naming a directory
Whenthe preview is rendered
Thenevery diagram shows The PlantUML JAR path is not a file followed by the path, with state error, and no process starts
refusalRestricted Mode disables the JAR pipeline
Givenan untrusted workspace, useJar true and two PlantUML diagrams
Whenthe preview is rendered
Thenboth diagrams show PlantUML preview is disabled in an untrusted workspace. with state unavailable and no process starts
refusalThe command to run is missing
| Input | Outcome |
|---|---|
| useJar true, an empty jarPath and no plantuml command on the PATH | the diagram shows PlantUML executable "plantuml" was not found on PATH. Set markdownOkfSchemaStudio.plantuml.jarPath to a valid JAR path. with state unavailable, shows no picture and keeps its source disclosure |
| the renderer called with an absolute executable path that does not exist | the message omits on PATH |
| useJar true, jarPath set to a valid JAR and no java on the PATH | the diagram shows PlantUML executable "java" was not found on PATH. Set markdownOkfSchemaStudio.plantuml.jarPath to a valid JAR path. with state unavailable |
| java found but not executable (any spawn error other than a missing command) | the diagram shows the system error text with state error |
| the spawn call throws an error with a message | the diagram shows that message with state error and a warning |
| the spawn call throws a not-found error | the diagram shows the missing-executable message with state unavailable |
refusalThe process fails or returns no picture
| Input | Outcome |
|---|---|
| a process that exits with code 1 and error output Syntax Error | the diagram shows PlantUML exited with code 1: Syntax Error with state error |
| a process that exits with code 2 and no error output | the diagram shows PlantUML exited with code 2: PlantUML returned no diagnostic. |
| a process that ends on a signal S | the diagram shows PlantUML exited with signal S followed by a colon and the error output or PlantUML returned no diagnostic., with state error |
| a process that exits 0 and prints plain text | the diagram shows PlantUML did not return SVG output. with state error |
| output with an svg start tag and no end tag | the same message appears |
boundaryEach failure is also a status-line warning
| Input | Outcome |
|---|---|
| a missing JAR, a disabled workspace, a missing command and a failing process, one per diagram | the status line gets one warning with code plantuml-render and the document path per failing diagram |
| all diagrams rendered | no PlantUML warning is reported |
| a document without PlantUML diagrams, with any jarPath or in an untrusted workspace | nothing is reported: no message and no warning |
refusalThe host cannot run programs
Givena host without the processes capability and the JAR pipeline chosen
Whenthe preview is rendered
Thenevery diagram shows PlantUML needs a host that can run programs; the built-in engine draws diagrams without one. with state unavailable and no process starts
the session selects the built-in engine instead when the host has no processes capability
the session selects the built-in engine instead when the host has no processes capability
Implemented in 2
Tested by 5
Known limits (4)
- The visual campaign has no Restricted Mode PlantUML scenario.
- The visual scenarios call renderPlantUmlDiagrams with an unlikely executablePath and not through useJar; the absolute executable path case is reachable only that way.
- The message asks the user to set jarPath but not to also turn useJar on.
- The missing java hint tells the user to set jarPath although it is already set; nothing names Java, and a missing Graphviz is neither checked nor reported.
Replaces
SwRS-MDOKFSTUDIO-DIAG-090A jarPath that is a directory is reported superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-091Restricted Mode disables JAR rendering superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-092A missing plantuml command is reported superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-093A missing Java is reported like a missing command superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-094A failing PlantUML process shows its exit and error output superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-095Output without an SVG is reported superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-096A process that cannot be spawned is reported superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file
SwRS-MDOKFSTUDIO-DIAG-107Each JAR failure is also a status-line warning superseded superseded by SwRS-MDOKFSTUDIO-DIAG-089 Markdown file