feat: 项目整体命名修改cache-schema-checker
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped

This commit is contained in:
2026-07-14 11:03:34 +08:00
parent 114b053733
commit 110beb79c0
42 changed files with 197 additions and 199 deletions

View File

@@ -0,0 +1,33 @@
package com.codechecker.cache;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.io.ByteArrayOutputStream;
/**
* 测试通用工具:加载 classpath 下的 fixture 文本。
*/
public final class TestSupport {
private TestSupport() {
}
public static String fixture(String path) {
try (InputStream in = TestSupport.class.getClassLoader().getResourceAsStream(path)) {
if (in == null) {
throw new IllegalArgumentException("fixture 不存在: " + path);
}
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
byte[] chunk = new byte[8192];
int read;
while ((read = in.read(chunk)) != -1) {
buffer.write(chunk, 0, read);
}
return new String(buffer.toByteArray(), StandardCharsets.UTF_8);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}