Skip to content

Commit

Permalink
fix: bump lsd-core and lsd-distributed-generator to the latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmcdowall committed Jul 4, 2022
1 parent 2427bf6 commit 4bbbeed
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 17 deletions.
4 changes: 2 additions & 2 deletions service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ dependencies {
}

// LSD
implementation("io.github.lsd-consulting:lsd-core:1.0.4")
implementation("io.github.lsd-consulting:lsd-distributed-generator:1.1.0")
implementation("io.github.lsd-consulting:lsd-core:1.2.6")
implementation("io.github.lsd-consulting:lsd-distributed-generator:1.1.2")

//////////////////////////////////
// Unit test dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h3>Key Facts</h3>
<h3 class="">Sequence Diagram</h3>
<pre><?xml version="1.0" encoding="UTF-8"?>

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="244px" preserveAspectRatio="none" style="width:279px;height:244px;background:#00000000;" version="1.1" viewBox="0 0 279 244" width="279px" zoomAndPan="magnify">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="244px" preserveAspectRatio="none" style="width:279px;height:244px;background:#00000000;" version="1.1" viewBox="0 0 279 244" width="279px" zoomAndPan="magnify">
<defs/>
<g>
<line style="stroke:#000000;stroke-width:1.0;stroke-dasharray:5.0,5.0;" x1="37" x2="37" y1="83.0146" y2="162.6133"/>
Expand All @@ -38,17 +38,17 @@ <h3 class="">Sequence Diagram</h3>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="48" x="10" y="175.6885">Source</text>
<ellipse cx="37" cy="187.6279" fill="#FFFFFF" rx="8" ry="8" style="stroke:#000000;stroke-width:1.0;"/>
<path d="M37,195.6279 L37,222.6279 M24,203.6279 L50,203.6279 M37,222.6279 L24,237.6279 M37,222.6279 L50,237.6279 " fill="none" style="stroke:#000000;stroke-width:1.0;"/>
<rect fill="#FFFFFF" height="31.0146" style="stroke:#000000;stroke-width:1.0;" width="60" x="213" y="51"/>
<rect fill="#FFFFFF" height="31.0146" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:1.0;" width="60" x="213" y="51"/>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="46" x="220" y="72.0752">Target</text>
<rect fill="#FFFFFF" height="31.0146" style="stroke:#000000;stroke-width:1.0;" width="60" x="213" y="161.6133"/>
<rect fill="#FFFFFF" height="31.0146" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:1.0;" width="60" x="213" y="161.6133"/>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="46" x="220" y="182.6885">Target</text>
<polygon fill="#000000" points="231,110.814,241,114.814,231,118.814,235,114.814" style="stroke:#000000;stroke-width:1.0;"/>
<line style="stroke:#000000;stroke-width:1.0;" x1="37" x2="237" y1="114.814" y2="114.814"/>
<a href="#1" target="_top" title="GET /path" xlink:actuate="onRequest" xlink:href="#1" xlink:show="new" xlink:title="GET /path" xlink:type="simple">
<text fill="" font-family="Verdana" font-size="13" lengthAdjust="spacing" text-decoration="underline" textLength="66" x="44" y="110.0845">GET /path</text>
</a>
<line style="stroke:#000000;stroke-width:1.0;" x1="37" x2="47" y1="144.6133" y2="140.6133"/>
<line style="stroke:#000000;stroke-width:1.0;" x1="37" x2="47" y1="144.6133" y2="148.6133"/>
<line style="stroke:#000000;stroke-width:1.0;" x1="38" x2="48" y1="144.6133" y2="140.6133"/>
<line style="stroke:#000000;stroke-width:1.0;" x1="38" x2="48" y1="144.6133" y2="148.6133"/>
<line style="stroke:#000000;stroke-width:1.0;stroke-dasharray:2.0,2.0;" x1="37" x2="242" y1="144.6133" y2="144.6133"/>
<a href="#2" target="_top" title="sync 200 response (25 ms)" xlink:actuate="onRequest" xlink:href="#2" xlink:show="new" xlink:title="sync 200 response (25 ms)" xlink:type="simple">
<text fill="" font-family="Verdana" font-size="13" lengthAdjust="spacing" text-decoration="underline" textLength="182" x="54" y="139.8838">sync 200 response (25 ms)</text>
Expand All @@ -65,17 +65,25 @@ <h2>PlantUml markup</h2>
<pre><code id="sequence_uml_code4">@startuml

!theme plain

skinparam backgroundColor transparent

hide unlinked




actor Source

participant Target



Source -&gt; Target: &lt;text fill=&quot;&quot;&gt;[[#1 {GET /path} GET /path]]&lt;/text&gt;

Target --&gt;&gt; Source: &lt;text fill=&quot;&quot;&gt;[[#2 {sync 200 response (25 ms)} sync 200 response (25 ms)]]&lt;/text&gt;


@enduml</code></pre>
</div>
</div>
Expand All @@ -91,17 +99,21 @@ <h2>Component Diagram</h2>
<div class="content">
<pre><?xml version="1.0" encoding="UTF-8"?>

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="176px" preserveAspectRatio="none" style="width:104px;height:176px;background:#00000000;" version="1.1" viewBox="0 0 104 176" width="104px" zoomAndPan="magnify">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="176px" preserveAspectRatio="none" style="width:104px;height:176px;background:#00000000;" version="1.1" viewBox="0 0 104 176" width="104px" zoomAndPan="magnify">
<defs/>
<g>
<ellipse cx="55" cy="18.5752" fill="#FFFFFF" rx="8" ry="8" style="stroke:#000000;stroke-width:1.0;"/>
<path d="M55,26.5752 L55,53.5752 M42,34.5752 L68,34.5752 M55,53.5752 L42,68.5752 M55,53.5752 L68,68.5752 " fill="none" style="stroke:#000000;stroke-width:1.0;"/>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="48" x="31" y="84.6504">Source</text>
<rect fill="#FFFFFF" height="47.0146" style="stroke:#000000;stroke-width:1.0;" width="86" x="12" y="123.5752"/>
<rect fill="#FFFFFF" height="10" style="stroke:#000000;stroke-width:1.0;" width="15" x="78" y="128.5752"/>
<rect fill="#FFFFFF" height="2" style="stroke:#000000;stroke-width:1.0;" width="4" x="76" y="130.5752"/>
<rect fill="#FFFFFF" height="2" style="stroke:#000000;stroke-width:1.0;" width="4" x="76" y="134.5752"/>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="46" x="27" y="157.6504">Target</text>
<g id="elem_Source">
<ellipse cx="55" cy="18.5752" fill="#FFFFFF" rx="8" ry="8" style="stroke:#000000;stroke-width:1.0;"/>
<path d="M55,26.5752 L55,53.5752 M42,34.5752 L68,34.5752 M55,53.5752 L42,68.5752 M55,53.5752 L68,68.5752 " fill="none" style="stroke:#000000;stroke-width:1.0;"/>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="48" x="31" y="84.6504">Source</text>
</g>
<g id="elem_Target">
<rect fill="#FFFFFF" height="47.0146" rx="2.5" ry="2.5" style="stroke:#000000;stroke-width:1.0;" width="86" x="12" y="123.5752"/>
<rect fill="#FFFFFF" height="10" style="stroke:#000000;stroke-width:1.0;" width="15" x="78" y="128.5752"/>
<rect fill="#FFFFFF" height="2" style="stroke:#000000;stroke-width:1.0;" width="4" x="76" y="130.5752"/>
<rect fill="#FFFFFF" height="2" style="stroke:#000000;stroke-width:1.0;" width="4" x="76" y="134.5752"/>
<text fill="#000000" font-family="Verdana" font-size="14" lengthAdjust="spacing" textLength="46" x="27" y="157.6504">Target</text>
</g>
<path d="M55,87.7146 C55,99.8315 55,112.8392 55,123.4921 " fill="none" style="stroke:#000000;stroke-width:1.0;"/>
<polygon fill="#000000" points="55,123.4921,59,114.4921,55,118.4921,51,114.4921,55,123.4921" style="stroke:#000000;stroke-width:1.0;"/>
</g>
Expand All @@ -126,8 +138,10 @@ <h2>PlantUml markup</h2>
actor Source
component Target


[Source] --&gt; Target


remove @unlinked
@enduml</code></pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.lsdconsulting.generatorui.service

import com.lsd.report.model.Scenario
import com.lsd.report.pebble.LsdPebbleExtension
import com.mitchellbosecke.pebble.PebbleEngine
import com.mitchellbosecke.pebble.error.PebbleException
import com.mitchellbosecke.pebble.extension.AbstractExtension
import com.mitchellbosecke.pebble.extension.Filter
import com.mitchellbosecke.pebble.template.EvaluationContext
import com.mitchellbosecke.pebble.template.PebbleTemplate
import org.springframework.stereotype.Component
import java.io.StringWriter
Expand All @@ -21,4 +24,33 @@ class HtmlReportRenderer {
compiledTemplate.evaluate(writer, mapOf("scenario" to scenario, "startTime" to startTime, "finishTime" to finishTime))
return writer.toString()
}

}
class LsdPebbleExtension : AbstractExtension() {
override fun getFilters(): Map<String, Filter> {
return mapOf(
"sanitise" to SanitiserFilter()
)
}
}

class SanitiserFilter : Filter {
@Throws(PebbleException::class)
override fun apply(
input: Any,
args: Map<String, Any>,
self: PebbleTemplate,
context: EvaluationContext,
lineNumber: Int
): Any {
return if (input is String)
sanitise(input) else input
}

override fun getArgumentNames(): List<String>? = null

private fun sanitise(input: String?): String =
input?.strip()
?.replace("<\\$.*?>".toRegex(), "")
?: ""
}

0 comments on commit 4bbbeed

Please sign in to comment.