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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions java-analyzer-bundle.test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ make phase2 # Integration tests only
### Run Specific Tests

```bash
# Maven unit tests (48 tests)
# Maven unit tests (76 tests)
mvn clean integration-test

# Go integration tests (specific test)
Expand All @@ -31,12 +31,17 @@ This module contains two phases of testing:
### Phase 1: Unit Tests (Maven/JUnit)
**Location**: `src/main/java/`
**Technology**: JUnit-Plugin (runs in Eclipse environment)
**Count**: 48 tests
**Count**: 76 tests

Tests command handling, parameter parsing, and error cases:
Tests command handling, parameter parsing, AST visitors, symbol providers, and error cases:
- `RuleEntryParamsTest` (14 tests)
- `AnnotationQueryTest` (18 tests)
- `SampleDelegateCommandHandlerTest` (16 tests)
- `CustomASTVisitorTest` (16 tests)
- `MethodDeclarationSymbolProviderTest` (8 tests)
- `CommandHandlerTest` (2 tests)
- `JavaAnnotationTest` (1 test)
- `PomDependencyTest` (1 test)

**Run**: `mvn clean integration-test`

Expand Down Expand Up @@ -132,7 +137,7 @@ Real-world Spring MVC application:

- **Java 17** - Target platform and tests
- **Eclipse Tycho 3.0.1** - Build system
- **JDT.LS 1.35.0** - Language server
- **JDT.LS 1.51.0** - Language server
- **Go 1.21+** - Integration test framework
- **Podman/Docker** - Container runtime for CI/CD
- **JUnit 4** - Unit test framework
Expand Down Expand Up @@ -179,7 +184,7 @@ java-analyzer-bundle.test/
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useUIHarness>true</useUIHarness>
<useUIHarness>false</useUIHarness>
<useUIThread>false</useUIThread>
</configuration>
</plugin>
Expand All @@ -193,7 +198,12 @@ java-analyzer-bundle.test/

**Two-Phase Execution**:
1. **Phase 1**: Maven unit tests (`mvn clean integration-test`)
2. **Phase 2**: Build container → Go integration tests
2. **Phase 2**: Build self-contained container (default `Dockerfile`) → Go integration tests

**Container Images**:
- **CI** uses the default `Dockerfile` which builds the plugin JAR from source inside the container
- **Local** (`make phase2`) uses `Dockerfile.test` which expects a pre-built JAR on the host
- Both produce equivalent images with JDT.LS + the analyzer plugin

**Triggers**:
- Push to `main` or `maven-index` branches
Expand Down Expand Up @@ -242,8 +252,9 @@ go test -v -run TestSpecificTest

### Build Test Container
```bash
# From repository root
podman build -t jdtls-analyzer:test .
# From repository root (requires pre-built JAR via mvn install)
mvn clean install -DskipTests
podman build -t jdtls-analyzer:test -f Dockerfile.test .
```

---
Expand Down
17 changes: 11 additions & 6 deletions java-analyzer-bundle.test/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,20 @@ Detailed overview of the Java test projects:

## 🧪 Test Structure

### Phase 1: Maven Unit Tests (48 tests)
### Phase 1: Maven Unit Tests (76 tests)
**Location**: `../src/main/java/`
**Framework**: JUnit-Plugin
**Coverage**: Command handling, parameter parsing, error cases
**Coverage**: Command handling, parameter parsing, AST visitors, symbol providers, error cases

**Tests**:
- `RuleEntryParamsTest` (14 tests)
- `AnnotationQueryTest` (18 tests)
- `SampleDelegateCommandHandlerTest` (16 tests)
- `CustomASTVisitorTest` (16 tests)
- `MethodDeclarationSymbolProviderTest` (8 tests)
- `CommandHandlerTest` (2 tests)
- `JavaAnnotationTest` (1 test)
- `PomDependencyTest` (1 test)

**Run**: `mvn clean integration-test`

Expand Down Expand Up @@ -171,8 +176,8 @@ Detailed overview of the Java test projects:
## 🏗️ Test Projects

### test-project
**Purpose**: Systematic coverage of all location types
**Files**: 8 Java files covering all 15 location types
**Purpose**: Systematic coverage of all location types + advanced features
**Files**: 19 Java files covering all 15 location types
**Key**: `SampleApplication.java` - main test file with comprehensive patterns

### customers-tomcat-legacy
Expand Down Expand Up @@ -200,8 +205,8 @@ make phase2
cd ../integration
go test -v -run TestInheritanceSearch

# Build test container
podman build -t jdtls-analyzer:test ..
# Build test container (run from repository root, requires pre-built JAR via mvn install)
cd ../.. && podman build -t jdtls-analyzer:test -f Dockerfile.test .

# Run tests in container
cd ../integration
Expand Down
Loading
Loading