You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
898 B
26 lines
898 B
@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 ====================================
|