Softwaretechnik-II/testing/AufgabeUserRegistration/ExampleUserRegistration.java
2024-10-30 19:29:50 +01:00

26 lines
693 B
Java

import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class ExampleUserRegistration {
public static void main(String[] args) {
if (args.length<3) {
System.out.println("Please provide username, password and email as command line arguments");
} else {
String user = args[0];
String password = args[1];
String email = args[2];
try {
if (UserRegistration.registerUser(user, password, email))
System.out.println("User successfully registered!");
} catch (RegistrationException e) {
System.out.println(e.getMessage());
}
}
}
}