@Test public void testBootstrap() throws Exception { TenantService tenantService = new SingleTServiceImpl(); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); dictionaryDAO.setTenantService(tenantService); initDictionaryCaches(dictionaryDAO, tenantService); DictionaryBootstrap bootstrap = new DictionaryBootstrap(); List<String> bootstrapModels = new ArrayList<String>(); bootstrapModels.add("alfresco/model/dictionaryModel.xml"); bootstrap.setModels(bootstrapModels); bootstrap.setDictionaryDAO(dictionaryDAO); bootstrap.setTenantService(tenantService); bootstrap.bootstrap(); }
@Before public void setUp() throws Exception { // register resource bundles for messages I18NUtil.registerResourceBundle(TEST_RESOURCE_MESSAGES); // Instantiate Dictionary Service TenantService tenantService = new MultiTServiceImpl(); this.dictionaryDAO = new DictionaryDAOImpl(); dictionaryDAO.setTenantService(tenantService); initDictionaryCaches(dictionaryDAO, tenantService); new AuthenticationUtil().afterPropertiesSet(); // Populate with appropriate models DictionaryBootstrap bootstrap = new DictionaryBootstrap(); List<String> bootstrapModels = new ArrayList<String>(); bootstrapModels.add("alfresco/model/dictionaryModel.xml"); bootstrapModels.add("alfresco/model/systemModel.xml"); bootstrapModels.add("alfresco/model/contentModel.xml"); List<String> labels = new ArrayList<String>(); bootstrap.setModels(bootstrapModels); bootstrap.setLabels(labels); bootstrap.setDictionaryDAO(dictionaryDAO); bootstrap.setTenantService(tenantService); bootstrap.bootstrap(); DictionaryComponent component = new DictionaryComponent(); component.setDictionaryDAO(dictionaryDAO); component.setMessageLookup(new StaticMessageLookup()); service = component; }