Search in sources :

Example 1 with JSwordModuleService

use of com.tyndalehouse.step.core.service.jsword.JSwordModuleService in project step by STEPBible.

the class SearchServiceImplTest method getSearchServiceUnderTest.

/**
 * @return the search service to test
 */
private SearchServiceImpl getSearchServiceUnderTest() {
    final JSwordMetadataService meta = mock(JSwordMetadataService.class);
    final JSwordModuleService module = mock(JSwordModuleService.class);
    final JSwordVersificationService versificationService = TestUtils.mockVersificationService();
    final PassageOptionsValidationService optionsValidationService = mock(PassageOptionsValidationService.class);
    final JSwordPassageServiceImpl jsword = new JSwordPassageServiceImpl(versificationService, null, null, null, TestUtils.mockVersionResolver(), optionsValidationService);
    when(optionsValidationService.getAvailableFeaturesForVersion(any(String.class), any(List.class), any(String.class), any(InterlinearMode.class))).thenReturn(new AvailableFeatures());
    when(module.isInstalled("ESV_th")).thenReturn(true);
    when(module.isIndexed(any(String.class))).thenReturn(true);
    when(meta.supportsFeature(any(String.class), any(LookupOption.class))).thenReturn(true);
    final JSwordSearchServiceImpl jswordSearch = new JSwordSearchServiceImpl(versificationService, null, jsword);
    subjects = new SubjectSearchServiceImpl(entityManager, jswordSearch, meta, module, versificationService);
    return new SearchServiceImpl(jswordSearch, meta, versificationService, subjects, new TimelineServiceImpl(entityManager, jsword), null, entityManager, TestUtils.mockVersionResolver(), mock(LexiconDefinitionServiceImpl.class), null, null);
}
Also used : JSwordPassageServiceImpl(com.tyndalehouse.step.core.service.jsword.impl.JSwordPassageServiceImpl) LexiconDefinitionServiceImpl(com.tyndalehouse.step.core.service.impl.LexiconDefinitionServiceImpl) LookupOption(com.tyndalehouse.step.core.models.LookupOption) JSwordVersificationService(com.tyndalehouse.step.core.service.jsword.JSwordVersificationService) TimelineServiceImpl(com.tyndalehouse.step.core.service.impl.TimelineServiceImpl) PassageOptionsValidationService(com.tyndalehouse.step.core.service.PassageOptionsValidationService) JSwordModuleService(com.tyndalehouse.step.core.service.jsword.JSwordModuleService) JSwordMetadataService(com.tyndalehouse.step.core.service.jsword.JSwordMetadataService) AvailableFeatures(com.tyndalehouse.step.core.models.AvailableFeatures) List(java.util.List) InterlinearMode(com.tyndalehouse.step.core.models.InterlinearMode) JSwordSearchServiceImpl(com.tyndalehouse.step.core.service.jsword.impl.JSwordSearchServiceImpl) JSwordSearchServiceImpl(com.tyndalehouse.step.core.service.jsword.impl.JSwordSearchServiceImpl)

Example 2 with JSwordModuleService

use of com.tyndalehouse.step.core.service.jsword.JSwordModuleService in project step by STEPBible.

the class IndexModule method main.

/**
 * main method
 *
 * @param args list of arguments
 */
public static void main(final String[] args) {
    CWProject.instance().setFrontendName("step");
    Injector injector = Guice.createInjector(new StepCoreModule(), new Module() {

        @Override
        public void configure(final Binder binder) {
            binder.bind(ClientSession.class).toProvider(new Provider<ClientSession>() {

                @Override
                public ClientSession get() {
                    // TODO Auto-generated method stub
                    return null;
                }
            });
        }
    });
    final JSwordModuleService instance = injector.getInstance(JSwordModuleService.class);
    ConfigEntry.setConfigValueInterceptor(injector.getInstance(ConfigValueInterceptor.class));
    System.out.println("Indexing " + args[0]);
    instance.index(args[0]);
    System.out.println("Finished indexing " + args[0]);
}
Also used : JSwordModuleService(com.tyndalehouse.step.core.service.jsword.JSwordModuleService) ConfigValueInterceptor(org.crosswire.jsword.book.sword.ConfigValueInterceptor) StepCoreModule(com.tyndalehouse.step.core.guice.StepCoreModule) Module(com.google.inject.Module) StepCoreModule(com.tyndalehouse.step.core.guice.StepCoreModule)

Aggregations

JSwordModuleService (com.tyndalehouse.step.core.service.jsword.JSwordModuleService)2 Module (com.google.inject.Module)1 StepCoreModule (com.tyndalehouse.step.core.guice.StepCoreModule)1 AvailableFeatures (com.tyndalehouse.step.core.models.AvailableFeatures)1 InterlinearMode (com.tyndalehouse.step.core.models.InterlinearMode)1 LookupOption (com.tyndalehouse.step.core.models.LookupOption)1 PassageOptionsValidationService (com.tyndalehouse.step.core.service.PassageOptionsValidationService)1 LexiconDefinitionServiceImpl (com.tyndalehouse.step.core.service.impl.LexiconDefinitionServiceImpl)1 TimelineServiceImpl (com.tyndalehouse.step.core.service.impl.TimelineServiceImpl)1 JSwordMetadataService (com.tyndalehouse.step.core.service.jsword.JSwordMetadataService)1 JSwordVersificationService (com.tyndalehouse.step.core.service.jsword.JSwordVersificationService)1 JSwordPassageServiceImpl (com.tyndalehouse.step.core.service.jsword.impl.JSwordPassageServiceImpl)1 JSwordSearchServiceImpl (com.tyndalehouse.step.core.service.jsword.impl.JSwordSearchServiceImpl)1 List (java.util.List)1 ConfigValueInterceptor (org.crosswire.jsword.book.sword.ConfigValueInterceptor)1