Fix mock tests

This commit is contained in:
Tour
2025-12-04 04:30:44 +01:00
parent e71d52be8a
commit 9857f053a1
41 changed files with 35 additions and 79 deletions

20
script/check-status.bat Normal file
View File

@@ -0,0 +1,20 @@
@echo off
REM ============================================================================
REM Troostwijk Auction Monitor - Status Check (Windows)
REM ============================================================================
REM
REM This script shows the current status and exits.
REM
REM Usage:
REM check-status.bat
REM
REM ============================================================================
REM Set configuration
set DATABASE_FILE=C:\mnt\okcomputer\output\cache.db
set NOTIFICATION_CONFIG=desktop
REM Check status
java -jar target\auctiora-1.0-SNAPSHOT-jar-with-dependencies.jar status
pause

27
script/run-once.bat Normal file
View File

@@ -0,0 +1,27 @@
@echo off
REM ============================================================================
REM Troostwijk Auction Monitor - Run Once (Windows)
REM ============================================================================
REM
REM This script runs the complete workflow once and exits.
REM Perfect for Windows Task Scheduler.
REM
REM Usage:
REM run-once.bat
REM
REM Schedule in Task Scheduler:
REM - Every 30 minutes: Data import
REM - Every 1 hour: Image processing
REM - Every 15 minutes: Bid monitoring
REM
REM ============================================================================
REM Set configuration
set DATABASE_FILE=C:\mnt\okcomputer\output\cache.db
set NOTIFICATION_CONFIG=desktop
REM Run the application once
java -jar target\troostwijk-scraper-1.0-SNAPSHOT-jar-with-dependencies.jar once
REM Exit code for Task Scheduler
exit /b %ERRORLEVEL%

27
script/run-workflow.bat Normal file
View File

@@ -0,0 +1,27 @@
@echo off
REM ============================================================================
REM Troostwijk Auction Monitor - Workflow Runner (Windows)
REM ============================================================================
REM
REM This script runs the auction monitor in workflow mode (continuous operation)
REM with all scheduled tasks running automatically.
REM
REM Usage:
REM run-workflow.bat
REM
REM ============================================================================
echo Starting Troostwijk Auction Monitor - Workflow Mode...
echo.
REM Set configuration
set DATABASE_FILE=C:\mnt\okcomputer\output\cache.db
set NOTIFICATION_CONFIG=desktop
REM Optional: Set for email notifications
REM set NOTIFICATION_CONFIG=smtp:your@gmail.com:app_password:your@gmail.com
REM Run the application
java -jar target\auctiora-1.0-SNAPSHOT-jar-with-dependencies.jar workflow
pause

View File

@@ -0,0 +1,71 @@
# ============================================================================
# Troostwijk Auction Monitor - Windows Task Scheduler Setup
# ============================================================================
#
# This PowerShell script creates scheduled tasks in Windows Task Scheduler
# to run the auction monitor automatically.
#
# Usage:
# Run PowerShell as Administrator, then:
# .\setup-windows-task.ps1
#
# ============================================================================
Write-Host "=== Auctiora Monitor - Task Scheduler Setup ===" -ForegroundColor Cyan
Write-Host ""
# Configuration
$scriptPath = $PSScriptRoot
$jarPath = Join-Path $scriptPath "target\auctiora-1.0-SNAPSHOT-jar-with-dependencies.jar"
$javaExe = "java"
# Check if JAR exists
if (-not (Test-Path $jarPath)) {
Write-Host "ERROR: JAR file not found at: $jarPath" -ForegroundColor Red
Write-Host "Please run 'mvn clean package' first." -ForegroundColor Yellow
exit 1
}
Write-Host "Creating scheduled tasks..." -ForegroundColor Green
Write-Host ""
# Task 1: Complete Workflow - Every 30 minutes
$task1Name = "TroostwijkMonitor-Workflow"
$task1Description = "Runs complete auction monitoring workflow every 30 minutes"
$task1Action = New-ScheduledTaskAction -Execute $javaExe -Argument "-jar `"$jarPath`" once" -WorkingDirectory $scriptPath
$task1Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 30) -RepetitionDuration ([TimeSpan]::MaxValue)
$task1Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable
try {
Register-ScheduledTask -TaskName $task1Name -Action $task1Action -Trigger $task1Trigger -Settings $task1Settings -Description $task1Description -Force
Write-Host "[✓] Created task: $task1Name (every 30 min)" -ForegroundColor Green
} catch {
Write-Host "[✗] Failed to create task: $task1Name" -ForegroundColor Red
Write-Host " Error: $_" -ForegroundColor Yellow
}
# Task 2: Status Check - Every 6 hours
$task2Name = "TroostwijkMonitor-StatusCheck"
$task2Description = "Checks auction monitoring status every 6 hours"
$task2Action = New-ScheduledTaskAction -Execute $javaExe -Argument "-jar `"$jarPath`" status" -WorkingDirectory $scriptPath
$task2Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Hours 6) -RepetitionDuration ([TimeSpan]::MaxValue)
$task2Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable
try {
Register-ScheduledTask -TaskName $task2Name -Action $task2Action -Trigger $task2Trigger -Settings $task2Settings -Description $task2Description -Force
Write-Host "[✓] Created task: $task2Name (every 6 hours)" -ForegroundColor Green
} catch {
Write-Host "[✗] Failed to create task: $task2Name" -ForegroundColor Red
Write-Host " Error: $_" -ForegroundColor Yellow
}
Write-Host ""
Write-Host "=== Setup Complete ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "Created tasks:" -ForegroundColor White
Write-Host " 1. $task1Name - Runs every 30 minutes" -ForegroundColor Gray
Write-Host " 2. $task2Name - Runs every 6 hours" -ForegroundColor Gray
Write-Host ""
Write-Host "To view tasks: Open Task Scheduler and look for 'TroostwijkMonitor-*'" -ForegroundColor Yellow
Write-Host "To remove tasks: Run 'Unregister-ScheduledTask -TaskName TroostwijkMonitor-*'" -ForegroundColor Yellow
Write-Host ""