Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17248 Add logging for webdriver simulated users #3455

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class AuthSurveyDriver {
private static final int INVALID_USER_INDEX = -1;
private static final int FIRST_VALID_USER_INDEX = 0;

public static final java.util.logging.Logger logger =
SurveyLog.forClass(AuthSurveyDriver.class);

private static boolean isInitialized = false;
private static boolean isEnabled = false;
private static String realPassword = null;
Expand All @@ -46,12 +49,19 @@ public static User createTestUser(String password, String email) {
}

private static void initialize() {
String status;
if (SurveyMain.isUnofficial()) {
realPassword = CLDRConfig.getInstance().getProperty("CLDR_WEBDRIVER_PASSWORD", "");
if (realPassword != null && !realPassword.isBlank()) {
isEnabled = true;
status = "enabled";
} else {
status = "disabled, no property";
}
} else {
status = "disabled, official";
}
logger.info("Webdriver simulated users are " + status);
isInitialized = true;
}

Expand Down Expand Up @@ -87,8 +97,10 @@ private static User addTestUser(String password, String email, int userIndex) {
u.setPassword(password);
User registeredUser = reg.newUser(null, u);
if (registeredUser == null || registeredUser.id <= 0) {
logger.severe("Failed to add webdriver simulated user " + email);
return null;
}
logger.info("Added webdriver simulated user " + email);
return registeredUser;
}
}
Loading