This is an automated email from the ASF dual-hosted git repository.
ppkarwasz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/logging-flume.git
The following commit(s) were added to refs/heads/trunk by this push:
new 501c502a Replace the SDK test JAR with a `flume-ng-sdk-test` module
(#495)
501c502a is described below
commit 501c502a55d2531413b1946893db24c7443609e1
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Tue Sep 1 22:23:06 2026 +0200
Replace the SDK test JAR with a `flume-ng-sdk-test` module (#495)
The site build runs `mvnw -Dmaven.test.skip install`, which also skips
`jar:test-jar`. Maven still resolves the full test classpath before
`compiler:testCompile` and `surefire:test` can read their skip flags, so
the cross-module `flume-ng-sdk:tests` dependency was demanded but never
produced and `deploy-site` failed to resolve it.
Assisted-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WnSh7gt5XaRzNgDYLuFzZ6
---
flume-bom/pom.xml | 5 ++
flume-ng-core/pom.xml | 3 +-
.../org/apache/flume/sink/TestRollingFileSink.java | 2 +-
.../pom.xml | 48 +++++++---------
.../org/apache/flume/sdk/test}/TestKeyStores.java | 2 +-
.../java/org/apache/flume/sdk/test}/Whitebox.java | 2 +-
.../apache/flume/sdk/test}/X509Certificates.java | 2 +-
.../flume/sdk/test/TestSelfSignedKeyStores.java | 67 ++++++++++++++++++++++
.../org/apache/flume/sdk/test/TestWhitebox.java | 37 +++++++-----
.../flume/sdk/test/TestX509Certificates.java | 57 ++++++++++++++++++
flume-ng-sdk/pom.xml | 39 -------------
flume-ng-sources/flume-http-source/pom.xml | 3 +-
.../apache/flume/source/http/TestHTTPSource.java | 4 +-
flume-ng-sources/flume-syslog-source/pom.xml | 3 +-
.../syslog/TestMultiportSyslogTCPSource.java | 4 +-
.../flume/source/syslog/TestSyslogTcpSource.java | 2 +-
flume-ng-sources/flume-taildir-source/pom.xml | 3 +-
.../flume/source/taildir/TestTaildirSource.java | 2 +-
flume-parent/pom.xml | 3 +-
pom.xml | 1 +
20 files changed, 187 insertions(+), 102 deletions(-)
diff --git a/flume-bom/pom.xml b/flume-bom/pom.xml
index 9477ac6d..f65016bd 100644
--- a/flume-bom/pom.xml
+++ b/flume-bom/pom.xml
@@ -103,6 +103,11 @@
<artifactId>flume-ng-sdk</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.flume</groupId>
+ <artifactId>flume-ng-sdk-test</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.flume</groupId>
<artifactId>flume-ng-node</artifactId>
diff --git a/flume-ng-core/pom.xml b/flume-ng-core/pom.xml
index 2f8044fe..42efd81a 100644
--- a/flume-ng-core/pom.xml
+++ b/flume-ng-core/pom.xml
@@ -46,8 +46,7 @@
<dependency>
<groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
- <classifier>tests</classifier>
+ <artifactId>flume-ng-sdk-test</artifactId>
<scope>test</scope>
</dependency>
diff --git
a/flume-ng-core/src/test/java/org/apache/flume/sink/TestRollingFileSink.java
b/flume-ng-core/src/test/java/org/apache/flume/sink/TestRollingFileSink.java
index c419a37b..2d948b53 100644
--- a/flume-ng-core/src/test/java/org/apache/flume/sink/TestRollingFileSink.java
+++ b/flume-ng-core/src/test/java/org/apache/flume/sink/TestRollingFileSink.java
@@ -32,7 +32,7 @@ import org.apache.flume.conf.Configurables;
import org.apache.flume.event.SimpleEvent;
import org.apache.flume.exception.ChannelException;
import org.apache.flume.instrumentation.SinkCounter;
-import org.apache.flume.util.Whitebox;
+import org.apache.flume.sdk.test.Whitebox;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
diff --git a/flume-ng-sources/flume-taildir-source/pom.xml
b/flume-ng-sdk-test/pom.xml
similarity index 59%
copy from flume-ng-sources/flume-taildir-source/pom.xml
copy to flume-ng-sdk-test/pom.xml
index d371c0f3..6e5083d1 100644
--- a/flume-ng-sources/flume-taildir-source/pom.xml
+++ b/flume-ng-sdk-test/pom.xml
@@ -16,45 +16,44 @@
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sources</artifactId>
+ <artifactId>flume-parent</artifactId>
<version>${revision}</version>
+ <relativePath>../flume-parent/pom.xml</relativePath>
</parent>
- <groupId>org.apache.flume.flume-ng-sources</groupId>
- <artifactId>flume-taildir-source</artifactId>
- <name>Flume Taildir Source</name>
+ <artifactId>flume-ng-sdk-test</artifactId>
+ <name>Flume NG SDK Test</name>
+ <description>Test fixtures shared by the Flume modules.
+ The fixtures live in `main`, so that they are packaged in a regular JAR
instead of a test JAR.</description>
<properties>
- <!-- TODO fix spotbugs/pmd violations -->
- <spotbugs.maxAllowedViolations>24</spotbugs.maxAllowedViolations>
- <pmd.maxAllowedViolations>4</pmd.maxAllowedViolations>
- <module.name>org.apache.flume.source.taildir</module.name>
+ <!-- This artifact was never released before -->
+ <bnd.baseline.fail.on.missing>false</bnd.baseline.fail.on.missing>
+ <!-- `TestKeyStores.certificate()` hands out the `X509Certificate` it was
built from, which SpotBugs
+ reports as exposing internal representation. -->
+ <spotbugs.maxAllowedViolations>1</spotbugs.maxAllowedViolations>
+ <module.name>org.apache.flume.sdk.test</module.name>
</properties>
<dependencies>
+
<dependency>
- <groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
- <classifier>tests</classifier>
- <scope>test</scope>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
+
<dependency>
- <groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-core</artifactId>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk18on</artifactId>
</dependency>
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcprov-jdk18on</artifactId>
</dependency>
<dependency>
@@ -63,12 +62,5 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
-
</dependencies>
-
</project>
diff --git
a/flume-ng-sdk/src/test/java/org/apache/flume/util/TestKeyStores.java
b/flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/TestKeyStores.java
similarity index 98%
rename from flume-ng-sdk/src/test/java/org/apache/flume/util/TestKeyStores.java
rename to
flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/TestKeyStores.java
index 7be65002..5b7415c1 100644
--- a/flume-ng-sdk/src/test/java/org/apache/flume/util/TestKeyStores.java
+++
b/flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/TestKeyStores.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.flume.util;
+package org.apache.flume.sdk.test;
import java.io.OutputStream;
import java.nio.file.Files;
diff --git a/flume-ng-sdk/src/test/java/org/apache/flume/util/Whitebox.java
b/flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/Whitebox.java
similarity index 97%
copy from flume-ng-sdk/src/test/java/org/apache/flume/util/Whitebox.java
copy to flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/Whitebox.java
index 995e0ae3..881c0cc2 100644
--- a/flume-ng-sdk/src/test/java/org/apache/flume/util/Whitebox.java
+++ b/flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/Whitebox.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.flume.util;
+package org.apache.flume.sdk.test;
import org.apache.commons.lang3.reflect.FieldUtils;
diff --git
a/flume-ng-sdk/src/test/java/org/apache/flume/util/X509Certificates.java
b/flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/X509Certificates.java
similarity index 99%
rename from
flume-ng-sdk/src/test/java/org/apache/flume/util/X509Certificates.java
rename to
flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/X509Certificates.java
index ac384500..b1ae2f44 100644
--- a/flume-ng-sdk/src/test/java/org/apache/flume/util/X509Certificates.java
+++
b/flume-ng-sdk-test/src/main/java/org/apache/flume/sdk/test/X509Certificates.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.flume.util;
+package org.apache.flume.sdk.test;
import java.math.BigInteger;
import java.security.KeyPair;
diff --git
a/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestSelfSignedKeyStores.java
b/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestSelfSignedKeyStores.java
new file mode 100644
index 00000000..b76fc8a6
--- /dev/null
+++
b/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestSelfSignedKeyStores.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flume.sdk.test;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestSelfSignedKeyStores {
+
+ private static final String PASSWORD = "password";
+
+ @Test
+ public void testKeyStoreHoldsThePrivateKey() throws Exception {
+ TestKeyStores credentials = TestKeyStores.selfSigned("CN=localhost");
+ KeyStore keyStore = credentials.keyStore("JKS", PASSWORD);
+
+ Assert.assertTrue(keyStore.isKeyEntry("key"));
+ Assert.assertEquals(credentials.certificate(),
keyStore.getCertificateChain("key")[0]);
+ Assert.assertNotNull(keyStore.getKey("key", PASSWORD.toCharArray()));
+ }
+
+ @Test
+ public void testTrustStoreHoldsOnlyTheCertificate() throws Exception {
+ TestKeyStores credentials = TestKeyStores.selfSigned("CN=localhost");
+ KeyStore trustStore = credentials.trustStore("JKS");
+
+ Assert.assertFalse(trustStore.isKeyEntry("cert"));
+ Assert.assertEquals(credentials.certificate(),
trustStore.getCertificate("cert"));
+ }
+
+ @Test
+ public void testWrittenKeyStoreCanBeReloaded() throws Exception {
+ TestKeyStores credentials = TestKeyStores.selfSigned("CN=localhost");
+ Path file = Files.createTempFile("keystore", ".jks");
+ try {
+ credentials.writeKeyStore(file, "JKS", PASSWORD);
+
+ KeyStore reloaded = KeyStore.getInstance("JKS");
+ try (InputStream in = Files.newInputStream(file)) {
+ reloaded.load(in, PASSWORD.toCharArray());
+ }
+ X509Certificate certificate = (X509Certificate)
reloaded.getCertificateChain("key")[0];
+ Assert.assertEquals(credentials.certificate(), certificate);
+ } finally {
+ Files.deleteIfExists(file);
+ }
+ }
+}
diff --git a/flume-ng-sdk/src/test/java/org/apache/flume/util/Whitebox.java
b/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestWhitebox.java
similarity index 53%
rename from flume-ng-sdk/src/test/java/org/apache/flume/util/Whitebox.java
rename to
flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestWhitebox.java
index 995e0ae3..16e15d20 100644
--- a/flume-ng-sdk/src/test/java/org/apache/flume/util/Whitebox.java
+++
b/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestWhitebox.java
@@ -14,24 +14,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.flume.util;
+package org.apache.flume.sdk.test;
-import org.apache.commons.lang3.reflect.FieldUtils;
+import org.junit.Assert;
+import org.junit.Test;
-public class Whitebox {
- public static <T> T getInternalState(Object target, String fieldName) {
- try {
- return (T) FieldUtils.readField(target, fieldName, true);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException("Unable to access field " + fieldName,
ex);
- }
+public class TestWhitebox {
+
+ private static final class Target {
+ private String value = "initial";
+ }
+
+ @Test
+ public void testGetInternalState() {
+ Assert.assertEquals("initial", Whitebox.getInternalState(new Target(),
"value"));
+ }
+
+ @Test
+ public void testSetInternalState() {
+ Target target = new Target();
+ Whitebox.setInternalState(target, "value", "replaced");
+ Assert.assertEquals("replaced", target.value);
}
- public static void setInternalState(Object target, String field, Object
value) {
- try {
- FieldUtils.writeField(target, field, value, true);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException("Unable to access field " + field, ex);
- }
+ @Test(expected = RuntimeException.class)
+ public void testUnknownFieldFails() {
+ Whitebox.getInternalState(new Target(), "missing");
}
}
diff --git
a/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestX509Certificates.java
b/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestX509Certificates.java
new file mode 100644
index 00000000..ea31fabe
--- /dev/null
+++
b/flume-ng-sdk-test/src/test/java/org/apache/flume/sdk/test/TestX509Certificates.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flume.sdk.test;
+
+import java.security.KeyPair;
+import java.security.cert.X509Certificate;
+import java.util.Collections;
+import java.util.Date;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestX509Certificates {
+
+ @Test
+ public void testSelfSignedCertificate() throws Exception {
+ KeyPair keyPair = X509Certificates.generateKeyPair();
+ X509Certificate certificate =
X509Certificates.generateSelfSignedCertificate(keyPair, "CN=localhost");
+
+ Assert.assertEquals(
+ "CN=localhost",
certificate.getSubjectX500Principal().getName());
+ Assert.assertEquals(certificate.getSubjectX500Principal(),
certificate.getIssuerX500Principal());
+ // A self-signed certificate verifies against its own public key.
+ certificate.verify(keyPair.getPublic());
+ certificate.checkValidity(new Date());
+ }
+
+ @Test
+ public void testServerCertificateExtensions() throws Exception {
+ KeyPair keyPair = X509Certificates.generateKeyPair();
+ X509Certificate certificate =
X509Certificates.generateSelfSignedCertificate(keyPair, "CN=localhost");
+
+ // A negative path length constraint marks a certificate that is not a
CA.
+ Assert.assertEquals(-1, certificate.getBasicConstraints());
+ Assert.assertEquals(Collections.singletonList("1.3.6.1.5.5.7.3.1"),
certificate.getExtendedKeyUsage());
+ }
+
+ @Test
+ public void testKeyPairsAreDistinct() {
+ Assert.assertNotEquals(
+ X509Certificates.generateKeyPair().getPrivate(),
+ X509Certificates.generateKeyPair().getPrivate());
+ }
+}
diff --git a/flume-ng-sdk/pom.xml b/flume-ng-sdk/pom.xml
index c5b1d20d..afc5fc81 100644
--- a/flume-ng-sdk/pom.xml
+++ b/flume-ng-sdk/pom.xml
@@ -44,19 +44,6 @@
<scope>test</scope>
</dependency>
- <!-- Used by the shared X509Certificates test helper (packaged in the
test-jar). -->
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-jdk18on</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk18on</artifactId>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
@@ -82,32 +69,6 @@
<build>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- <configuration>
- <!-- BND describes the main classes in a single manifest per
module, which `logging-parent`
- feeds to every execution. Drop it here: the test JAR is not
that bundle, and its
- Package URL needs the qualifiers of a classified artifact.
-->
- <archive combine.self="override">
- <manifest>
-
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
-
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- </manifest>
- <manifestEntries>
-
<Purl>pkg:maven/${project.groupId}/${project.artifactId}@${project.version}?classifier=tests&type=test-jar</Purl>
- </manifestEntries>
- </archive>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
diff --git a/flume-ng-sources/flume-http-source/pom.xml
b/flume-ng-sources/flume-http-source/pom.xml
index d7f2b585..d3def5ee 100644
--- a/flume-ng-sources/flume-http-source/pom.xml
+++ b/flume-ng-sources/flume-http-source/pom.xml
@@ -45,8 +45,7 @@
</dependency>
<dependency>
<groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
- <classifier>tests</classifier>
+ <artifactId>flume-ng-sdk-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git
a/flume-ng-sources/flume-http-source/src/test/java/org/apache/flume/source/http/TestHTTPSource.java
b/flume-ng-sources/flume-http-source/src/test/java/org/apache/flume/source/http/TestHTTPSource.java
index 8aa5ea2e..4b182805 100644
---
a/flume-ng-sources/flume-http-source/src/test/java/org/apache/flume/source/http/TestHTTPSource.java
+++
b/flume-ng-sources/flume-http-source/src/test/java/org/apache/flume/source/http/TestHTTPSource.java
@@ -63,8 +63,8 @@ import org.apache.flume.channel.ReplicatingChannelSelector;
import org.apache.flume.conf.Configurables;
import org.apache.flume.event.JSONEvent;
import org.apache.flume.instrumentation.SourceCounter;
-import org.apache.flume.util.TestKeyStores;
-import org.apache.flume.util.Whitebox;
+import org.apache.flume.sdk.test.TestKeyStores;
+import org.apache.flume.sdk.test.Whitebox;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpOptions;
diff --git a/flume-ng-sources/flume-syslog-source/pom.xml
b/flume-ng-sources/flume-syslog-source/pom.xml
index 1f0beb2f..50ef7a20 100644
--- a/flume-ng-sources/flume-syslog-source/pom.xml
+++ b/flume-ng-sources/flume-syslog-source/pom.xml
@@ -49,8 +49,7 @@
</dependency>
<dependency>
<groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
- <classifier>tests</classifier>
+ <artifactId>flume-ng-sdk-test</artifactId>
<scope>test</scope>
</dependency>
diff --git
a/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestMultiportSyslogTCPSource.java
b/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestMultiportSyslogTCPSource.java
index 4976e135..af739b58 100644
---
a/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestMultiportSyslogTCPSource.java
+++
b/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestMultiportSyslogTCPSource.java
@@ -62,12 +62,12 @@ import org.apache.flume.channel.ReplicatingChannelSelector;
import org.apache.flume.conf.Configurables;
import org.apache.flume.exception.ChannelException;
import org.apache.flume.instrumentation.SourceCounter;
+import org.apache.flume.sdk.test.TestKeyStores;
+import org.apache.flume.sdk.test.Whitebox;
import org.apache.flume.source.syslog.MultiportSyslogTCPSource.LineSplitter;
import
org.apache.flume.source.syslog.MultiportSyslogTCPSource.MultiportSyslogHandler;
import org.apache.flume.source.syslog.MultiportSyslogTCPSource.ParsedBuffer;
import
org.apache.flume.source.syslog.MultiportSyslogTCPSource.ThreadSafeDecoder;
-import org.apache.flume.util.TestKeyStores;
-import org.apache.flume.util.Whitebox;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.mina.core.buffer.IoBuffer;
diff --git
a/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestSyslogTcpSource.java
b/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestSyslogTcpSource.java
index d6cf09a4..a4eb816f 100644
---
a/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestSyslogTcpSource.java
+++
b/flume-ng-sources/flume-syslog-source/src/test/java/org/apache/flume/source/syslog/TestSyslogTcpSource.java
@@ -50,7 +50,7 @@ import org.apache.flume.channel.MemoryChannel;
import org.apache.flume.channel.ReplicatingChannelSelector;
import org.apache.flume.conf.Configurables;
import org.apache.flume.exception.ChannelException;
-import org.apache.flume.util.TestKeyStores;
+import org.apache.flume.sdk.test.TestKeyStores;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Assert;
diff --git a/flume-ng-sources/flume-taildir-source/pom.xml
b/flume-ng-sources/flume-taildir-source/pom.xml
index d371c0f3..2444b0f8 100644
--- a/flume-ng-sources/flume-taildir-source/pom.xml
+++ b/flume-ng-sources/flume-taildir-source/pom.xml
@@ -43,8 +43,7 @@
</dependency>
<dependency>
<groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
- <classifier>tests</classifier>
+ <artifactId>flume-ng-sdk-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git
a/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirSource.java
b/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirSource.java
index 4c8ec6a6..ff4bb18f 100644
---
a/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirSource.java
+++
b/flume-ng-sources/flume-taildir-source/src/test/java/org/apache/flume/source/taildir/TestTaildirSource.java
@@ -57,7 +57,7 @@ import org.apache.flume.conf.Configurables;
import org.apache.flume.exception.ChannelException;
import org.apache.flume.lifecycle.LifecycleController;
import org.apache.flume.lifecycle.LifecycleState;
-import org.apache.flume.util.Whitebox;
+import org.apache.flume.sdk.test.Whitebox;
import org.junit.After;
import org.junit.Assume;
import org.junit.Before;
diff --git a/flume-parent/pom.xml b/flume-parent/pom.xml
index 8036ba0a..03005e9c 100644
--- a/flume-parent/pom.xml
+++ b/flume-parent/pom.xml
@@ -213,9 +213,8 @@
<dependency>
<groupId>org.apache.flume</groupId>
- <artifactId>flume-ng-sdk</artifactId>
+ <artifactId>flume-ng-sdk-test</artifactId>
<version>${flume-project.version}</version>
- <classifier>tests</classifier>
<scope>test</scope>
</dependency>
diff --git a/pom.xml b/pom.xml
index 061bef42..019f9ad8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -70,6 +70,7 @@
-->
<module>flume-ng-channels</module>
<module>flume-ng-sdk</module>
+ <module>flume-ng-sdk-test</module>
<!-- Temporarily disable integration tests
<module>flume-ng-tests</module>
-->