Skip to content

Commit

Permalink
added correct tests for only attribute in attribute binding (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariodavid authored Apr 20, 2018
1 parent 19df8d0 commit d59e9b1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 23 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ cuba {
url = System.properties['uploadRepositoryRelease'] ?: System.env.UPLOAD_REPOSITORY_RELEASE ?: bintrayRepositoryUrl
}

user = System.properties['uploadRepositoryUsername'] ?: System.env.UPLOAD_REPOSITORY_USERNAME
password = System.properties['uploadRepositoryPassword'] ?:System.env.UPLOAD_REPOSITORY_PASSWORD
user = System.env.UPLOAD_REPOSITORY_USERNAME
password = System.env.UPLOAD_REPOSITORY_PASSWORD
}
ide {
vcs = 'Git'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class EntityBinderDatatypesIntegrationTest extends AbstractEntityBinderIntegrati
importConfiguration = new ImportConfiguration(
entityClass: 'ddcdi$MlbTeam',
importAttributeMappers: [
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.state', fileColumnAlias: 'state'),
new ImportAttributeMapper(entityAttribute: 'state', fileColumnAlias: 'state'),
]
)
MlbTeam entity = sut.bindAttributes(importConfiguration, importData.rows[0], new MlbTeam()) as MlbTeam
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class GenericDataImportServiceBeanTest extends AbstractImpotrIntegrationTest {
importConfiguration = new ImportConfiguration(
entityClass: 'ddcdi$MlbTeam',
importAttributeMappers: [
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.name', fileColumnAlias: 'name', fileColumnNumber: 0),
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.code', fileColumnAlias: 'code', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'name', fileColumnAlias: 'name', fileColumnNumber: 0),
new ImportAttributeMapper(entityAttribute: 'code', fileColumnAlias: 'code', fileColumnNumber: 2),
],
uniqueConfigurations: [new UniqueConfiguration(
entityAttributes: [
Expand Down Expand Up @@ -74,9 +74,9 @@ class GenericDataImportServiceBeanTest extends AbstractImpotrIntegrationTest {
importConfiguration = new ImportConfiguration(
entityClass: 'ddcdi$MlbTeam',
importAttributeMappers: [
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.name', fileColumnAlias: 'name', fileColumnNumber: 0),
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.code', fileColumnAlias: 'code', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.state', fileColumnAlias: 'state', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'name', fileColumnAlias: 'name', fileColumnNumber: 0),
new ImportAttributeMapper(entityAttribute: 'code', fileColumnAlias: 'code', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'state', fileColumnAlias: 'state', fileColumnNumber: 2),
],
uniqueConfigurations: [new UniqueConfiguration(
entityAttributes: [
Expand Down Expand Up @@ -112,9 +112,9 @@ class GenericDataImportServiceBeanTest extends AbstractImpotrIntegrationTest {
importConfiguration = new ImportConfiguration(
entityClass: 'ddcdi$MlbTeam',
importAttributeMappers: [
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.name', fileColumnAlias: 'name', fileColumnNumber: 0),
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.code', fileColumnAlias: 'code', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'ddcdi$MlbTeam.state', fileColumnAlias: 'state', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'name', fileColumnAlias: 'name', fileColumnNumber: 0),
new ImportAttributeMapper(entityAttribute: 'code', fileColumnAlias: 'code', fileColumnNumber: 2),
new ImportAttributeMapper(entityAttribute: 'state', fileColumnAlias: 'state', fileColumnNumber: 2),
],
uniqueConfigurations: [new UniqueConfiguration(
entityAttributes: [
Expand Down
1 change: 1 addition & 0 deletions run-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
./gradlew startDb
./gradlew createTestDb
./gradlew check
./gradlew assemble
4 changes: 4 additions & 0 deletions start-for-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

./gradlew startDb
./gradlew createTestDb
13 changes: 1 addition & 12 deletions upload-to-repository.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
#!/usr/bin/env bash

if [[ -z "$1" || -z "$2" ]]
then
echo "Define username, password and repository URL as parameters. Usage: ./upload-to-repository.sh myUser myPassword https://api.bintray.com/maven/balvi/..."

else
if [[ -z "$3" ]]
then
./gradlew -DuploadRepositoryUsername=$1 -DuploadRepositoryPassword=$2 uploadArchives
else
./gradlew -DuploadRepositoryUsername=$1 -DuploadRepositoryPassword=$2 -DuploadRepositoryRelease=$3 uploadArchives
./gradlew uploadArchives

fi

fi

0 comments on commit d59e9b1

Please sign in to comment.