Softwaretechnik-II/testing/AufgabeUserRegistration/ExampleUserRegistration.java

26 lines
693 B
Java
Raw Permalink Normal View History

2024-10-30 19:29:50 +01:00
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());
}
}
}
}