Skip to content

Commit b64a72d

Browse files
authored
Source connector productization (#17)
* Updated build scripts * Code refactoring and stability fixes * Added automated integration testing * Updated documentation * Packages available from download pages
1 parent 689b042 commit b64a72d

File tree

71 files changed

+2491
-1304
lines changed

Some content is hidden

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

71 files changed

+2491
-1304
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tmp/**/*
2525
*~.nib
2626
local.properties
2727
.classpath
28-
.settings/
28+
.settings
2929
.loadpath
3030
.checkstyle
3131

@@ -34,3 +34,7 @@ local.properties
3434

3535
# Locally stored "Eclipse launch configurations"
3636
*.launch
37+
/build/
38+
39+
# Unzipped test connector
40+
src/integrationTest/resources/pubsubplus-connector-kafka*/

.settings/org.eclipse.buildship.core.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.

.travis.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
language: java
22
install: true
3-
3+
sudo: required
4+
services:
5+
- docker
46
jdk:
5-
- openjdk8
7+
- openjdk8
68

79
script:
8-
- ./gradlew clean check jar
10+
- ./gradlew clean integrationTest --tests com.solace.connector.kafka.connect.source.it.SourceConnectorIT
11+
12+
after_success:
13+
- >
14+
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
15+
git config --global user.email "travis@travis-ci.org";
16+
git config --global user.name "travis-ci";
17+
mkdir gh-pages; # Now update gh-pages
18+
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/SolaceProducts/pubsubplus-connector-kafka-source gh-pages > /dev/null 2>&1;
19+
rm gh-pages/downloads/pubsubplus-connector-kafka-source*
20+
mv build/distributions/pubsubplus-connector-kafka-source* gh-pages/downloads
21+
cd gh-pages;
22+
pushd downloads
23+
cp index.template index.html; FILENAME=`find . | grep *.zip | cut -d'/' -f2 | sed 's/.\{4\}$//'`; sed -i "s/CONNECTOR_NAME/$FILENAME/g" index.html;
24+
popd;
25+
git add -f .;
26+
git commit -m "Latest connector distribution on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages";
27+
git remote add origin-pages https://${GH_TOKEN}@github.com/SolaceProducts/pubsubplus-connector-kafka-source.git > /dev/null 2>&1;
28+
git push --quiet --set-upstream origin-pages gh-pages;
29+
echo "Updated and pushed GH pages!";
30+
fi

NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Simple process JMS message types support
2+
TextMessage
3+
BytesMessage

README.md

Lines changed: 240 additions & 224 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 64 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,87 @@
1-
/*
2-
* This build file was generated by the Gradle 'init' task.
3-
*
4-
* This generated file contains a sample Java Library project to get you started.
5-
* For more details take a look at the Java Libraries chapter in the Gradle
6-
* user guapply plugin: e available at https://docs.gradle.org/3.5/userguapply plugin: e/java_library_plugin.html
7-
*/
8-
9-
// Apply the java-library plugin to add support for Java Library
10-
apply plugin: 'java-library'
111
apply plugin: 'java'
12-
apply plugin: 'checkstyle'
13-
apply plugin: 'findbugs'
14-
apply plugin: 'pmd'
15-
apply plugin: 'jacoco'
16-
//apply plugin: 'net.researchgate.release' version '2.4.0'
17-
//apply plugin: "com.jfrog.bintray" version '1.7'
18-
apply plugin: 'maven'
19-
apply plugin: 'maven-publish'
2+
apply plugin: 'distribution'
3+
apply plugin: 'org.unbroken-dome.test-sets'
204

215
ext {
22-
//kafkaVersion = '0.10.0.0'
23-
//kafkaVersion = '0.11.0.0'
24-
//kafkaVersion = '1.1.0'
25-
kafkaVersion = '2.0.0'
6+
kafkaVersion = '2.4.1'
7+
solaceJavaAPIVersion = '10.6.0'
268
}
279

28-
// In this section you declare where to find the dependencies of your project
2910
repositories {
30-
// Use jcenter for resolving your dependencies.
31-
// You can declare any Maven/Ivy/file repository here.
32-
jcenter()
11+
mavenLocal()
12+
mavenCentral()
3313
}
3414

35-
dependencies {
36-
// This dependency is exported to consumers, that is to say found on their compile classpath.
37-
api 'org.apache.commons:commons-math3:3.6.1'
38-
39-
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
40-
implementation 'com.google.guava:guava:21.0'
41-
42-
// Use JUnit test framework
43-
testImplementation 'junit:junit:4.12'
15+
buildscript {
16+
repositories {
17+
maven {
18+
url "https://plugins.gradle.org/m2/"
19+
}
20+
}
21+
dependencies {
22+
classpath "com.github.spotbugs:spotbugs-gradle-plugin:3.0.0"
23+
classpath "org.unbroken-dome.test-sets:org.unbroken-dome.test-sets.gradle.plugin:2.2.1"
24+
}
4425
}
4526

46-
// In this section you declare where to find the dependencies of your project
47-
repositories {
48-
// Use jcenter for resolving your dependencies.
49-
// You can declare any Maven/Ivy/file repository here.
50-
jcenter()
51-
mavenCentral()
52-
53-
maven { url "https://mvnrepository.com/artifact/com.solacesystems/sol-jcsmp" }
54-
// https://mvnrepository.com/artifact/com.solacesystems/sol-jcsmp
55-
56-
27+
testSets {
28+
integrationTest
5729
}
5830

5931
dependencies {
60-
// This dependency is exported to consumers, that is to say found on their compile classpath.
61-
//api 'org.apache.commons:commons-math3:3.6.1'
62-
63-
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
64-
implementation 'com.google.guava:guava:21.0'
65-
66-
// Use JUnit test framework
67-
testImplementation 'junit:junit:4.12'
68-
69-
testCompile group: 'junit', name: 'junit', version: '4.12'
32+
integrationTestImplementation 'junit:junit:4.12'
33+
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
34+
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
35+
integrationTestImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
36+
integrationTestImplementation 'org.junit.platform:junit-platform-engine:1.5.2'
37+
integrationTestImplementation 'org.mockito:mockito-core:3.2.4'
38+
integrationTestImplementation 'org.mockito:mockito-junit-jupiter:3.2.4'
39+
integrationTestImplementation 'org.testcontainers:testcontainers:1.12.4'
40+
integrationTestImplementation 'org.testcontainers:junit-jupiter:1.12.4'
41+
integrationTestImplementation 'org.slf4j:slf4j-api:1.7.28'
42+
integrationTestImplementation 'org.slf4j:slf4j-simple:1.7.28'
43+
integrationTestImplementation 'org.apache.commons:commons-configuration2:2.6'
44+
integrationTestImplementation 'commons-beanutils:commons-beanutils:1.9.4'
45+
integrationTestImplementation 'com.google.code.gson:gson:2.3.1'
46+
integrationTestImplementation 'commons-io:commons-io:2.4'
47+
integrationTestImplementation 'com.squareup.okhttp3:okhttp:4.4.0'
48+
integrationTestImplementation 'org.apache.kafka:kafka-clients:$kafkaVersion'
7049
compile "org.apache.kafka:connect-api:$kafkaVersion"
71-
compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'
72-
compile 'org.bouncycastle:bcprov-jdk15on:1.54'
73-
compile 'org.bouncycastle:bcpkix-jdk15on:1.54'
74-
compile 'org.bouncycastle:bcpg-jdk15on:1.54'
75-
compile 'commons-io:commons-io:2.4'
76-
compile 'org.slf4j:slf4j-api:1.7.14'
77-
testCompile 'org.slf4j:slf4j-simple:1.7.14'
78-
compile group: 'com.solacesystems', name: 'sol-jcsmp', version: '10.4.0'
79-
//compile 'com.puppycrawl.tools:checkstyle:8.12'
50+
compile "com.solacesystems:sol-jcsmp:$solaceJavaAPIVersion"
8051
}
8152

82-
tasks.withType(FindBugs) {
83-
reports {
84-
xml.enabled = true
85-
html.enabled = false
53+
task('prepDistForIntegrationTesting') {
54+
dependsOn assembleDist
55+
doLast {
56+
copy {
57+
from zipTree(file('build/distributions').listFiles().findAll {it.name.endsWith('.zip')}[0])
58+
into (file('src/integrationTest/resources'))
59+
}
60+
copy {
61+
from zipTree(file('build/distributions').listFiles().findAll {it.name.endsWith('.zip')}[0])
62+
into (file('build/resources/integrationTest'))
63+
}
8664
}
8765
}
8866

89-
task copyRuntimeLibs(type: Copy) {
90-
into "$buildDir/output/lib"
91-
from configurations.runtime
67+
project.integrationTest {
68+
useJUnitPlatform()
69+
outputs.upToDateWhen { false }
70+
dependsOn prepDistForIntegrationTesting
9271
}
9372

94-
checkstyle {
95-
repositories {
96-
mavenCentral()
97-
}
98-
configurations {
99-
checkstyle
73+
distributions {
74+
main {
75+
contents {
76+
from('etc/solace_source.properties') { into 'etc' }
77+
from('etc/solace_source_properties.json') { into 'etc' }
78+
from('doc/distribution-readme.md') { into 'doc' }
79+
from('LICENSE') { into 'doc' }
80+
into('lib') {
81+
from jar
82+
from(project.configurations.runtime)
83+
}
84+
// from jar
85+
}
10086
}
101-
dependencies {
102-
//checkstyle 'com.puppycrawl.tools:checkstyle:6.12.1'
103-
checkstyle 'com.puppycrawl.tools:checkstyle:8.12'
104-
105-
}
106-
}
107-
108-
processResources {
109-
expand project.properties
11087
}

0 commit comments

Comments
 (0)