-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestInstallation.java
More file actions
64 lines (53 loc) · 2.5 KB
/
TestInstallation.java
File metadata and controls
64 lines (53 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import java.io.File;
import com.library.setup.InstallationManager;
/**
* 007 Security Test - Direct InstallationManager Testing
* Bypasses GUI to test installation logic directly
*/
public class TestInstallation {
public static void main(String[] args) {
System.out.println("🧪 007 SECURITY TEST - Direct Installation Manager Test");
System.out.println("═══════════════════════════════════════════════════════════");
try {
// Set environment variables for Oracle connection
System.setProperty("LMS_DB_URL", "jdbc:oracle:thin:@localhost:1521:xe");
System.setProperty("LMS_DB_USER", "PRJ2531H");
System.setProperty("LMS_DB_PASSWORD", "PRJ2531H");
// Create test installation directory
File installDir = new File("/tmp/lms-test-install");
if (!installDir.exists()) {
installDir.mkdirs();
}
// Create installation manager with test admin data
InstallationManager.InstallationProgressListener listener = new InstallationManager.InstallationProgressListener() {
@Override
public void onProgress(String message) {
System.out.println("PROGRESS: " + message);
}
@Override
public void onError(String error) {
System.out.println("ERROR: " + error);
}
@Override
public void onComplete() {
System.out.println("COMPLETE: Installation finished");
}
};
InstallationManager manager = new InstallationManager(
installDir,
"ADMIN", // adminUserId
"Administrator", // adminName
"admin@lms.com", // adminEmail
"1234567890", // adminPhone
"admin123", // adminPassword
listener
);
System.out.println("📋 Starting installation test...");
manager.install();
System.out.println("✅ Installation test completed!");
} catch (Exception e) {
System.err.println("❌ Installation test failed:");
e.printStackTrace();
}
}
}