Behaviour SwRS-MDOKFSTUDIO-DIAG-024
The useJar and jarPath settings choose the PlantUML engine
When PlantUML diagrams are drawn, the extension SHALL select the built-in engine unless the setting markdownOkfSchemaStudio.plantuml.useJar is exactly true, and the JAR pipeline, which uses markdownOkfSchemaStudio.plantuml.jarPath, when it is true.
Part of StRS-MDOKFSTUDIO-DIAG-006, outside the paths drawn on its map.
Step 1 of path 1 in StRS-MDOKFSTUDIO-DIAG-007: from “PlantUML diagrams are drawn by the built-in engine” to “The JAR pipeline is selected”.
Scenarios 8
The situations the tests check; open one to read it.
nominalDefault and true
Giventhe setting markdownOkfSchemaStudio.plantuml.useJar unset, then set to true in a trusted workspace
Whena preview is rendered
Thenwhen useJar is not exactly true the extension draws PlantUML diagrams with the built-in engine, and when it is true in a trusted workspace it selects the JAR pipeline
the unset setting selects the built-in engine and true selects the JAR pipeline
the unset setting selects the built-in engine and true selects the JAR pipeline
refusalValue that is not the boolean true
| Input | Outcome |
|---|---|
| useJar holding the text true | the built-in engine is selected and no process is started |
| useJar holding the number 1 | the built-in engine is selected and no process is started |
boundaryTrust of the workspace
| Input | Outcome |
|---|---|
| useJar true in an untrusted workspace | the JAR pipeline is still selected, which refuses to start a process; no diagram is drawn by the built-in engine and the choice never falls back to the built-in engine |
| useJar false in the same untrusted workspace | the built-in engine draws the diagrams |
nominalThe built-in engine starts no process
GivenuseJar off, in a trusted workspace with a jarPath set, and in an untrusted workspace
Whena preview with PlantUML diagrams is rendered
Thenno process is spawned and no PlantUML executable or JAR is read in either trust state
in the trusted workspace the host reports no PlantUML diagram result, and in the untrusted workspace the diagrams are left to the page
in the trusted workspace the host reports no PlantUML diagram result, and in the untrusted workspace the diagrams are left to the page
nominalThe built-in engine needs nothing outside the extension
| Input | Outcome |
|---|---|
| a diagram that selects a theme of the bundled library and uses an OpenIconic icon | the picture is drawn and nothing is fetched |
| a class diagram on a machine without Graphviz | the picture is drawn with PlantUML's own Smetana layout, with no network access and no Graphviz installation |
boundaryjarPath is ignored until useJar is on
| Input | Outcome |
|---|---|
| jarPath holding a JAR path and useJar off | the built-in engine draws the diagrams and the JAR is neither checked nor started; the value is kept |
| the same jarPath after useJar is turned on and the preview is rendered again | the JAR pipeline uses that path without it being entered again |
nominalA PlantUML setting change renders the open document again
| Input | Outcome |
|---|---|
| a change of plantuml.useJar (or any other markdownOkfSchemaStudio.plantuml setting) with a preview open | the preview settings are read again for every open preview and the document is rendered with the other engine, without reopening the preview |
| a change of a setting outside the preview, plantuml and frontmatter sections | nothing is re-read and nothing is rendered again |
boundaryThe settings are contributed with an explanation
| Input | Outcome |
|---|---|
| the extension manifest, markdownOkfSchemaStudio.plantuml.useJar | a boolean with default false and order 79, with a Markdown description of the engine choice of at most 700 characters |
| the extension manifest, markdownOkfSchemaStudio.plantuml.jarPath | a string with an empty default and order 80, with a description of at most 700 characters that names useJar, the workspace folder and the PATH command (used only when useJar is on, relative to the workspace folder, empty for the plantuml command) |
| the orders of the other contributed settings | no other setting has order 79 |
| the categories of the settings registry | PlantUML is the fifth category (position 5) and holds useJar and jarPath |
| the manifest categories compared with the registry | titles and orders are equal |
Implemented in 5
Tested by 8
- test/core/configuration/plantUmlConfiguration.test.tsunit
- test/core/configuration/settingsRegistry.test.tsunit
- test/core/render/diagReq.pipeline.requirements.test.tsunit
- test/core/render/plantUmlEngine.test.tsunit
- test/security/package-contract.test.tsunit
- test/session/diagReq.settings.requirements.test.tsunit
- test/session/diagReq.webview.requirements.test.tsunit
- test/visual/scenarioDefinitions2.tsvisual
Known limits (5)
- PlantUmlController.engineFor has no host-level test.
- When the renderer is called without an engine option it defaults to the JAR pipeline; only the VS Code session passes the built-in engine.
- Smetana layouts can differ from the JAR output produced with Graphviz.
- The bundled themes and sprites are checked as imports of plantumlPreview.ts only; no test draws a diagram that uses them.
- The description of useJar still says the JAR is needed for !include files, although local includes now work in the built-in engine (the description is stale).
Replaces
SwRS-MDOKFSTUDIO-DIAG-025useJar in an untrusted workspace keeps the JAR pipeline superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-026The built-in engine starts no process superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-027jarPath is ignored until useJar is on superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-031The built-in engine needs nothing outside the extension superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-075Changing a PlantUML setting renders the open document again superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-076The useJar setting is contributed with an explanation superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-077The jarPath setting is contributed with an explanation superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file
SwRS-MDOKFSTUDIO-DIAG-078The PlantUML settings form their own category superseded superseded by SwRS-MDOKFSTUDIO-DIAG-024 Markdown file