Add simulated parking capacity and Jenkins CI (refs #9)
smartpark-app-ci/pipeline/pr-main This commit looks good
smartpark-app-ci/pipeline/pr-main This commit looks good
This commit is contained in:
@@ -54,4 +54,32 @@ EV Charging: Available
|
||||
|
||||
The SmartPark application itself and live Stevens campus parking data are not currently deployed.
|
||||
|
||||
The team's currently deployed operational work hub is Gitea, which is being used for source control, issues, pull requests, reviews, and project history.
|
||||
The team's currently deployed operational work hub is Gitea, which is being used for source control, issues, pull requests, reviews, and project history.
|
||||
|
||||
## Simulated parking-capacity core
|
||||
|
||||
`ParkingLot` is a small, in-memory Java 21 component for the proposed SmartPark
|
||||
application. It records a lot name, total capacity, and available spaces.
|
||||
`vehicleEnters()` decreases availability; `vehicleLeaves()` increases it. The
|
||||
component rejects counts outside the range from zero to capacity and prevents
|
||||
arrivals at a full lot or departures from an empty lot. It does not fetch live
|
||||
campus data, save state, or expose a web interface.
|
||||
|
||||
The repository's `Jenkinsfile` compiles this component with all Java compiler
|
||||
warnings treated as errors, then runs automated boundary and transition tests.
|
||||
The only build dependency is JDK 21, already present in the selected Jenkins
|
||||
image. A clean local run from the repository root is:
|
||||
|
||||
```bash
|
||||
mkdir -p build/classes
|
||||
javac -Xlint:all -Werror -d build/classes \
|
||||
src/main/java/edu/stevens/smartpark/ParkingLot.java \
|
||||
src/test/java/edu/stevens/smartpark/ParkingLotTest.java
|
||||
java -cp build/classes edu.stevens.smartpark.ParkingLotTest
|
||||
```
|
||||
|
||||
Expected test output is `ParkingLot tests passed`. A nonzero exit status means
|
||||
the compile or test step failed. The generated `build/` directory is ignored by
|
||||
Git. The Jenkins pipeline is intended for trusted team changes only; it runs
|
||||
on the Jenkins controller because this small assignment deployment has no
|
||||
separate build agent.
|
||||
|
||||
Reference in New Issue
Block a user