Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit 2b4dead

Browse files
committed
Merge branch 'develop' of https://github.com/Sybit-Education/airtable.java into develop
2 parents f6934b7 + 3242c78 commit 2b4dead

73 files changed

Lines changed: 2750 additions & 26 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ hs_err_pid*
1313
build/
1414
.gradle/
1515
src/test/resources/credentials.properties
16+
src/itest/resources/credentials.properties
17+
.nb-gradle-properties
18+
.nb-gradle/
1619

1720
# IDE
18-
.idea
21+
.idea
22+
src/itest/resources/credentials.properties

.nb-gradle-properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<gradle-project-properties>
3+
<!--DO NOT EDIT THIS FILE! - Used by the Gradle plugin of NetBeans.-->
4+
</gradle-project-properties>
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<gradle-project-properties>
3+
<!--DO NOT EDIT THIS FILE! - Used by the Gradle plugin of NetBeans.-->
4+
<auxiliary>
5+
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
6+
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
7+
<group>
8+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/build.gradle</file>
9+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/test/java/com/sybit/airtable/CustomObjectMapperTest.java</file>
10+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/main/java/com/sybit/airtable/vo/Thumbnail.java</file>
11+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/itest/java/com/sybit/airtable/TableSelectTest.java</file>
12+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/.travis.yml</file>
13+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/main/java/com/sybit/airtable/Airtable.java</file>
14+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/main/java/com/sybit/airtable/vo/Attachment.java</file>
15+
</group>
16+
</open-files>
17+
<editor-bookmarks lastBookmarkId="0" xmlns="http://www.netbeans.org/ns/editor-bookmarks/2"/>
18+
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
19+
<group>
20+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/.gitignore</file>
21+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/main/java/com/sybit/airtable/vo/Thumbnail.java</file>
22+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/itest/java/com/sybit/airtable/TableSelectTest.java</file>
23+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/test/java/com/sybit/airtable/AirtableTest.java</file>
24+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/main/java/com/sybit/airtable/Airtable.java</file>
25+
<file>file:/D:/Projekte/Sybit/Airtable/airtable.java/src/main/java/com/sybit/airtable/vo/Attachment.java</file>
26+
</group>
27+
</open-files>
28+
</auxiliary>
29+
</gradle-project-properties>

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ jdk:
44
before_install:
55
- chmod +x ./gradlew
66
script:
7-
- "./gradlew check sendCoverageToCodacy"
7+
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./gradlew check; fi'
8+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bash ./gradlew test integrationTest; fi'
9+
- "./gradlew sendCoverageToCodacy"
810
deploy:
911
- provider: releases
1012
api_key:
@@ -17,7 +19,7 @@ deploy:
1719
tags: true
1820
- provider: script
1921
skip_cleanup: true
20-
script: "./gradlew install bintrayUpload"
22+
script: "./gradlew -i bintrayUpload"
2123
on:
2224
repo: Sybit-Education/airtable.java
2325
tags: true

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ Short overview of features, which are supported:
350350

351351
We are glad to see your pull requests.
352352

353+
We use Travis as our continous integration build. Because of Travis security reasons on a Pull Request only JUnit tests run.
354+
The integration tests need a valid AIRTABLE_API_KEY which travis doesent provide on PR's from forked reposiorys.
355+
However the integration tests you wrote will run after the PR is confirmed and merged.
356+
353357
## Current status
354358

355359
The current status of our project is maintained on our agile board:
@@ -366,8 +370,8 @@ We use [Gradle](https://gradle.org) to compile and package project:
366370
+ build jar: `./gradlew jar` (The built JARs will be placed under `build/libs`.)
367371

368372
## Testing
369-
There are JUnit tests to verify the API.
370-
The tests are based on the Airtable template [Movies](https://airtable.com/templates/groups-clubs-and-hobbies/exprTnrH3YV8Vv9BI/favorite-movies) which could be created in your account.
373+
There are JUnit tests and integration tests to verify the API.
374+
The integration tests are based on the Airtable template [Movies](https://airtable.com/templates/groups-clubs-and-hobbies/exprTnrH3YV8Vv9BI/favorite-movies) which could be created in your account.
371375
For testing, the JSON-responses are mocked by [WireMock](http://wiremock.org/).
372376

373377
# Other Airtable Projects

build.gradle

Lines changed: 67 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,27 @@ def getVersionName = { ->
2424

2525
buildscript {
2626
repositories {
27+
mavenLocal()
2728
jcenter()
2829
}
2930

30-
dependencies {
31-
classpath 'com.palantir:jacoco-coverage:0.4.0'
32-
classpath "com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2"
33-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
34-
}
31+
dependencies {
32+
classpath 'com.palantir:jacoco-coverage:0.4.0'
33+
classpath "com.smokejumperit.gradle.license:Gradle-License-Report:0.0.2"
34+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
35+
}
3536
}
3637

37-
apply plugin: 'java'
38-
apply plugin: 'maven'
39-
apply plugin: 'com.palantir.jacoco-coverage'
40-
apply plugin: 'maven-publish'
41-
apply plugin: 'com.jfrog.bintray'
38+
allprojects {
39+
repositories {
40+
jcenter()
41+
}
42+
apply plugin: 'java'
43+
apply plugin: 'maven'
44+
apply plugin: 'maven-publish'
45+
apply plugin: 'com.palantir.jacoco-coverage'
46+
apply plugin: 'com.jfrog.bintray'
47+
}
4248

4349
group = 'com.sybit'
4450
version = getVersionName()
@@ -51,7 +57,26 @@ tasks.withType(JavaCompile) {
5157
options.encoding = 'UTF-8'
5258
}
5359

60+
sourceSets {
61+
integrationTest {
62+
compileClasspath += main.output + test.output
63+
runtimeClasspath += main.output + test.output
64+
// You can add other directories to the classpath like this:
65+
//runtimeClasspath += files('src/itest/resources/com/buransky')
66+
// Use "java" if you don't use Scala as a programming language
67+
java.srcDir file('src/itest/java')
68+
}
69+
// This is just to trick IntelliJ IDEA to add integration test
70+
// resources to classpath when running integration tests from
71+
// the IDE. It's is not a good solution but I don't know about
72+
// a better one.
73+
test {
74+
resources.srcDir file('src/itest/resources')
75+
}
76+
}
77+
5478
repositories {
79+
mavenLocal()
5580
jcenter()
5681
mavenCentral()
5782
maven { url "https://jitpack.io" }
@@ -60,6 +85,8 @@ repositories {
6085

6186
configurations {
6287
codacy
88+
integrationTestCompile.extendsFrom testCompile
89+
integrationTestRuntime.extendsFrom testRuntime
6390
}
6491

6592
dependencies {
@@ -95,6 +122,7 @@ artifacts {
95122
archives sourcesJar, javadocJar
96123
}
97124

125+
//task to send coverage data to Codacy
98126
task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
99127
main = "com.codacy.CodacyCoverageReporter"
100128
classpath = configurations.codacy
@@ -106,28 +134,51 @@ task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
106134
]
107135
}
108136

137+
task integrationTest(type: Test) {
138+
testClassesDir = sourceSets.integrationTest.output.classesDir
139+
classpath = sourceSets.integrationTest.runtimeClasspath
140+
// This is not needed, but I like to see which tests have run
141+
testLogging {
142+
events "passed", "skipped", "failed"
143+
}
144+
}
145+
109146

110147
publishing {
111148
publications {
112-
mavenJava(MavenPublication) {
149+
150+
MyPublication(MavenPublication) {
151+
//we have to change scope from runtime to compile. Especially for Gson-lib.
152+
pom.withXml {
153+
asNode().dependencies.'*'.findAll() {
154+
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
155+
dep.name == it.artifactId.text()
156+
}
157+
}.each { it.scope*.value = 'compile' }
158+
}
159+
113160
if (plugins.hasPlugin('war')) {
114161
from components.web
115162
} else {
116163
from components.java
117164
}
165+
groupId group
166+
artifactId rootProject.name
167+
version getVersionName()
118168

119169
artifact sourcesJar
120170
artifact javadocJar
121171
}
172+
122173
}
123174
}
124175

125176
bintray {
126177
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
127178
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
128179

129-
//publications = ['mavenJava']
130-
configurations = ['archives']
180+
publications = ['MyPublication']
181+
//configurations = ['archives']
131182

132183
dryRun = false //Whether to run this as dry-run, without deploying
133184
publish = true //If version should be auto published after an upload
@@ -144,3 +195,6 @@ bintray {
144195
}
145196
}
146197
}
198+
199+
integrationTest.mustRunAfter test
200+

src/test/java/com/sybit/airtable/TableConverterTest.java renamed to src/itest/java/com/sybit/airtable/TableConverterTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
*/
66
package com.sybit.airtable;
77

8+
9+
import com.sybit.airtable.Base;
10+
import com.sybit.airtable.Table;
811
import com.sybit.airtable.exception.AirtableException;
912
import com.sybit.airtable.movies.Actor;
1013
import com.sybit.airtable.movies.Movie;
11-
import com.sybit.airtable.test.WireMockBaseTest;
14+
import com.sybit.airtable.mock.WireMockBaseTest;
1215
import com.sybit.airtable.vo.Attachment;
1316
import com.sybit.airtable.vo.Thumbnail;
1417
import java.util.List;

src/test/java/com/sybit/airtable/TableCreateRecordTest.java renamed to src/itest/java/com/sybit/airtable/TableCreateRecordTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
*/
66
package com.sybit.airtable;
77

8+
import com.sybit.airtable.Base;
9+
import com.sybit.airtable.Table;
810
import com.sybit.airtable.exception.AirtableException;
911
import com.sybit.airtable.movies.Actor;
1012
import com.sybit.airtable.movies.Movie;
11-
import com.sybit.airtable.test.WireMockBaseTest;
13+
import com.sybit.airtable.mock.WireMockBaseTest;
1214
import com.sybit.airtable.vo.Attachment;
1315
import java.lang.reflect.InvocationTargetException;
1416
import java.util.ArrayList;

src/test/java/com/sybit/airtable/TableDestroyTest.java renamed to src/itest/java/com/sybit/airtable/TableDestroyTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
package com.sybit.airtable;
77

8+
import com.sybit.airtable.Base;
9+
import com.sybit.airtable.Table;
810
import com.sybit.airtable.exception.AirtableException;
911
import com.sybit.airtable.movies.Actor;
10-
import com.sybit.airtable.test.WireMockBaseTest;
12+
import com.sybit.airtable.mock.WireMockBaseTest;
1113
import java.util.List;
1214
import org.apache.http.client.HttpResponseException;
1315
import static org.junit.Assert.assertEquals;

0 commit comments

Comments
 (0)