You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrade build to Java 11 with JUnit 5 and add GitHub Actions CI/CD
- Upgrade Java target from 6 to 11 (jDisco remains at Java 6)
- Migrate tests from JUnit 3.8.2 to JUnit 5.10.1 with AssertJ 3.24.2
- Reorganize tests to Maven-style package structure
- Add GitHub Actions workflow for automated build, test, and artifact
deployment
- Update Dockerfile to use Java 11 for build and runtime
- Configure Ivy for JUnit Jupiter API, Engine, and Platform
- Update build.xml with junitlauncher task for JUnit 5 support
- Add CI/CD badge and documentation to CLAUDE.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+66-20Lines changed: 66 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,18 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
7
7
Railway Interlocking Simulator - A BSc thesis project (2006/2007) from Brno University of Technology that simulates railway interlocking systems with a graphical editor and discrete event simulation engine.
8
8
9
+
[](https://github.com/bedavs/interlockSim/actions/workflows/ant-java11.yml)
10
+
9
11
## Build System
10
12
11
-
This project uses Apache Ant for building with Apache Ivy for dependency management. Java 6 is required (`javac 1.6`).
13
+
This project uses Apache Ant for building with Apache Ivy for dependency management. Java 11 is required (`javac 11`). The jDisco library module remains at Java 6 for compatibility.
-**JUnit 5.10.1** - Testing framework (JUnit Jupiter API and Engine)
20
+
-**AssertJ 3.24.2** - Fluent assertion library for better test readability
18
21
19
22
Ivy automatically downloads dependencies during the build. Configuration files:
20
23
-`ivy.xml` - Dependency declarations
@@ -103,7 +106,7 @@ java -ea -cp "build/main:lib/compile/*" cz.vutbr.fit.interlockSim.Main example
103
106
104
107
**Dockerization: 2025** - Complete containerized build and runtime environment with no host dependencies.
105
108
106
-
The project includes Docker support for both the Java application and LaTeX thesis compilation. This eliminates the need to install Java 6, Ant, or LaTeX tools on the host machine.
109
+
The project includes Docker support for both the Java application and LaTeX thesis compilation. This eliminates the need to install Java 11, Ant, or LaTeX tools on the host machine.
107
110
108
111
### Prerequisites
109
112
@@ -164,10 +167,10 @@ docker compose build app
164
167
165
168
**Root Dockerfile (multi-stage build):**
166
169
1.**Builder stage** - Uses Debian Buster with OpenJDK 11, Maven, and Ant
1.**Do not touch Java code unless explicitly requested** - Do not refactor, optimize, or "improve" code that is working
305
311
2.**Tests must exist before modifications** - Any Java source file being modified MUST be covered by tests first. If tests don't exist, they must be written before making any changes
306
312
3.**Minimal changes only** - Make only the specific changes requested, nothing more
307
-
4.**No unsolicited modernization** - Do not update Java 6 idioms to modern Java, do not add new language features, do not restructure working code
313
+
4.**No unsolicited modernization** - While the project now uses Java 11, do not update Java idioms to modern features, do not add new language features, do not restructure working code
314
+
5.**jDisco preservation** - The jDisco module must remain at Java 6 compatibility and should never be modified
308
315
309
316
This is a working historical codebase from 2007. Stability and preservation are more important than modernization.
310
317
311
318
## Testing
312
319
313
-
JUnit 3.8.2 tests located in `src/test/java/cz/vutbr/fit/interlockSim/test/`. JUnit is managed via Apache Ivy.
320
+
JUnit 5.10.1 tests with AssertJ assertions located in `src/test/java/cz/vutbr/fit/interlockSim/`. All dependencies are managed via Apache Ivy.
321
+
322
+
**Test framework:**
323
+
- JUnit 5 (Jupiter API and Engine)
324
+
- JUnit Platform for Ant integration
325
+
- AssertJ 3.24.2 for fluent assertions
314
326
315
327
**Current tests:**
316
-
-`TestArray2DMap` - 10 tests for 2D array-based map implementation
317
-
-`TestCell` - 2 tests for cell segment and direction logic
318
-
-`TestContext` - 4 tests for railway network context operations
328
+
-`Array2DMapTest` - 10 tests for 2D array-based map implementation
329
+
-`CellTest` - 2 tests for cell segment and direction logic
330
+
-`ContextTest` - 4 tests for railway network context operations
319
331
320
332
**Run tests:**
321
333
```bash
@@ -324,7 +336,41 @@ ant test
324
336
ant build
325
337
```
326
338
327
-
Tests are automatically executed during the build process. The build will fail if any test fails (`haltonfailure="yes"`).
339
+
Tests are automatically executed during the build process using Ant's `junitlauncher` task. The build will fail if any test fails (`haltonfailure="yes"`).
340
+
341
+
**Note:** Ant 1.10.6+ is required for JUnit 5 support via the `junitlauncher` task.
342
+
343
+
## Continuous Integration
344
+
345
+
The project uses GitHub Actions for automated build, test, and deployment workflows.
346
+
347
+
**Workflow:**`.github/workflows/ant-java11.yml`
348
+
349
+
**Features:**
350
+
- Builds jDisco library with Java 6 compatibility
351
+
- Compiles main project with Java 11
352
+
- Runs all tests with JUnit 5
353
+
- Packages application JAR
354
+
- Uploads JAR as artifact (90-day retention)
355
+
- Smoke test execution
356
+
- Dependency caching (Maven and Ivy) for faster builds
357
+
358
+
**Triggers:**
359
+
- Push to `main`, `develop`, `feature/**`, `fix/**` branches
360
+
- Pull requests to `main` and `develop`
361
+
- Manual workflow dispatch
362
+
363
+
**Build environment:**
364
+
- Ubuntu latest
365
+
- Java 11 (Temurin distribution)
366
+
- 15-minute timeout
367
+
- Concurrency control (cancels outdated builds)
368
+
369
+
**Performance:**
370
+
- First build (cold cache): ~3-5 minutes
371
+
- Subsequent builds (warm cache): ~30-60 seconds
372
+
373
+
View build status and artifacts at: [GitHub Actions](https://github.com/bedavs/interlockSim/actions)
0 commit comments