Skip to content

Commit c861673

Browse files
authored
Merge pull request #176 from BillFarber/task/mergeTestExamples
Merging into a single test-app
2 parents 93a543f + e14e7c9 commit c861673

Some content is hidden

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

49 files changed

+512
-334
lines changed

CONTRIBUTING.md

Lines changed: 127 additions & 168 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies {
5050

5151
// Note that in general, the version of the DHF jar must match that of the deployed DHF instance. Different versions
5252
// may work together, but that behavior is not guaranteed.
53-
implementation("com.marklogic:marklogic-data-hub:5.8.0") {
53+
implementation("com.marklogic:marklogic-data-hub:6.0.0") {
5454
exclude module: "marklogic-client-api"
5555
exclude module: "ml-javaclient-util"
5656
exclude module: "ml-app-deployer"
@@ -117,29 +117,6 @@ shadowJar {
117117
exclude "scaffolding/**"
118118
}
119119

120-
task copyJarToKafka(type: Copy, dependsOn: shadowJar) {
121-
description = "Used for local development and testing; copies the jar to your local Kafka install"
122-
from "build/libs"
123-
into "${kafkaHome}/libs"
124-
}
125-
126-
task copyPropertyFilesToKafka(type: Copy) {
127-
description = "Used for local development and testing; copies the properties files to your local Kafka install"
128-
from "config"
129-
into "${kafkaHome}/config"
130-
filter { String line ->
131-
line.startsWith('ml.connection.username=') ? 'ml.connection.username=' + kafkaMlUsername : line
132-
}
133-
filter { String line ->
134-
line.startsWith('ml.connection.password=') ? 'ml.connection.password=' + kafkaMlPassword : line
135-
}
136-
}
137-
138-
task deploy {
139-
description = "Used for local development and testing; builds the jar and copies it and the properties files to your local Kafka install"
140-
dependsOn = ["copyJarToKafka", "copyPropertyFilesToKafka"]
141-
}
142-
143120
ext {
144121
confluentArchiveGroup = "Confluent Connector Archive"
145122
confluentTestingGroup = "Confluent Platform Local Testing"
@@ -214,52 +191,10 @@ task connectorArchive(type: Zip, dependsOn: connectorArchive_BuildDirectory, gro
214191
destinationDirectory = file('build/distro')
215192
}
216193

217-
// Tasks for working with Confluent Platform running locally.
218-
// See "Testing with Confluent Platform" in CONTRIBUTING.md
194+
// Tasks for using the connector with Confluent Platform on Docker
219195

220-
task installConnectorInConfluent(type: Copy, dependsOn: connectorArchive, group: confluentTestingGroup) {
196+
task copyConnectorToDockerVolume(type: Copy, dependsOn: connectorArchive, group: confluentTestingGroup) {
221197
description = "Copies the connector's archive directory to the Docker volume shared with the Connect server"
222198
from "build/connectorArchive"
223-
into "src/test/confluent-platform-example/docker/confluent-marklogic-components"
224-
}
225-
226-
task loadDatagenPurchasesConnector(type: Exec, group: confluentTestingGroup) {
227-
description = "Load an instance of the Datagen connector into Confluent Platform for sending JSON documents to " +
228-
"the 'purchases' topic"
229-
commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json",
230-
"--data", "@src/test/resources/confluent/datagen-purchases-source.json", "http://localhost:8083/connectors"
231-
}
232-
233-
task loadMarkLogicPurchasesSinkConnector(type: Exec, group: confluentTestingGroup) {
234-
description = "Load an instance of the MarkLogic Kafka connector into Confluent Platform for writing data to " +
235-
"MarkLogic from the 'purchases' topic"
236-
commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json",
237-
"--data", "@src/test/resources/confluent/marklogic-purchases-sink.json", "http://localhost:8083/connectors"
238-
}
239-
240-
task loadMarkLogicPurchasesSourceConnector(type: Exec, group: confluentTestingGroup) {
241-
description = "Load an instance of the MarkLogic Kafka connector into Confluent Platform for reading rows from " +
242-
"the demo/purchases view"
243-
commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json",
244-
"--data", "@src/test/resources/confluent/marklogic-purchases-source.json", "http://localhost:8083/connectors"
245-
}
246-
247-
task loadMarkLogicAuthorsSourceConnector(type: Exec, group: confluentTestingGroup) {
248-
description = "Loads a source connector that retrieves authors from the citations.xml file, which is also used for " +
249-
"all the automated tests"
250-
commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json",
251-
"--data", "@src/test/resources/confluent/marklogic-authors-source.json", "http://localhost:8083/connectors"
252-
}
253-
254-
task loadMarkLogicEmployeesSourceConnector(type: Exec, group: confluentTestingGroup) {
255-
commandLine "curl", "-s", "-X", "POST", "-H", "Content-Type: application/json",
256-
"--data", "@src/test/resources/confluent/marklogic-employees-source.json", "http://localhost:8083/connectors"
257-
}
258-
259-
task insertAuthors(type: Test) {
260-
useJUnitPlatform()
261-
systemProperty "AUTHOR_IDS", authorIds
262-
description = "Insert a new author into the kafka-test-content database via a new citations XML document; " +
263-
"use e.g. -PauthorIds=7,8,9 to insert 3 new authors with IDs of 7, 8, and 9"
264-
include "com/marklogic/kafka/connect/source/debug/InsertAuthorsTest.class"
199+
into "test-app/docker/confluent-marklogic-components"
265200
}

docker-compose.yml

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

gradle.properties

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,12 @@ version=1.9-SNAPSHOT
55
componentOwner=marklogic
66
componentName=kafka-marklogic-connector
77

8-
# Override in gradle-local.properties if testing with regular Apache Kafka
9-
kafkaHome=
10-
kafkaMlUsername=
11-
kafkaMlPassword=
8+
systemProp.sonar.host.url=http://localhost:9000
9+
systemProp.sonar.token=<Define this property in gradle-local.properties>
10+
systemProp.sonar.projectKey=marklogic-kafka-connector
1211

1312
# Only used for testing
14-
mlConfigPaths=src/test/ml-config
15-
mlModulePaths=src/test/ml-modules
16-
mlSchemaPaths=src/test/ml-schemas
17-
mlDataPaths=src/test/ml-data
18-
mlRestPort=8018
19-
mlTestRestPort=8019
20-
mlAppName=kafka-test
2113
mlUsername=admin
2214
mlPassword=admin
23-
mlContentForestsPerHost=2
24-
25-
# For inserting new authors during manual testing; set this to a comma-delimited string of numbers
26-
# e.g. -PauthorIds=7,8,9
27-
authorIds=
28-
29-
# For Sonar analysis; set systemProp.sonar.login in gradle-local.properties or via -D when running gradlew
30-
systemProp.sonar.host.url=http://localhost:9000
31-
systemProp.sonar.token=<Replace With Your Sonar Token>
32-
systemProp.sonar.projectKey=marklogic-kafka-connector
15+
mlRestPort=8011
16+
mlTestRestPort=8011

src/test/data-hub-example/build.gradle

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

src/test/data-hub-example/gradle.properties

Lines changed: 0 additions & 8 deletions
This file was deleted.
-53.9 KB
Binary file not shown.

src/test/java/com/marklogic/kafka/connect/source/debug/InsertAuthorsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void insertAuthors() {
8484
}
8585

8686
DatabaseClientConfig config = testConfig.databaseClientConfig();
87-
config.setPort(8018);
87+
config.setPort(8010);
8888
DatabaseClient client = new DefaultConfiguredDatabaseClientFactory().newDatabaseClient(config);
8989

9090
XMLDocumentManager mgr = client.newXMLDocumentManager();

src/test/ml-config/databases/schemas-database.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
src/main/hub-internal-config
2-
src/main/ml-config
32
src/main/entity-config

0 commit comments

Comments
 (0)