Created
February 9, 2012 13:26
-
-
Save baszero/1779924 to your computer and use it in GitHub Desktop.
Create 1000 Yanel Users locally for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can replace ZGHelper.getZGRealm() with any other code that returns a valid realm.