diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index d134323f..6c4e0db6 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -46,6 +46,7 @@ jobs: - gradle-oauth-angular - mvn-ms-consul-jwt - gradle-ms-eureka-oauth + - jdl-default-app include: - app-type: gradle-jwt-react - app-type: mvn-jwt-angular @@ -55,6 +56,7 @@ jobs: - app-type: gradle-oauth-angular - app-type: mvn-ms-consul-jwt - app-type: gradle-ms-eureka-oauth + - app-type: jdl-default-app steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 diff --git a/test-integration/samples/jdl-default-app.jdl b/test-integration/samples/jdl-default-app.jdl new file mode 100644 index 00000000..a30c4a4e --- /dev/null +++ b/test-integration/samples/jdl-default-app.jdl @@ -0,0 +1,189 @@ +// Inspired by: https://github.com/jhipster/generator-jhipster/blob/main/test-integration/samples/jdl-default/app.jdl + +application { + config { + applicationType monolith + baseName jhipsterSampleApplication + blueprints [generator-jhipster-micronaut] + packageName tech.jhipster.sample + authenticationType jwt + prodDatabaseType postgresql + buildTool maven + searchEngine false + testFrameworks [] + clientFramework angularX + enableTranslation true + nativeLanguage en + languages [ en, fr ] + } + entities * +} + +entity Bank { + bankNumber Integer +} +entity BankAccount { + name String required + bankNumber Integer + agencyNumber Long + lastOperationDuration Float + meanOperationDuration Double + balance BigDecimal required + openingDay LocalDate + lastOperationDate Instant + active Boolean + accountType BankAccountType + attachment AnyBlob + description TextBlob +} +entity TheLabel { + labelName String required minlength(3) +} +entity Operation { + date Instant required + description String + amount BigDecimal required +} + +enum BankAccountType { + CHECKING (checking_account), + SAVINGS (savings_account), + LOAN (loan_account) +} + +entity Department { + name String required, + description TextBlob, + advertisement Blob, + logo ImageBlob +} + +/** + * JobHistory comment. + */ +entity JobHistory { + startDate ZonedDateTime, + endDate ZonedDateTime, + language Language +} + +enum Language { + FRENCH, ENGLISH, SPANISH +} + +enum JobType { + BOSS, SLAVE +} + +entity Job { + title String minlength(5) maxlength(25), + type JobType, + minSalary Long, + maxSalary Long +} + +/** + * The Employee entity. + * Second line in javadoc. + */ +entity Employee { + /** + * The firstname attribute. + */ + firstName String, + lastName String, + email String, + phoneNumber String, + hireDate ZonedDateTime, + salary Long, + commissionPct Long +} + +entity Location { + streetAddress String, + postalCode String, + city String, + stateProvince String +} + +entity Task { + title String, + description String +} + +entity GoldenBadge { + name String +} + +entity SilverBadge { + name String +} + +entity Identifier { + name String required unique +} + +entity Country { + name String +} + +entity Region { + name String +} + +relationship OneToOne { + Department{location} to Location, + Employee{user(login)} to User with jpaDerivedIdentifier +} + +relationship OneToMany { + BankAccount{operation} to Operation{bankAccount(name)} +} +relationship ManyToOne { + BankAccount{user(login)} to User +} +relationship ManyToMany { + Operation{theLabel(labelName)} to TheLabel{operation} +} + +relationship OneToMany { + /** + * A relationship + */ + Department{employee} to + /** + * Another side of the same relationship, + */ + Employee{department}, + Employee{job} to Job{emp(lastName)}, + Location{country} to Country, + Country{area(name)} to Region +} + +relationship ManyToOne { + Employee{manager(lastName)} to Employee, + Employee{sibag(name) required} to SilverBadge, + Employee{gobag(name) required} to GoldenBadge, + SilverBadge{iden(name) required} to Identifier, + GoldenBadge{iden(name) required} to Identifier +} + +relationship ManyToMany { + JobHistory{department} to Department{history}, + JobHistory{job} to Job{history}, + JobHistory{emp(firstName)} to Employee{history}, + Job{chore(title)} to Task{linkedJob(title)}, + Bank{account} to BankAccount{bank} +} + +dto BankAccount, Employee, Department, Location, Country, Region, SilverBadge, GoldenBadge, Identifier with mapstruct + +angularSuffix BankAccount with mySuffix +// filter BankAccount, Employee +clientRootFolder BankAccount, TheLabel, Operation with test-root + +paginate TheLabel, Job with pagination +paginate Operation, JobHistory, Employee with infinite-scroll + +service TheLabel, Employee, Department, Region with serviceClass +service BankAccount, Location, Country with serviceImpl diff --git a/test-integration/scripts/99-cleanup.sh b/test-integration/scripts/99-cleanup.sh index dd14c9a8..c36faf00 100755 --- a/test-integration/scripts/99-cleanup.sh +++ b/test-integration/scripts/99-cleanup.sh @@ -4,8 +4,6 @@ set -ex mv backup.eslintrc.json .eslintrc.json -rm -rf ./sample-output/ - SCRIPT_FOLDER=`dirname "$0"` UTIL_FOLDER="$SCRIPT_FOLDER/util" @@ -20,5 +18,6 @@ else echo "Protractor is not being used in this sample" fi -cd ../../ +cd .. +rm -rf ./sample-output/