TestUtils.endSession(true);
wd1 = TestUtils.getManagedWeblogEntry(wd1);
IndexManager imgr = WebloggerFactory.getWeblogger().getIndexManager();
imgr.executeIndexOperationNow(
new AddEntryOperation(WebloggerFactory.getWeblogger(), (IndexManagerImpl)imgr, wd1));
WeblogEntry wd2 = new WeblogEntry();
wd2.setTitle("A Piece of the Action");
wd2.setText(
"The crew of the Enterprise attempts to make contact with "
+"the inhabitants of planet Sigma Iotia II, and Uhura puts Kirk "
+"in communication with Boss Oxmyx.");
wd2.setAnchor("dummy2");
wd2.setStatus(WeblogEntry.PUBLISHED);
wd2.setCreatorUserName(testUser.getUserName());
wd2.setUpdateTime(new Timestamp(System.currentTimeMillis()));
wd2.setPubTime(new Timestamp(System.currentTimeMillis()));
wd2.setWebsite(TestUtils.getManagedWebsite(testWeblog));
cat = wem.getWeblogCategory(testWeblog.getDefaultCategory().getId());
wd2.setCategory(cat);
wem.saveWeblogEntry(wd2);
TestUtils.endSession(true);
wd2 = TestUtils.getManagedWeblogEntry(wd2);
imgr.executeIndexOperationNow(
new AddEntryOperation(WebloggerFactory.getWeblogger(), (IndexManagerImpl)imgr, wd2));
Thread.sleep(1000);
SearchOperation search = new SearchOperation(imgr);
search.setTerm("Enterprise");