Search in sources :

Example 1 with LuceneIndex

use of org.talend.dataquality.semantic.index.LuceneIndex in project data-prep by Talend.

the class AnalyzerServiceTest method setUp.

@Before
public void setUp() throws Exception {
    LuceneIndex sharedDataDict = Mockito.mock(LuceneIndex.class);
    LuceneIndex customDataDict = Mockito.mock(LuceneIndex.class);
    DictionarySnapshot dictionarySnapshot = Mockito.mock(DictionarySnapshot.class);
    when(dictionarySnapshot.getMetadata()).thenReturn(createMetadata());
    when(dictionarySnapshot.getCustomDataDict()).thenReturn(customDataDict);
    when(dictionarySnapshot.getSharedDataDict()).thenReturn(sharedDataDict);
    when(dictionarySnapshot.getRegexClassifier()).thenReturn(new UserDefinedClassifier());
    DictionarySnapshotProvider dictionarySnapshotProvider = Mockito.mock(DictionarySnapshotProvider.class);
    when(dictionarySnapshotProvider.get()).thenReturn(dictionarySnapshot);
    service = new AnalyzerService(dictionarySnapshotProvider);
}
Also used : UserDefinedClassifier(org.talend.dataquality.semantic.classifier.custom.UserDefinedClassifier) LuceneIndex(org.talend.dataquality.semantic.index.LuceneIndex) DictionarySnapshotProvider(org.talend.dataquality.semantic.snapshot.DictionarySnapshotProvider) DictionarySnapshot(org.talend.dataquality.semantic.snapshot.DictionarySnapshot) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 UserDefinedClassifier (org.talend.dataquality.semantic.classifier.custom.UserDefinedClassifier)1 LuceneIndex (org.talend.dataquality.semantic.index.LuceneIndex)1 DictionarySnapshot (org.talend.dataquality.semantic.snapshot.DictionarySnapshot)1 DictionarySnapshotProvider (org.talend.dataquality.semantic.snapshot.DictionarySnapshotProvider)1