Skip to content

Port Clojure tests to Java: versioned_store_test and tuple_test#8443

Merged
jnioche merged 2 commits into
masterfrom
port/clojure-tests-phase1
Mar 30, 2026
Merged

Port Clojure tests to Java: versioned_store_test and tuple_test#8443
jnioche merged 2 commits into
masterfrom
port/clojure-tests-phase1

Conversation

@jnioche
Copy link
Copy Markdown
Contributor

@jnioche jnioche commented Mar 28, 2026

Context

See #8445

Storm was originally written in Clojure. The core was rewritten in Java, but ~5,000 lines of Clojure integration tests remain in storm-core/test/clj/ (107 test functions across 13 files). These are the main reason the Clojure dependency (1.12.4, carbonite, tools.logging, clojure-maven-plugin, shade transformer) is still in the build. Porting them to Java enables full removal of the Clojure stack.

The Java testing infrastructure is already mature: Testing.java provides 33 public methods (completeTopology, readTuples, multiseteq, withSimulatedTime, etc.), and JUnit 5, Mockito 5.14, and Awaitility 4.3 are all available. 48 Java test files already exist under storm-server/src/test/.

Summary

First phase of porting Clojure tests to Java to enable eventual removal of the
Clojure dependency. Ports 8 test functions from 2 Clojure files to Java/JUnit 5.

Changes

Clojure source Java target Tests
storm-core/test/clj/org/apache/storm/versioned_store_test.clj storm-core/test/jvm/org/apache/storm/utils/VersionedStoreTest.java 2
storm-core/test/clj/org/apache/storm/trident/tuple_test.clj storm-core/test/jvm/org/apache/storm/trident/TridentTupleViewTest.java 6

Not ported: serialization_test.clj (1 test) — only tests Clojure-specific data
types (keywords, sets, maps) that won't exist after Clojure removal. The existing
Java SerializationTest already covers Java type roundtrips.

Context

This is Phase 1 of an 8-phase plan to port all ~107 Clojure test functions to Java,
enabling full removal of the storm-clojure, storm-clojure-test modules and the
Clojure build dependency. The Clojure test files are not deleted yet — that happens
in the final cleanup phase after all tests are ported.

Test plan

  • mvn test -pl storm-core -Dtest="VersionedStoreTest,TridentTupleViewTest" — 8 tests, all pass

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread storm-core/test/jvm/org/apache/storm/utils/VersionedStoreTest.java Outdated
@jnioche jnioche added this to the 3.0.0 milestone Mar 28, 2026
VersionedStore.createVersion() already handles same-millisecond
collisions by incrementing the version number, so no sleep is needed
between version creations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jnioche jnioche merged commit 771dd4d into master Mar 30, 2026
10 checks passed
@jnioche jnioche deleted the port/clojure-tests-phase1 branch March 30, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants