Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
61 changes: 56 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ plugins {
ext {
minClientJavaVersion = 11
minNonClientJavaVersion = 17
modulesNeedingJava11 = [":clients", ":generator", ":streams", ":streams:test-utils", ":streams:examples", ":streams:streams-scala", ":test-common:test-common-util"]
modulesNeedingJava11 = [":clients", ":generator", ":streams", ":streams:test-utils", ":streams:examples", ":streams:streams-scala", ":test-common:test-common-util", ":test-common:test-common-base"]

buildVersionFileName = "kafka-version.properties"

Expand Down Expand Up @@ -1005,6 +1005,7 @@ project(':server') {
testImplementation testLog4j2Libs
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':storage:storage-api').sourceSets.test.output
testImplementation project(':server-common').sourceSets.test.output

Expand Down Expand Up @@ -1131,6 +1132,7 @@ project(':core') {
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-util')
testImplementation project(':test-common:test-common-base')
testImplementation libs.bcpkix
testImplementation libs.mockitoCore
testImplementation(libs.apacheda) {
Expand Down Expand Up @@ -1401,6 +1403,7 @@ project(':metadata') {
testImplementation project(':raft').sourceSets.test.output
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':test-common:test-common-util')
testImplementation project(':test-common:test-common-base')

testRuntimeOnly runtimeTestLibs

Expand Down Expand Up @@ -1520,6 +1523,7 @@ project(':group-coordinator') {
implementation libs.slf4jApi
implementation libs.hash4j

testImplementation project(':test-common:test-common-base')
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':coordinator-common').sourceSets.test.output
Expand Down Expand Up @@ -1574,6 +1578,36 @@ project(':group-coordinator') {
srcJar.dependsOn 'processMessages'
}

project(':test-common:test-common-base') {
// Generic utilities for testing. Depends on `clients` only to minimize classpath leakage.
// e.g. SSL utilities, wait functions, file-related operations
// Java 11 is the minimum Java version required.

base {
archivesName = "kafka-test-common-base"
}

dependencies {
// `client` tests depend on this module so `implementation project(':clients')` would cause a circular dependency
// and trigger `createVersionFile`, breaking AppInfoParserTest's expectations.
// The tradeoff is that transitive dependencies from `clients` are dropped.
implementation project(':clients').sourceSets.main.output

implementation libs.bcpkix
implementation libs.junitJupiter
implementation testLog4j2Libs

testRuntimeOnly runtimeTestLibs
}

checkstyle {
configProperties = checkstyleConfigProperties("import-control-test-common-base.xml")
}

javadoc {
enabled = false
}
}

project(':test-common:test-common-internal-api') {
// Interfaces, config classes, and other test APIs. Java 17 is the minimum Java version.
Expand Down Expand Up @@ -1686,6 +1720,7 @@ project(':transaction-coordinator') {
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-base')

testRuntimeOnly runtimeTestLibs

Expand Down Expand Up @@ -1749,6 +1784,7 @@ project(':coordinator-common') {

testImplementation project(':clients').sourceSets.test.output
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
testImplementation testLog4j2Libs
Expand Down Expand Up @@ -1903,6 +1939,7 @@ project(':clients') {
compileOnly libs.jose4j // for SASL/OAUTHBEARER JWT validation; only used by broker


testImplementation project(':test-common:test-common-base')
testImplementation project(':test-common:test-common-util')
testImplementation libs.bcpkix
testImplementation libs.jacksonJakartarsJsonProvider
Expand Down Expand Up @@ -2076,6 +2113,7 @@ project(':clients:clients-integration-tests') {
testImplementation libs.slf4jApi
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':metadata')
testImplementation project(':raft')
testImplementation project(':server')
Expand Down Expand Up @@ -2120,6 +2158,7 @@ project(':raft') {

testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation libs.jacksonDataformatYaml
Expand Down Expand Up @@ -2219,6 +2258,7 @@ project(':server-common') {

testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation libs.jacksonDataformatYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
Expand Down Expand Up @@ -2278,7 +2318,7 @@ project(':storage:storage-api') {
implementation libs.slf4jApi

testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
testImplementation testLog4j2Libs
Expand Down Expand Up @@ -2354,6 +2394,7 @@ project(':storage') {
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-util')
testImplementation project(':test-common:test-common-base')
testImplementation project(':server')
testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
Expand Down Expand Up @@ -2547,6 +2588,7 @@ project(':tools') {
testImplementation project(':core').sourceSets.test.output
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':connect:api')
Expand Down Expand Up @@ -2626,6 +2668,7 @@ project(':trogdor') {

testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation project(':group-coordinator')
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
Expand Down Expand Up @@ -2674,7 +2717,6 @@ project(':shell') {
implementation libs.jacksonJakartarsJsonProvider

testImplementation project(':clients')
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':core')
testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
Expand Down Expand Up @@ -2727,6 +2769,7 @@ project(':streams') {
testCompileOnly libs.bndlib

testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation libs.jacksonDataformatYaml
testImplementation libs.junitJupiter
testImplementation libs.bcpkix
Expand Down Expand Up @@ -2869,8 +2912,8 @@ project(':streams:streams-scala') {

api libs.scalaLibrary
testImplementation project(':streams').sourceSets.test.output
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':streams:test-utils')
testImplementation project(':test-common:test-common-base')

testImplementation libs.jacksonDataformatYaml
testImplementation libs.junitJupiter
Expand Down Expand Up @@ -2921,15 +2964,16 @@ project(':streams:integration-tests') {
implementation libs.slf4jApi
implementation libs.scalaLibrary

testImplementation project(':clients').sourceSets.test.output
testImplementation project(':group-coordinator')
testImplementation project(':server')
testImplementation project(':server-common')
testImplementation project(':server-common').sourceSets.test.output
testImplementation project(':storage')
testImplementation project(':streams').sourceSets.test.output
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':streams:streams-scala')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':tools')
testImplementation project(':transaction-coordinator')
testImplementation libs.bcpkix
Expand Down Expand Up @@ -2976,6 +3020,7 @@ project(':streams:test-utils') {
implementation libs.slf4jApi

testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-base')
testImplementation libs.jacksonDataformatYaml
testImplementation libs.junitJupiter
testImplementation libs.mockitoCore
Expand Down Expand Up @@ -3012,6 +3057,7 @@ project(':streams:examples') {

testImplementation project(':streams:test-utils')
testImplementation project(':clients').sourceSets.test.output // for org.apache.kafka.test.IntegrationTest
testImplementation project(':test-common:test-common-base')
testImplementation libs.junitJupiter
testImplementation libs.hamcrest
testImplementation testLog4j2Libs
Expand Down Expand Up @@ -3454,6 +3500,7 @@ project(':jmh-benchmarks') {
implementation project(':server-common').sourceSets.test.output
implementation project(':server').sourceSets.test.output
implementation project(':metadata').sourceSets.test.output
implementation project(':test-common:test-common-base')

implementation libs.jmhCore
annotationProcessor libs.jmhGeneratorAnnProcess
Expand Down Expand Up @@ -3665,6 +3712,7 @@ project(':connect:runtime') {
testImplementation project(':test-common:test-common-internal-api')
testImplementation project(':test-common:test-common-util')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':raft')
testImplementation project(':server-common')
testImplementation project(':server')
Expand Down Expand Up @@ -3790,6 +3838,7 @@ project(':connect:file') {
testImplementation project(':connect:runtime').sourceSets.test.output
testImplementation project(':core')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':server-common').sourceSets.test.output

testRuntimeOnly runtimeTestLibs
Expand Down Expand Up @@ -3830,6 +3879,7 @@ project(':connect:basic-auth-extension') {
testImplementation libs.junitJupiter
testImplementation testLog4j2Libs
testImplementation project(':clients').sourceSets.test.output
testImplementation project(':test-common:test-common-base')

testRuntimeOnly libs.jerseyContainerServlet
testRuntimeOnly runtimeTestLibs
Expand Down Expand Up @@ -3894,6 +3944,7 @@ project(':connect:mirror') {
testImplementation project(':connect:runtime').sourceSets.test.output
testImplementation project(':core')
testImplementation project(':test-common:test-common-runtime')
testImplementation project(':test-common:test-common-base')
testImplementation project(':raft')
testImplementation project(':server')
testImplementation project(':server-common')
Expand Down
2 changes: 1 addition & 1 deletion checkstyle/import-control-coordinator-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<allow pkg="org.apache.kafka.server.storage" />
<allow pkg="org.apache.kafka.server.util" />
<allow pkg="org.apache.kafka.storage.internals.log" />
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
<allow pkg="org.apache.kafka.timeline" />
<allow pkg="org.HdrHistogram" />
</subpackage>
Expand Down
1 change: 1 addition & 0 deletions checkstyle/import-control-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<allow pkg="org.apache.directory" />
<allow pkg="org.apache.mina.core.service" />
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
</subpackage>

</import-control>
2 changes: 1 addition & 1 deletion checkstyle/import-control-group-coordinator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<allow pkg="org.apache.kafka.server.share.persister"/>
<allow pkg="org.apache.kafka.server.util"/>
<allow pkg="org.apache.kafka.storage.internals.log"/>
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
<allow pkg="org.apache.kafka.timeline" />
<allow pkg="org.apache.kafka.coordinator.common" />
<allow pkg="com.google.re2j" />
Expand Down
2 changes: 1 addition & 1 deletion checkstyle/import-control-jmh-benchmarks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
<allow pkg="org.apache.kafka.coordinator.transaction"/>
<allow pkg="org.apache.kafka.connect" />
<allow pkg="org.apache.kafka.network" />
<allow pkg="org.apache.kafka.common.test.base" />
<allow class="org.apache.kafka.raft.QuorumConfig"/>
<allow class="org.apache.kafka.raft.KRaftConfigs"/>
<allow class="org.apache.kafka.test.TestUtils"/>
<allow class="org.apache.kafka.jmh.util.BenchmarkConfigUtils"/>
<allow pkg="joptsimple"/>

Expand Down
6 changes: 3 additions & 3 deletions checkstyle/import-control-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<allow pkg="org.apache.kafka.server.policy"/>
<allow pkg="org.apache.kafka.server.util"/>
<allow pkg="org.apache.kafka.snapshot" />
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
<allow pkg="org.apache.kafka.timeline" />
<subpackage name="metrics">
<allow pkg="com.yammer.metrics"/>
Expand Down Expand Up @@ -118,7 +118,7 @@
<allow pkg="org.apache.kafka.server.fault" />
<allow pkg="org.apache.kafka.server.util" />
<allow pkg="org.apache.kafka.snapshot" />
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
<subpackage name="loader">
<subpackage name="metrics">
<allow pkg="com.yammer.metrics"/>
Expand Down Expand Up @@ -163,7 +163,7 @@
<allow pkg="org.apache.kafka.server.config" />
<allow pkg="org.apache.kafka.server.quota" />
<allow pkg="org.apache.kafka.server.util"/>
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
<subpackage name="authorizer">
<allow pkg="org.apache.kafka.controller" />
<allow pkg="org.apache.kafka.common.metrics" />
Expand Down
8 changes: 4 additions & 4 deletions checkstyle/import-control-server-common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<allow pkg="org.apache.kafka.server.config" />

<subpackage name="queue">
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
</subpackage>

<subpackage name="metadata">
Expand All @@ -63,7 +63,7 @@
<allow pkg="org.apache.kafka.common.protocol" />
<allow pkg="org.apache.kafka.metadata.properties" />
<allow pkg="org.apache.kafka.server.common" />
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
</subpackage>

<subpackage name="security">
Expand Down Expand Up @@ -111,7 +111,7 @@
<subpackage name="persister">
<allow pkg="org.apache.kafka.clients" />
<allow pkg="org.apache.kafka.server.util" />
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
</subpackage>
</subpackage>

Expand All @@ -128,7 +128,7 @@
<allow pkg="org.apache.kafka.server.util.json" />

<allow class="org.apache.kafka.server.util.TopicFilter.IncludeList" />
<allow class="org.apache.kafka.test.TestUtils" />
<allow class="org.apache.kafka.common.test.base.TestUtils" />
<!-- ServerTestUtils uses yammer metrics for test cleanup -->
<allow pkg="org.apache.kafka.server.metrics" />
<allow pkg="com.yammer.metrics.core" />
Expand Down
1 change: 1 addition & 0 deletions checkstyle/import-control-server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

<!-- utilities for testing -->
<allow pkg="org.apache.kafka.test" />
<allow pkg="org.apache.kafka.common.test.base" />
<allow class="org.apache.kafka.controller.QuorumController" />

<!-- persistent collection factories/non-library-specific wrappers -->
Expand Down
Loading
Loading