/** * Constructs a dictionary by default. * * @param qnameFilter QNameFilter * @param dictionaryDAO DictionaryDAOImpl * @return Map */ public static Map<String, DictionaryComponent> constructDictionaryServices(QNameFilter qnameFilter, DictionaryDAOImpl dictionaryDAO) { Map<String,DictionaryComponent> dictionaries = new HashMap<String,DictionaryComponent>(); DictionaryComponent compo = new DictionaryComponent(); compo.setDictionaryDAO(dictionaryDAO); dictionaries.put(CMISStrictDictionaryService.DEFAULT, compo); FilteredDictionaryComponent fdc = new FilteredDictionaryComponent(); fdc.setDictionaryDAO(dictionaryDAO); fdc.setFilter(qnameFilter); dictionaries.put(DICTIONARY_FILTERED_WITH_EXCLUSIONS, fdc); return dictionaries; }
@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; }
public Object doWork() dictionaryComponent.init();
bootstrap.bootstrap(); DictionaryComponent component = new DictionaryComponent(); component.setDictionaryDAO(dictionaryDAO); component.setMessageLookup(new StaticMessageLookup()); service = component;
public Object doWork() dictionaryComponent.init();
/** * Loads the test model required for building the node graphs */ public static DictionaryService loadModel(ApplicationContext applicationContext) { DictionaryDAO dictionaryDao = (DictionaryDAO) applicationContext.getBean("dictionaryDAO"); // load the system model ClassLoader cl = PerformanceNodeServiceTest.class.getClassLoader(); InputStream modelStream = cl.getResourceAsStream("alfresco/model/contentModel.xml"); assertNotNull(modelStream); M2Model model = M2Model.createModel(modelStream); dictionaryDao.putModel(model); // load the test model modelStream = cl.getResourceAsStream("org/alfresco/repo/node/BaseNodeServiceTest_model.xml"); assertNotNull(modelStream); model = M2Model.createModel(modelStream); dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); return dictionary; }
AuthenticationUtil.setFullyAuthenticatedUser(getSystemUser(tenantDomain)); dictionaryComponent.init();
/** * Loads the test model required for building the node graphs */ public static DictionaryService loadModel(ApplicationContext applicationContext) { DictionaryDAO dictionaryDao = (DictionaryDAO) applicationContext.getBean("dictionaryDAO"); // load the system model ClassLoader cl = BaseNodeServiceTest.class.getClassLoader(); InputStream modelStream = cl.getResourceAsStream("alfresco/model/contentModel.xml"); assertNotNull(modelStream); M2Model model = M2Model.createModel(modelStream); dictionaryDao.putModel(model); // load the test model modelStream = cl.getResourceAsStream("org/alfresco/repo/node/BaseNodeServiceTest_model.xml"); assertNotNull(modelStream); model = M2Model.createModel(modelStream); dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); // done return dictionary; }
AuthenticationUtil.setFullyAuthenticatedUser(getSystemUser(tenantDomain)); dictionaryComponent.init();
/** * Loads the test model required for building the node graphs */ public static DictionaryService loadModel(ApplicationContext applicationContext) { DictionaryDAO dictionaryDao = (DictionaryDAO) applicationContext.getBean("dictionaryDAO"); // load the system model ClassLoader cl = BaseNodeServiceTest.class.getClassLoader(); InputStream modelStream = cl.getResourceAsStream("alfresco/model/contentModel.xml"); assertNotNull(modelStream); M2Model model = M2Model.createModel(modelStream); dictionaryDao.putModel(model); // load the test model modelStream = cl.getResourceAsStream("org/alfresco/repo/node/BaseNodeServiceTest_model.xml"); assertNotNull(modelStream); model = M2Model.createModel(modelStream); dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); // done return dictionary; } /**
dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); BaseNodeServiceTest.loadModel(ctx);
@Override protected void setUp() throws Exception { TenantService mockTenantService = mock(TenantService.class); when(mockTenantService.isEnabled()).thenReturn(true); when(mockTenantService.getCurrentUserDomain()).thenReturn("test.com"); when(mockTenantService.getDomainUser(any(String.class), any(String.class))).thenReturn("System"); when(mockTenantService.getBaseName(any(NodeRef.class))).thenReturn(new NodeRef(BASE_PROTOCOL, BASE_IDENTIFIER, BASE_ID)); when(mockTenantService.getBaseName(any(StoreRef.class))).thenReturn(new StoreRef(BASE_PROTOCOL, BASE_IDENTIFIER)); DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl(); dictionaryDAO.setTenantService(mockTenantService); initDictionaryCaches(dictionaryDAO, mockTenantService); DictionaryBootstrap bootstrap = new DictionaryBootstrap(); List<String> bootstrapModels = new ArrayList<String>(); bootstrapModels.add("alfresco/model/dictionaryModel.xml"); bootstrapModels.add("alfresco/model/systemModel.xml"); bootstrapModels.add("org/alfresco/repo/policy/policycomponenttest_model.xml"); bootstrapModels.add(TEST_MODEL); bootstrap.setModels(bootstrapModels); bootstrap.setDictionaryDAO(dictionaryDAO); bootstrap.setTenantService(mockTenantService); bootstrap.bootstrap(); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDAO); // Instantiate Policy Component PolicyComponentImpl x = new PolicyComponentImpl(dictionary); x.setTenantService(mockTenantService); policyComponent = x; }
dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); dictionaryService = loadModel(applicationContext);
dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); dictionaryService = loadModel(applicationContext);
@Override protected void setUp() throws Exception { // Instantiate Dictionary Service 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"); bootstrapModels.add("alfresco/model/systemModel.xml"); bootstrapModels.add("org/alfresco/repo/policy/policycomponenttest_model.xml"); bootstrapModels.add(TEST_MODEL); bootstrap.setModels(bootstrapModels); bootstrap.setDictionaryDAO(dictionaryDAO); bootstrap.setTenantService(new SingleTServiceImpl()); bootstrap.bootstrap(); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDAO); // Instantiate Policy Component policyComponent = new PolicyComponentImpl(dictionary); }
dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); BaseNodeServiceTest.loadModel(applicationContext);
dictionaryDao.putModel(model); DictionaryComponent dictionary = new DictionaryComponent(); dictionary.setDictionaryDAO(dictionaryDao); dictionaryService = loadModel(applicationContext);