@echo off echo ==================================== echo 爬虫功能测试脚本 echo ==================================== echo. echo [测试1] 运行单元测试... java -cp target/datacollect-cli-0.1.0-jar-with-dependencies.jar com.example.datacollect.test.CrawlerTest if %errorlevel% neq 0 ( echo 单元测试失败! exit /b 1 ) echo. echo [测试2] 测试策略工厂... echo 支持的策略类型: java -cp target/datacollect-cli-0.1.0-jar-with-dependencies.jar -c "import com.example.datacollect.strategy.StrategyFactory; System.out.println(StrategyFactory.getSupportedTypes());" 2>nul || echo (需要JShell支持) echo. echo [测试3] 测试Blog策略爬取... java -cp target/datacollect-cli-0.1.0-jar-with-dependencies.jar com.example.datacollect.test.CrawlerTest echo. echo ==================================== echo 测试完成! echo ====================================