-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test data and validation rules for the initial DSL implementation
- Loading branch information
1 parent
62557f9
commit af3a524
Showing
6 changed files
with
118 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
dsl/src/main/java/be/sddevelopment/validation/dsl/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* <p> | ||
* Contains the domain-specific language classes (DSL) for the validation framework. These classes are used to create the validation rules, based on the DSL specifications provided to it. | ||
* The most notable entries are {@link be.sddevelopment.validation.dsl.ValidatorParser}. | ||
* </p> | ||
* | ||
* @since 1.1.0-SNAPSHOT | ||
*/ | ||
package be.sddevelopment.validation.dsl; |
32 changes: 32 additions & 0 deletions
32
dsl/src/test/resources/parsing/star_wars/STARWARS_INPUT_DATA.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
NAME,HEIGHT,MASS,HAIR_COLOR,SKIN_COLOR,EYE_COLOR,BIRTH_YEAR,GENDER,HOMEWORLD,SPECIES | ||
Luke Skywalker,172,77,blond,fair,blue,19BBY,male,Tatooine,Human | ||
C-3PO,167,75,NA,gold,yellow,112BBY,NA,Tatooine,Droid | ||
R2-D2,96,32,NA,"white, blue",red,33BBY,NA,Naboo,Droid | ||
Darth Vader,202,136,none,white,yellow,41.9BBY,male,Tatooine,Human | ||
Leia Organa,150,49,brown,light,brown,19BBY,female,Alderaan,Human | ||
Owen Lars,178,120,"brown, grey",light,blue,52BBY,male,Tatooine,Human | ||
Beru Whitesun lars,165,75,brown,light,blue,47BBY,female,Tatooine,Human | ||
R5-D4,97,32,NA,"white, red",red,NA,NA,Tatooine,Droid | ||
Biggs Darklighter,183,84,black,light,brown,24BBY,male,Tatooine,Human | ||
Obi-Wan Kenobi,182,77,"auburn, white",fair,blue-gray,57BBY,male,Stewjon,Human | ||
Anakin Skywalker,188,84,blond,fair,blue,41.9BBY,male,Tatooine,Human | ||
Wilhuff Tarkin,180,NA,"auburn, grey",fair,blue,64BBY,male,Eriadu,Human | ||
Chewbacca,228,112,brown,NA,blue,200BBY,male,Kashyyyk,Wookiee | ||
Han Solo,180,80,brown,fair,brown,29BBY,male,Corellia,Human | ||
Greedo,173,74,NA,green,black,44BBY,male,Rodia,Rodian | ||
Jabba Desilijic Tiure,175,"1,358",NA,"green-tan, brown",orange,600BBY,hermaphrodite,Nal Hutta,Hutt | ||
Wedge Antilles,170,77,brown,fair,hazel,21BBY,male,Corellia,Human | ||
Jek Tono Porkins,180,110,brown,fair,blue,NA,male,Bestine IV,Human | ||
Yoda,66,17,white,green,brown,896BBY,male,NA,Yoda's species | ||
Palpatine,170,75,grey,pale,yellow,82BBY,male,Naboo,Human | ||
Boba Fett,183,78.2,black,fair,brown,31.5BBY,male,Kamino,Human | ||
IG-88,200,140,none,metal,red,15BBY,none,NA,Droid | ||
Bossk,190,113,none,green,red,53BBY,male,Trandosha,Trandoshan | ||
Lando Calrissian,177,79,black,dark,brown,31BBY,male,Socorro,Human | ||
Lobot,175,79,none,light,blue,37BBY,male,Bespin,Human | ||
Ackbar,180,83,none,brown mottle,orange,41BBY,male,Mon Cala,Mon Calamari | ||
Mon Mothma,150,NA,auburn,fair,blue,48BBY,female,Chandrila,Human | ||
Arvel Crynyd,NA,NA,brown,fair,brown,NA,male,NA,Human | ||
Wicket Systri Warrick,88,20,brown,brown,brown,8BBY,male,Endor,Ewok | ||
Nien Nunb,160,68,none,grey,black,NA,male,Sullust,Sullustan | ||
Qui-Gon Jinn,193,89,brown,fair,blue,92BBY,male,NA,Human |
28 changes: 28 additions & 0 deletions
28
dsl/src/test/resources/parsing/star_wars/STARWARS_VALIDATOR.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
ValidatorFor(".*STARWARS.*\\.csv") { | ||
Header{ | ||
Field('NAME') | ||
Field('HEIGHT') | ||
Field('MASS') | ||
Field('HAIR_COLOR') | ||
Field('SKIN_COLOR') | ||
Field('EYE_COLOR') | ||
Field('BIRTH_YEAR') | ||
Field('GENDER') | ||
Field('HOMEWORLD') | ||
Field('SPECIES') | ||
} | ||
FieldPopulated('SPECIES') | ||
RecordIdentifier('NAME') | ||
|
||
ValidationCase("GoldenBoy") { | ||
RecordExists('C-3PO') | ||
RecordHasValue('C-3PO', 'SKIN_COLOR', 'gold') | ||
RecordHasValue('C-3PO', 'SPECIES', 'Droid') | ||
} | ||
|
||
ValidationCase("The true protagonist") { | ||
RecordExists('R2-D2') | ||
RecordHasValue('R2-D2', 'SKIN_COLOR', 'white, blue') | ||
RecordHasValue('R2-D2', 'SPECIES', 'Droid') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters