Created
October 21, 2011 12:34
-
-
Save anonymous/1303716 to your computer and use it in GitHub Desktop.
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
private void generate(){ | |
try { | |
System.out.println("generating"); | |
SecureRandom random = new SecureRandom(); | |
for(int i=0;i<1000;i++){ | |
Random r = new Random(); | |
int words = r.nextInt(40); | |
int start = r.nextInt(40); | |
Something s = new Something(); | |
LoremIpsum lorem = new LoremIpsum(); | |
String w = lorem.getWords(words, start); | |
s.setSomeProp1(w); | |
words = r.nextInt(40); | |
start = r.nextInt(40); | |
String w2 = lorem.getWords(words, start); | |
s.setSuperDuperProp(w2); | |
String str = new BigInteger(130, random).toString(32); | |
s.setUniqueRandom(str); | |
System.out.println("saving : " + w); | |
somthingdao.save(s); | |
System.out.println("saved all somethings :)"); | |
} | |
Something s2 = new Something(); | |
s2.setSomeProp1("Once upon a time there was a pricess bla bla bla ..."); | |
s2.setUniqueRandom("ABSCDEFG"); | |
somthingdao.save(s2); | |
// | |
// List<Something> things = somthingdao.getAll(); | |
// for (Something something : things) { | |
// | |
// DBObject dbo = ds.getMapper().toDBObject(something); | |
// | |
// es.index(Something.class, something, dbo); | |
// | |
// | |
// } | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
System.out.println("done"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment