Skip to content

Commit

Permalink
Adds more entity types to CI (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTypesCodes committed Dec 3, 2020
1 parent 378acb6 commit e571ebe
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
189 changes: 189 additions & 0 deletions test-integration/samples/jdl-default-app.jdl
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions test-integration/scripts/99-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -20,5 +18,6 @@ else
echo "Protractor is not being used in this sample"
fi

cd ../../
cd ..

rm -rf ./sample-output/

0 comments on commit e571ebe

Please sign in to comment.