Search in sources :

Example 1 with IssueServiceImpl

use of com.enonic.xp.core.impl.issue.IssueServiceImpl in project xp by enonic.

the class AbstractIssueServiceTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    executorService = Executors.newSingleThreadExecutor();
    deleteAllIndices();
    final Context ctx = ContextBuilder.create().branch(WS_DEFAULT).repositoryId(TEST_REPO_ID).authInfo(TEST_DEFAULT_USER_AUTHINFO).build();
    ContextAccessor.INSTANCE.set(ctx);
    final MemoryBlobStore blobStore = new MemoryBlobStore();
    binaryService = new BinaryServiceImpl();
    binaryService.setBlobStore(blobStore);
    final StorageDaoImpl storageDao = new StorageDaoImpl();
    storageDao.setClient(client);
    final EventPublisherImpl eventPublisher = new EventPublisherImpl(executorService);
    SearchDaoImpl searchDao = new SearchDaoImpl();
    searchDao.setClient(client);
    BranchServiceImpl branchService = new BranchServiceImpl();
    branchService.setStorageDao(storageDao);
    branchService.setSearchDao(searchDao);
    VersionServiceImpl versionService = new VersionServiceImpl();
    versionService.setStorageDao(storageDao);
    IndexServiceInternalImpl indexServiceInternal = new IndexServiceInternalImpl();
    indexServiceInternal.setClient(client);
    NodeVersionServiceImpl nodeDao = new NodeVersionServiceImpl();
    nodeDao.setBlobStore(blobStore);
    issueService = new IssueServiceImpl();
    IndexDataServiceImpl indexedDataService = new IndexDataServiceImpl();
    indexedDataService.setStorageDao(storageDao);
    indexService = new IndexServiceImpl();
    indexService.setIndexServiceInternal(indexServiceInternal);
    NodeStorageServiceImpl storageService = new NodeStorageServiceImpl();
    storageService.setBranchService(branchService);
    storageService.setVersionService(versionService);
    storageService.setNodeVersionService(nodeDao);
    storageService.setIndexDataService(indexedDataService);
    NodeSearchServiceImpl searchService = new NodeSearchServiceImpl();
    searchService.setSearchDao(searchDao);
    final NodeRepositoryServiceImpl nodeRepositoryService = new NodeRepositoryServiceImpl();
    nodeRepositoryService.setIndexServiceInternal(indexServiceInternal);
    final IndexServiceInternalImpl elasticsearchIndexService = new IndexServiceInternalImpl();
    elasticsearchIndexService.setClient(client);
    final RepositoryEntryServiceImpl repositoryEntryService = new RepositoryEntryServiceImpl();
    repositoryEntryService.setIndexServiceInternal(elasticsearchIndexService);
    repositoryEntryService.setNodeStorageService(storageService);
    repositoryEntryService.setNodeSearchService(searchService);
    repositoryEntryService.setEventPublisher(eventPublisher);
    repositoryEntryService.setBinaryService(binaryService);
    repositoryService = new RepositoryServiceImpl(repositoryEntryService, elasticsearchIndexService, nodeRepositoryService, storageService, searchService);
    repositoryService.initialize();
    nodeService = new NodeServiceImpl();
    nodeService.setIndexServiceInternal(indexServiceInternal);
    nodeService.setNodeStorageService(storageService);
    nodeService.setNodeSearchService(searchService);
    nodeService.setEventPublisher(eventPublisher);
    nodeService.setBinaryService(binaryService);
    nodeService.setRepositoryService(repositoryService);
    nodeService.initialize();
    Map<String, List<String>> metadata = new HashMap<>();
    metadata.put(HttpHeaders.CONTENT_TYPE, List.of("image/jpg"));
    issueService.setNodeService(nodeService);
    initializeRepository();
}
Also used : Context(com.enonic.xp.context.Context) BinaryServiceImpl(com.enonic.xp.repo.impl.binary.BinaryServiceImpl) SearchDaoImpl(com.enonic.xp.repo.impl.elasticsearch.search.SearchDaoImpl) NodeVersionServiceImpl(com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl) VersionServiceImpl(com.enonic.xp.repo.impl.version.VersionServiceImpl) NodeVersionServiceImpl(com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl) NodeRepositoryServiceImpl(com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl) EventPublisherImpl(com.enonic.xp.core.impl.event.EventPublisherImpl) HashMap(java.util.HashMap) IndexDataServiceImpl(com.enonic.xp.repo.impl.storage.IndexDataServiceImpl) BranchServiceImpl(com.enonic.xp.repo.impl.branch.storage.BranchServiceImpl) IssueServiceImpl(com.enonic.xp.core.impl.issue.IssueServiceImpl) NodeRepositoryServiceImpl(com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl) RepositoryServiceImpl(com.enonic.xp.repo.impl.repository.RepositoryServiceImpl) IndexServiceImpl(com.enonic.xp.repo.impl.index.IndexServiceImpl) NodeServiceImpl(com.enonic.xp.repo.impl.node.NodeServiceImpl) RepositoryEntryServiceImpl(com.enonic.xp.repo.impl.repository.RepositoryEntryServiceImpl) StorageDaoImpl(com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl) IndexServiceInternalImpl(com.enonic.xp.repo.impl.elasticsearch.IndexServiceInternalImpl) NodeStorageServiceImpl(com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl) List(java.util.List) MemoryBlobStore(com.enonic.xp.internal.blobstore.MemoryBlobStore) NodeSearchServiceImpl(com.enonic.xp.repo.impl.search.NodeSearchServiceImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Context (com.enonic.xp.context.Context)1 EventPublisherImpl (com.enonic.xp.core.impl.event.EventPublisherImpl)1 IssueServiceImpl (com.enonic.xp.core.impl.issue.IssueServiceImpl)1 MemoryBlobStore (com.enonic.xp.internal.blobstore.MemoryBlobStore)1 BinaryServiceImpl (com.enonic.xp.repo.impl.binary.BinaryServiceImpl)1 BranchServiceImpl (com.enonic.xp.repo.impl.branch.storage.BranchServiceImpl)1 IndexServiceInternalImpl (com.enonic.xp.repo.impl.elasticsearch.IndexServiceInternalImpl)1 SearchDaoImpl (com.enonic.xp.repo.impl.elasticsearch.search.SearchDaoImpl)1 StorageDaoImpl (com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl)1 IndexServiceImpl (com.enonic.xp.repo.impl.index.IndexServiceImpl)1 NodeServiceImpl (com.enonic.xp.repo.impl.node.NodeServiceImpl)1 NodeVersionServiceImpl (com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl)1 NodeRepositoryServiceImpl (com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl)1 RepositoryEntryServiceImpl (com.enonic.xp.repo.impl.repository.RepositoryEntryServiceImpl)1 RepositoryServiceImpl (com.enonic.xp.repo.impl.repository.RepositoryServiceImpl)1 NodeSearchServiceImpl (com.enonic.xp.repo.impl.search.NodeSearchServiceImpl)1 IndexDataServiceImpl (com.enonic.xp.repo.impl.storage.IndexDataServiceImpl)1 NodeStorageServiceImpl (com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl)1 VersionServiceImpl (com.enonic.xp.repo.impl.version.VersionServiceImpl)1 HashMap (java.util.HashMap)1