Skip to content

Commit

Permalink
Merge pull request #1772 from travkin79/patch/tests
Browse files Browse the repository at this point in the history
Add some non-regression tests for certain issues
  • Loading branch information
arnaudroques committed May 8, 2024
2 parents 20b32a3 + 27a057b commit ec686a2
Show file tree
Hide file tree
Showing 13 changed files with 2,702 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/nonreg/BasicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@

/*
* All non-regression tests must extends BasicTest class.
*
*
* The tests must have a single test method that call the 'checkImage()' method.
* Diagram to be tested must be stored in the test itself, separated by triple-quoted strings
* The expected result (build using UGraphicDebug) is stored in a class xxxxResult.java, also separated by triple-quoted strings.
*
* The expected result (build using UGraphicDebug, e.g. <code>String actualResult = runPlantUML("(9 entities)");</code>)
* is stored in a class xxxxResult.java, also separated by triple-quoted strings.
*
*/
public class BasicTest {

Expand Down
29 changes: 29 additions & 0 deletions test/nonreg/simple/HideShow001_Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package nonreg.simple;

import nonreg.BasicTest;

import org.junit.jupiter.api.Test;

import java.io.IOException;

/*
Diagram under test (has to be in tripple quotes """):
"""
@startuml
hide <<focus>> stereotype
class Access <<Entity>> <<focus>>
@enduml
"""
*/

public class HideShow001_Test extends BasicTest {

@Test
void testIssue1580() throws IOException {
checkImage("(1 entities)");
}

}
93 changes: 93 additions & 0 deletions test/nonreg/simple/HideShow001_TestResult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package nonreg.simple;

/*
"""
DPI: 96
dimension: [ 148.2616 ; 70.0000 ]
scaleFactor: 1.0000
seed: -6671548050035206981
svgLinkTarget: _top
hoverPathColorRGB: null
preserveAspectRatio: none
COMMENT: class Access
RECTANGLE:
pt1: [ 6.0000 ; 12.0000 ]
pt2: [ 142.2616 ; 64.0000 ]
xCorner: 5
yCorner: 5
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
EMPTY:
pt1: [ 6.0000 ; 14.0000 ]
pt2: [ 32.0000 ; 46.0000 ]
ELLIPSE:
pt1: [ 10.0000 ; 19.0000 ]
pt2: [ 32.0000 ; 41.0000 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: ffadd1b2
CENTERED_CHAR:
char: C
position: [ 21.0000 ; 30.0000 ]
font: Monospaced.bold/17
color: ff000000
EMPTY:
pt1: [ 33.9471 ; 17.0000 ]
pt2: [ 140.3145 ; 29.0000 ]
TEXT:
text: «Entity»
position: [ 34.9471 ; 26.3333 ]
orientation: 0
font: SansSerif.italic/12 [ITALIC]
color: ff000000
extendedColor: NULL_COLOR
EMPTY:
pt1: [ 32.0000 ; 29.0000 ]
pt2: [ 142.2616 ; 43.0000 ]
TEXT:
text: Access
position: [ 35.0000 ; 39.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
LINE:
pt1: [ 7.0000 ; 48.0000 ]
pt2: [ 141.2616 ; 48.0000 ]
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
EMPTY:
pt1: [ 6.0000 ; 48.0000 ]
pt2: [ 18.0000 ; 56.0000 ]
LINE:
pt1: [ 7.0000 ; 56.0000 ]
pt2: [ 141.2616 ; 56.0000 ]
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
EMPTY:
pt1: [ 6.0000 ; 56.0000 ]
pt2: [ 18.0000 ; 64.0000 ]
"""
*/
public class HideShow001_TestResult {
}
48 changes: 48 additions & 0 deletions test/nonreg/simple/HideShow002_Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package nonreg.simple;

import nonreg.BasicTest;

import org.junit.jupiter.api.Test;

import java.io.IOException;

/*
Diagram under test (has to be in tripple quotes """):
"""
@startuml
<style>
root {
.highlight {
BackGroundColor LightGray
}
}
</style>
hide <<highlight>> stereotype
rectangle "System in focus" <<Module>> <<highlight>> {
class Class
class ImportantClass <<highlight>>
class ClassThreadSafe <<thread-safe>> <<Singleton>>
class ImportantClassThreadSafe <<thread-safe>> <<highlight>>
}
package other <<Stereotype A>> <<Stereotype B>> {
class ExternalClassThreadSafe <<thread-safe>> <<external>>
class ExternalImportantClass <<external>> <<highlight>>
}
@enduml
"""
*/

public class HideShow002_Test extends BasicTest {

@Test
void testIssue1735() throws IOException {
checkImage("(6 entities)");
}

}

0 comments on commit ec686a2

Please sign in to comment.