This module contains comprehensive tests for the Java Analyzer Bundle, an Eclipse JDT.LS extension that provides Java code analysis capabilities for Konveyor/MTA.
# From repository root
make ci # Full CI pipeline (Phase 1 + Phase 2)
make phase1 # Maven unit tests only
make phase2 # Integration tests only# Maven unit tests (48 tests)
mvn clean integration-test
# Go integration tests (specific test)
cd integration
go test -v -run TestInheritanceSearchThis module contains two phases of testing:
Location: src/main/java/
Technology: JUnit-Plugin (runs in Eclipse environment)
Count: 48 tests
Tests command handling, parameter parsing, and error cases:
RuleEntryParamsTest(14 tests)AnnotationQueryTest(18 tests)SampleDelegateCommandHandlerTest(16 tests)
Run: mvn clean integration-test
Location: integration/
Technology: Go with real JDT.LS server
Count: 18 test functions covering 15 location types + Priority 1 features
Tests actual search results against real Java codebases:
- Real JDT.LS server with analyzer plugin
- Actual workspace with test projects
- Symbol result verification
- Migration pattern testing
- Advanced features: annotated element matching, file path filtering
Run: make phase2 or cd integration && go test -v
✨ New in 2025-10-28: Priority 1 advanced features
- Annotated element matching: 4 tests for searching annotations with specific attribute values
- File path filtering: 2 tests for restricting searches to specific directories
Location: projects/
Two test projects provide Java code for integration testing:
Systematic patterns for all 15 location types + advanced features:
- Inheritance, method calls, constructors
- Annotations, imports, type references
- Enums, fields, variables, return types
- Advanced: Annotated element matching (JMS, JPA, DataSource configs)
- Advanced: File path filtering (mixed JPA/JDBC anti-patterns)
Real-world Spring MVC application:
- JPA entities with
javax.persistence.*(migration target) - Spring components (
@Service,@Autowired) - Repository patterns, REST controllers
- JBoss Logging (potential migration target)
Location: docs/
📖 Documentation Index - Start here!
- Integration Tests Guide - Architecture, running tests, troubleshooting
- Query Reference - All search queries and patterns tested
- Quick Reference - Coverage summary and test commands
- Test Projects - Java test project details
| Location | Type | Status |
|---|---|---|
| 0 | Default (all locations) | ✅ |
| 1 | Inheritance | ✅ |
| 2 | Method Calls | ✅ |
| 3 | Constructors | ✅ |
| 4 | Annotations | ✅ |
| 5 | Implements | ✅ |
| 6 | Enum Constants | ✅ |
| 7 | Return Types | ✅ |
| 8 | Imports | ✅ |
| 9 | Variable Declarations | ✅ |
| 10 | Type References | ✅ |
| 11 | Package Declarations | ✅ |
| 12 | Field Declarations | ✅ |
| 13 | Method Declarations | ✅ |
| 14 | Class Declarations | ✅ |
🎉 COMPLETE COVERAGE ACHIEVED!
See: Quick Reference for details
- Java 17 - Target platform and tests
- Eclipse Tycho 3.0.1 - Build system
- JDT.LS 1.35.0 - Language server
- Go 1.21+ - Integration test framework
- Podman/Docker - Container runtime for CI/CD
- JUnit 4 - Unit test framework
java-analyzer-bundle.test/
├── README.md # This file
├── docs/ # 📖 Documentation
│ ├── README.md # Documentation index
│ ├── integration-tests.md # Integration test guide
│ ├── query-reference.md # Search query catalog
│ ├── quick-reference.md # Quick reference
│ └── test-projects.md # Test projects overview
│
├── src/main/java/ # Phase 1: Maven/JUnit unit tests
│ └── io/konveyor/tackle/...
│
├── integration/ # Phase 2: Go integration tests
│ ├── client/ # JDT.LS LSP client
│ ├── integration_test.go # Test functions
│ ├── test_helpers.go # Verification helpers
│ ├── go.mod # Go dependencies
│ └── run_local.sh # Local test runner
│
└── projects/ # Java test projects
├── test-project/ # Systematic patterns
└── customers-tomcat-legacy/ # Real-world migration
Packaging: eclipse-test-plugin
Parent: java-analyzer-bundle (root pom.xml)
Test Execution:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
</configuration>
</plugin>GitHub Actions: .github/workflows/integration-tests.yml
Two-Phase Execution:
- Phase 1: Maven unit tests (
mvn clean integration-test) - Phase 2: Build container → Go integration tests
Triggers:
- Push to
mainormaven-indexbranches - Pull requests to
main
Local Verification:
make ci # Runs same steps as GitHub Actions- Create test class in
src/main/java/ - Extend appropriate test base
- Use
@Testannotation - Run:
mvn clean integration-test
- Add test function to
integration/integration_test.go - Use
jdtlsClient.SearchSymbols()for queries - Verify results with helper functions
- Run:
go test -v -run TestYourTest
mvn clean verify
# Coverage report: target/site/jacoco/index.htmlcd integration
export JDTLS_PATH=/path/to/jdtls
export WORKSPACE_DIR=/path/to/projects
go test -v -run TestSpecificTest# From repository root
podman build -t jdtls-analyzer:test .The integration tests verify detection of common migration patterns:
// Find javax.persistence imports (location 8)
symbols, _ := client.SearchSymbols("customers-tomcat",
"javax.persistence.Entity", 8, "source-only", nil)
// Flags files needing jakarta migration// Find @Service annotations (location 4)
symbols, _ := client.SearchSymbols("customers-tomcat",
"org.springframework.stereotype.Service", 4, "source-only", nil)See: Query Reference
- Main Project README - Core analyzer architecture
- CLAUDE.md - Development guidance
- Integration Tests - Detailed test documentation
- Konveyor Analyzer LSP - LSP protocol implementation
- JDT.LS - Eclipse Java language server
For issues or questions:
- Check Integration Tests Guide
- Review Test Projects
- See main project documentation
Module: java-analyzer-bundle.test
Type: Eclipse Test Plugin
Java Version: 17
Test Framework: JUnit 4 (unit) + Go (integration)