测试验收:补充教师端与学员端浏览器验收证据
This commit is contained in:
1 parent
44481ab6d2
commit
a2941c4d7b
37 files changed
+1109
-1
No files matched your search
@@ -0,0 +1,61 @@
|
||||
package scripts.qa;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.*;
|
||||
|
||||
public class CheckRound3bDatabase {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Class.forName("com.kingbase8.Driver");
|
||||
|
||||
// Read password safely from ~/.railwaysystem-qa.env
|
||||
File envFile = new File(System.getProperty("user.home"), ".railwaysystem-qa.env");
|
||||
String pass = "";
|
||||
if (envFile.exists()) {
|
||||
for (String line : Files.readAllLines(envFile.toPath())) {
|
||||
line = line.trim();
|
||||
if (line.startsWith("QA_DB_PASSWORD=")) {
|
||||
pass = line.substring("QA_DB_PASSWORD=".length()).trim();
|
||||
if (pass.startsWith("\"") && pass.endsWith("\"")) {
|
||||
pass = pass.substring(1, pass.length() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pass.isEmpty()) {
|
||||
File yml = new File("RuoYi-Vue/ruoyi-admin/src/main/resources/application-druid.yml");
|
||||
for (String line : Files.readAllLines(yml.toPath())) {
|
||||
if (line.trim().startsWith("password:")) {
|
||||
pass = line.trim().substring("password:".length()).trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String dbUrl = "jdbc:kingbase8://192.168.139.218:4321/railwaysystem_integrated_qa_20260916?useUnicode=true&characterEncoding=utf8";
|
||||
try (Connection conn = DriverManager.getConnection(dbUrl, "kingbase", pass)) {
|
||||
try (Statement st = conn.createStatement()) {
|
||||
try (ResultSet rs = st.executeQuery("SELECT current_database(), current_user")) {
|
||||
if (rs.next()) {
|
||||
System.out.println("CURRENT_DATABASE=" + rs.getString(1));
|
||||
System.out.println("CURRENT_USER=" + rs.getString(2));
|
||||
}
|
||||
}
|
||||
|
||||
String[] tables = new String[]{
|
||||
"train_class_plan", "train_teacher", "train_student", "train_course",
|
||||
"train_classroom_info", "train_training_site", "train_dormitory_info",
|
||||
"train_lesson", "train_enrollment", "train_accommodation", "train_student_checkin",
|
||||
"train_dorm_auth", "train_external_operation", "sys_user", "sys_role"
|
||||
};
|
||||
|
||||
for (String t : tables) {
|
||||
try (ResultSet rs = st.executeQuery("SELECT count(*) FROM public." + t)) {
|
||||
if (rs.next()) {
|
||||
System.out.println("TABLE_" + t.toUpperCase() + "=" + rs.getInt(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user