Skip to content

Modernize test infrastructure: JUnit 4 migration and Maven structure#214

Merged
mimno merged 6 commits intomasterfrom
raghu298-feature/replace-bsh-with-jshell
Dec 29, 2025
Merged

Modernize test infrastructure: JUnit 4 migration and Maven structure#214
mimno merged 6 commits intomasterfrom
raghu298-feature/replace-bsh-with-jshell

Conversation

@mimno
Copy link
Owner

@mimno mimno commented Dec 29, 2025

Summary

  • Remove BeanShell dependency and replace with JShell for Java 17+ compatibility
  • Modernize project to standard Maven directory structure (src/main/java, src/test/java)
  • Migrate all 57 tests from JUnit 3 to JUnit 4 style with @Test annotations
  • Add comprehensive documentation (TESTING.md, updated README.md)
  • Update .gitignore for Maven project structure

Changes

Build System

  • Standard Maven directory structure (src/main/java, src/test/java)
  • All tests now in src/test/java/cc/mallet/{module}/ (same package as production code)
  • JUnit 4.13.2 via Maven dependency

Test Migration (JUnit 3 → JUnit 4)

  • Removed extends TestCase from all test classes
  • Removed JUnit 3 boilerplate (suite(), main(), constructors)
  • Added @Test annotations to all test methods
  • Added @Before annotations where setUp() methods exist
  • Updated imports to org.junit.* and static assertions

Documentation

  • Created TESTING.md with comprehensive testing guide
  • Updated README.md with Maven build instructions
  • Updated .gitignore for Maven project structure

Test plan

  • Run full test suite: mvn clean test (194 tests pass)
  • Generate coverage report: mvn jacoco:report (16% instruction coverage)
  • Verify all test files migrated to JUnit 4 style
  • Verify standard Maven directory structure

🤖 Generated with Claude Code

raghu298 and others added 6 commits November 18, 2025 16:31
Phase 1 of test infrastructure modernization:

- Move production code from src/cc/ to src/main/java/cc/
- Move test code to src/test/java/ with updated package names
- Move test resources to src/test/resources/
- Update pom.xml for new directory structure
- Update CI/CD to use Java 17 with test artifact collection
- Remove Ant build (build.xml) and bundled JUnit jars
- Remove unused test imports from production code
- Disable parallel test execution (some tests capture System.out)

All 195 tests pass.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Migrate 57 test files from JUnit 3 to JUnit 4 style:
  - Remove TestCase inheritance and JUnit 3 boilerplate
  - Add @test annotations to all test methods
  - Add @before annotations where setUp() methods exist
  - Update imports to use org.junit.* and static assertions
- Create TESTING.md with comprehensive testing guide
- Update README.md with Maven build instructions
- Update .gitignore for Maven project structure

All 194 tests pass after migration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mimno mimno merged commit 2d9095d into master Dec 29, 2025
1 check failed
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