final long supId = this.execute(new Callable<Long>() {
@Override
public Long call() throws Exception {
final IStylesheetDescriptor stylesheetDescriptor = stylesheetDescriptorDao.getStylesheetDescriptor(ssdId);
final IStylesheetUserPreferences stylesheetUserPreferences = stylesheetUserPreferencesDao.createStylesheetUserPreferences(stylesheetDescriptor, person, userProfile);
assertNotNull(stylesheetUserPreferences);
stylesheetUserPreferences.setStylesheetParameter("activeTab", "1");
stylesheetUserPreferences.setOutputProperty("media", "xhtml");
stylesheetUserPreferences.setLayoutAttribute("u1l1n1", "deletable", "false");
stylesheetUserPreferencesDao.storeStylesheetUserPreferences(stylesheetUserPreferences);
return stylesheetUserPreferences.getId();
}
});
this.execute(new Callable<Long>() {
@Override
public Long call() throws Exception {
final IStylesheetUserPreferences stylesheetUserPreferences = stylesheetUserPreferencesDao.getStylesheetUserPreferences(supId);
assertNotNull(stylesheetUserPreferences);
assertEquals(Collections.singletonMap("activeTab", "1"), stylesheetUserPreferences.populateStylesheetParameters(new MapPopulator<String, String>()).getMap());
assertEquals(Collections.singletonMap("media", "xhtml"), stylesheetUserPreferences.populateOutputProperties(new PropertiesPopulator()).getProperties());
assertEquals(Collections.singletonMap("deletable", "false"), stylesheetUserPreferences.populateLayoutAttributes("u1l1n1", new MapPopulator<String, String>()).getMap());
return null;
}
});
this.execute(new Callable<Long>() {
@Override
public Long call() throws Exception {
final IStylesheetDescriptor stylesheetDescriptor = stylesheetDescriptorDao.getStylesheetDescriptor(ssdId);
final IStylesheetUserPreferences stylesheetUserPreferences = stylesheetUserPreferencesDao.getStylesheetUserPreferences(stylesheetDescriptor, person, userProfile);
assertNotNull(stylesheetUserPreferences);
assertEquals(Collections.singletonMap("activeTab", "1"), stylesheetUserPreferences.populateStylesheetParameters(new MapPopulator<String, String>()).getMap());
assertEquals(Collections.singletonMap("media", "xhtml"), stylesheetUserPreferences.populateOutputProperties(new PropertiesPopulator()).getProperties());
assertEquals(Collections.singletonMap("deletable", "false"), stylesheetUserPreferences.populateLayoutAttributes("u1l1n1", new MapPopulator<String, String>()).getMap());
stylesheetUserPreferencesDao.deleteStylesheetUserPreferences(stylesheetUserPreferences);
return null;
}