docs: align readme with runtime stack

This commit is contained in:
lingniu
2026-07-01 06:33:43 +08:00
parent be2daf986a
commit d8f8235544
2 changed files with 31 additions and 5 deletions

View File

@@ -43,12 +43,38 @@ class MavenModuleProfileTest {
"modules/apps/xinda-push-app");
}
@Test
void readmeMatchesCurrentRuntimeVersionsAndSplitAppResponsibilities() throws Exception {
Document pom = rootPom();
String readme = Files.readString(repositoryRoot().resolve("README.md"));
assertThat(readme)
.contains("Spring Boot " + projectProperty(pom, "spring-boot.version"))
.contains("Netty " + projectProperty(pom, "netty.version"))
.contains("Eclipse Paho " + projectProperty(pom, "paho-mqtt.version"))
.contains("vehicle-history-app/ TDengine 历史查询 + RAW JSON")
.contains("vehicle-analytics-app/ JT808 每日里程指标消费")
.doesNotContain("Spring Boot 3.4")
.doesNotContain("Netty 4.1")
.doesNotContain("HiveMQ MQTT Client")
.doesNotContain("车辆状态/日统计消费");
}
private static Document rootPom() throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
return factory.newDocumentBuilder().parse(Files.newInputStream(repositoryRoot().resolve("pom.xml")));
}
private static String projectProperty(Document pom, String name) {
Element properties = firstDirectChild(pom.getDocumentElement(), "properties");
Element property = firstDirectChild(properties, name);
if (property == null) {
throw new IllegalArgumentException("project property not found: " + name);
}
return property.getTextContent().trim();
}
private static List<String> defaultModules(Document pom) {
Element project = pom.getDocumentElement();
return directModules(firstDirectChild(project, "modules"));