Skip to content

Instantly share code, notes, and snippets.

@baszero
Created February 9, 2012 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baszero/1779924 to your computer and use it in GitHub Desktop.
Save baszero/1779924 to your computer and use it in GitHub Desktop.
Create 1000 Yanel Users locally for testing
public class Test {
public static void main(String[] args) {
BasicConfigurator.configure();
Test test = new Test();
test.run42();
}
public void run42() {
try {
System.out.println("Starting to create users...");
ZGUserManager mgr = (ZGUserManager)ZGHelper.getZGRealm().getIdentityManager().getUserManager();
int i = 0;
for (;i<1000;i++) {
User user = mgr.createUser("dyntest"+i, "Dyn Test "+i, "baszero"+i+"@gmail.com", "test");
ZGHelper.getZGRealm().getIdentityManager().getGroupManager().getGroup("all-realm-users").addMember(user);
}
System.out.println("CREATED "+i+" USERS");
} catch (Exception e) {
e.printStackTrace();
}
}
}
@baszero
Copy link
Author

baszero commented Feb 9, 2012

You can replace ZGHelper.getZGRealm() with any other code that returns a valid realm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment