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.
29 lines
1.0 KiB
29 lines
1.0 KiB
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 程序主入口(测试所有功能)
|
|
*/
|
|
public class Main {
|
|
public static void main(String[] args) {
|
|
// 1. 测试Article扩展字段
|
|
Article article = new Article("Java MVC", "MVC分层设计", "张三", new Date());
|
|
System.out.println("Article信息:" + article);
|
|
|
|
// 2. 测试命令别名+历史记录
|
|
CommandController cmdController = new CommandController();
|
|
cmdController.executeCommand("c"); // 别名c -> crawl
|
|
cmdController.executeCommand("crawl"); // 原始命令
|
|
List<String> history = HistoryCommand.getCommandList();
|
|
System.out.println("命令历史:" + history);
|
|
|
|
// 3. 测试URL验证
|
|
CrawlController crawlController = new CrawlController();
|
|
crawlController.crawl("https://www.example.com"); // 合法URL
|
|
crawlController.crawl("invalid-url"); // 非法URL
|
|
|
|
// 4. 测试暗色主题
|
|
ConsoleView view = new ConsoleView();
|
|
view.render();
|
|
}
|
|
}
|