Add tests

This commit is contained in:
Benjamin Davies 2023-11-16 20:32:18 +13:00
parent 9ad84822fa
commit 273f8b4bf1
No known key found for this signature in database
GPG Key ID: 9FFDE0674336C460
4 changed files with 1778 additions and 0 deletions

View File

@ -0,0 +1,94 @@
package nonreg.simple;
import java.io.IOException;
import org.junit.jupiter.api.Test;
import nonreg.BasicTest;
/*
Test diagram MUST be put between triple quotes
"""
@startchen movies
entity DIRECTOR {
Number <<key>>
Name {
Fname
Lname
}
Born : DATE
Died
Age
}
entity CUSTOMER {
Number <<key>>
Bonus <<derived>>
Name <<multi>>
}
entity MOVIE {
Code
}
relationship RENTED_TO {
Date
}
RENTED_TO -1- CUSTOMER
RENTED_TO -N- MOVIE
RENTED_TO -(N,M)- DIRECTOR
entity PARENT {
}
entity MEMBER {
}
CUSTOMER ->- PARENT
MEMBER -<- CUSTOMER
entity CHILD <<weak>> {
Name <<key>>
}
relationship PARENT_OF <<identifying>> {
}
PARENT_OF -1- PARENT
PARENT_OF =N= CHILD
entity TODDLER {
FavoriteToy
}
entity PRIMARY_AGE {
FavoriteColor
}
entity TEEN {
Hobby
}
CHILD =>= d { TODDLER, PRIMARY_AGE, TEEN }
entity PERSON {
}
PERSON ->- U { CUSTOMER, DIRECTOR }
@endchen
"""
*/
public class ChenMovieExtended_Test extends BasicTest {
@Test
void testSimple() throws IOException {
checkImage("(30 entities)");
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
package nonreg.simple;
import java.io.IOException;
import org.junit.jupiter.api.Test;
import nonreg.BasicTest;
/*
Test diagram MUST be put between triple quotes
"""
@startchen movies
entity DIRECTOR {
Number <<key>>
Name {
Fname
Lname
}
Born : DATE
Died
Age
}
entity CUSTOMER {
Number <<key>>
Bonus <<derived>>
Name <<multi>>
}
entity MOVIE {
Code
}
relationship RENTED_TO {
Date
}
RENTED_TO -1- CUSTOMER
RENTED_TO -N- MOVIE
RENTED_TO -(N,M)- DIRECTOR
@endchen
"""
*/
public class ChenMovie_Test extends BasicTest {
@Test
void testSimple() throws IOException {
checkImage("(16 entities)");
}
}

View File

@ -0,0 +1,555 @@
package nonreg.simple;
public class ChenMovie_TestResult {
}
/*
"""
DPI: 96
dimension: [ 1357.2949 ; 320.0000 ]
scaleFactor: 1.0000
seed: 1893551533522493087
svgLinkTarget: _top
hoverPathColorRGB: null
preserveAspectRatio: none
RECTANGLE:
pt1: [ 411.5000 ; 281.0000 ]
pt2: [ 526.4536 ; 315.0000 ]
xCorner: 0
yCorner: 0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: DIRECTOR
position: [ 421.5000 ; 301.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 654.5000 ; 209.0000 ]
pt2: [ 773.7119 ; 237.6424 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Number
position: [ 669.6174 ; 225.8889 ]
orientation: 0
font: SansSerif.plain/14 [UNDERLINE]
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 74.0000 ; 210.5000 ]
pt2: [ 174.4750 ; 236.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Name
position: [ 90.8355 ; 227.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 138.5000 ; 107.5000 ]
pt2: [ 231.5753 ; 133.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Fname
position: [ 154.2519 ; 124.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 6.0000 ; 106.5000 ]
pt2: [ 120.0711 ; 134.1142 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Lname
position: [ 21.8671 ; 123.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 192.0000 ; 203.0000 ]
pt2: [ 371.7951 ; 243.7590 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Born : DATE
position: [ 202.3602 ; 219.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 390.0000 ; 210.5000 ]
pt2: [ 463.9416 ; 236.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Died
position: [ 402.9498 ; 227.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 482.0000 ; 210.5000 ]
pt2: [ 540.3515 ; 236.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Age
position: [ 492.6667 ; 227.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
RECTANGLE:
pt1: [ 917.0000 ; 281.0000 ]
pt2: [ 1049.4781 ; 315.0000 ]
xCorner: 0
yCorner: 0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: CUSTOMER
position: [ 927.0000 ; 301.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 1091.5000 ; 209.0000 ]
pt2: [ 1210.7119 ; 237.6424 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Number
position: [ 1106.6174 ; 225.8889 ]
orientation: 0
font: SansSerif.plain/14 [UNDERLINE]
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 791.5000 ; 209.5000 ]
pt2: [ 906.1275 ; 237.2255 ]
start: 0.0
extend: 0.0
stroke: 10.0-10.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Bonus
position: [ 807.2808 ; 226.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 973.0000 ; 210.5000 ]
pt2: [ 1073.4750 ; 236.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
ELLIPSE:
pt1: [ 976.0000 ; 213.5000 ]
pt2: [ 1070.4750 ; 233.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Name
position: [ 989.8355 ; 227.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
RECTANGLE:
pt1: [ 1274.0000 ; 281.0000 ]
pt2: [ 1352.2949 ; 315.0000 ]
xCorner: 0
yCorner: 0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: MOVIE
position: [ 1284.0000 ; 301.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 1228.5000 ; 210.5000 ]
pt2: [ 1317.6043 ; 236.2990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Code
position: [ 1243.6703 ; 227.3889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
POLYGON:
points:
- [ 852.5000 ; 120.3553 ]
- [ 943.2105 ; 75.0000 ]
- [ 1033.9210 ; 120.3553 ]
- [ 943.2105 ; 165.7105 ]
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: RENTED_TO
position: [ 877.6803 ; 124.2441 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
ELLIPSE:
pt1: [ 901.0000 ; 12.0000 ]
pt2: [ 984.5211 ; 37.7990 ]
start: 0.0
extend: 0.0
stroke: 0.0-0.0-0.5
shadow: 0
color: ff181818
backcolor: fff1f1f1
TEXT:
text: Date
position: [ 915.3527 ; 28.8889 ]
orientation: 0
font: SansSerif.plain/14 []
color: ff000000
extendedColor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 665.3328 ; 232.0606 ]
- type: SEG_CUBICTO
pt1: [ 641.4594 ; 239.5693 ]
pt2: [ 611.1286 ; 248.9786 ]
pt3: [ 584.0000 ; 257.0000 ]
- type: SEG_CUBICTO
pt1: [ 563.3889 ; 263.0943 ]
pt2: [ 540.7253 ; 269.5323 ]
pt3: [ 520.6400 ; 275.1474 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 151.7733 ; 230.5368 ]
- type: SEG_CUBICTO
pt1: [ 159.9663 ; 233.2134 ]
pt2: [ 168.7450 ; 235.8814 ]
pt3: [ 177.0000 ; 238.0000 ]
- type: SEG_CUBICTO
pt1: [ 255.1385 ; 258.0537 ]
pt2: [ 347.1264 ; 273.7179 ]
pt3: [ 405.2514 ; 282.6619 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 171.5202 ; 127.8846 ]
- type: SEG_CUBICTO
pt1: [ 159.7490 ; 147.3746 ]
pt2: [ 137.0409 ; 184.9732 ]
pt3: [ 125.3504 ; 204.3296 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 64.9747 ; 128.7040 ]
- type: SEG_CUBICTO
pt1: [ 76.8591 ; 148.3814 ]
pt2: [ 99.0526 ; 185.1281 ]
pt3: [ 110.5964 ; 204.2416 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 326.6049 ; 238.1195 ]
- type: SEG_CUBICTO
pt1: [ 356.3505 ; 249.6519 ]
pt2: [ 393.4909 ; 264.0513 ]
pt3: [ 421.5014 ; 274.9110 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 428.1247 ; 230.7986 ]
- type: SEG_CUBICTO
pt1: [ 435.1459 ; 242.9185 ]
pt2: [ 445.9126 ; 261.5039 ]
pt3: [ 453.6250 ; 274.8170 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 497.8753 ; 230.7986 ]
- type: SEG_CUBICTO
pt1: [ 490.8541 ; 242.9185 ]
pt2: [ 480.0874 ; 261.5039 ]
pt3: [ 472.3750 ; 274.8170 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 1113.4005 ; 232.1367 ]
- type: SEG_CUBICTO
pt1: [ 1085.2657 ; 244.2782 ]
pt2: [ 1044.0729 ; 262.0549 ]
pt3: [ 1014.3238 ; 274.8930 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 867.2664 ; 231.6292 ]
- type: SEG_CUBICTO
pt1: [ 889.7416 ; 243.7893 ]
pt2: [ 923.2277 ; 261.9068 ]
pt3: [ 947.2935 ; 274.9275 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 1010.2145 ; 230.7986 ]
- type: SEG_CUBICTO
pt1: [ 1003.5277 ; 242.9185 ]
pt2: [ 993.2737 ; 261.5039 ]
pt3: [ 985.9285 ; 274.8170 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 1273.7855 ; 230.7986 ]
- type: SEG_CUBICTO
pt1: [ 1280.4723 ; 242.9185 ]
pt2: [ 1290.7263 ; 261.5039 ]
pt3: [ 1298.0715 ; 274.8170 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 937.0000 ; 32.2235 ]
- type: SEG_CUBICTO
pt1: [ 937.0000 ; 41.6286 ]
pt2: [ 937.0000 ; 55.2460 ]
pt3: [ 937.0000 ; 68.6542 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 935.4608 ; 160.0549 ]
- type: SEG_CUBICTO
pt1: [ 935.8346 ; 183.6946 ]
pt2: [ 938.2163 ; 212.9522 ]
pt3: [ 946.0000 ; 238.0000 ]
- type: SEG_CUBICTO
pt1: [ 950.1123 ; 251.2335 ]
pt2: [ 958.0422 ; 264.6940 ]
pt3: [ 964.8519 ; 274.7384 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
EMPTY:
pt1: [ 952.0000 ; 217.0000 ]
pt2: [ 964.3969 ; 230.0000 ]
TEXT:
text: 1
position: [ 953.0000 ; 226.5556 ]
orientation: 0
font: SansSerif.plain/11 []
color: ff000000
extendedColor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 1027.7972 ; 121.8769 ]
- type: SEG_CUBICTO
pt1: [ 1129.4735 ; 131.1293 ]
pt2: [ 1284.8054 ; 152.3173 ]
pt3: [ 1321.0000 ; 197.0000 ]
- type: SEG_CUBICTO
pt1: [ 1338.9667 ; 219.1802 ]
pt2: [ 1326.2568 ; 254.3104 ]
pt3: [ 1316.1265 ; 274.7586 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
EMPTY:
pt1: [ 1336.0000 ; 217.0000 ]
pt2: [ 1348.5088 ; 230.0000 ]
TEXT:
text: N
position: [ 1337.0000 ; 226.5556 ]
orientation: 0
font: SansSerif.plain/11 []
color: ff000000
extendedColor: NULL_COLOR
PATH:
- type: SEG_MOVETO
pt1: [ 846.3294 ; 120.6490 ]
- type: SEG_CUBICTO
pt1: [ 770.3065 ; 128.4455 ]
pt2: [ 661.2914 ; 148.0025 ]
pt3: [ 579.0000 ; 197.0000 ]
- type: SEG_CUBICTO
pt1: [ 558.1640 ; 209.4060 ]
pt2: [ 561.2682 ; 222.0525 ]
pt3: [ 543.0000 ; 238.0000 ]
- type: SEG_CUBICTO
pt1: [ 527.0605 ; 251.9147 ]
pt2: [ 507.2472 ; 265.0672 ]
pt3: [ 491.3266 ; 274.7892 ]
stroke: 0.0-0.0-1.0
shadow: 0
color: ff181818
backcolor: NULL_COLOR
EMPTY:
pt1: [ 585.0000 ; 217.0000 ]
pt2: [ 645.5178 ; 230.0000 ]
TEXT:
text: (N,M)
position: [ 586.0000 ; 226.5556 ]
orientation: 0
font: SansSerif.plain/11 []
color: ff000000
extendedColor: NULL_COLOR
"""
*/