Package org.lilyproject.indexer.model.util

Examples of org.lilyproject.indexer.model.util.IndexInfo


        when(repository.getRepositoryName()).thenReturn(RepoAndTableUtil.DEFAULT_REPOSITORY);
    }

    @Test
    public void testBeforeUpdate() throws RepositoryException, InterruptedException {
        IndexInfo inclusion = createMockIndexInfo("include", true);
        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion));

        RecordEvent recordEvent = new RecordEvent();
        recordEvent.setType(Type.UPDATE);
        recordEvent.setTableName(Table.RECORD.name);
View Full Code Here


                Table.RECORD.name, oldRecord, newRecord, idxFilterData);
    }

    @Test
    public void testBeforeCreate() throws RepositoryException, InterruptedException {
        IndexInfo inclusion = createMockIndexInfo("include", true);
        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion));

        RecordEvent recordEvent = new RecordEvent();
        recordEvent.setType(Type.CREATE);
        recordEvent.setTableName(Table.RECORD.name);
View Full Code Here

                Table.RECORD.name, null, newRecord, idxFilterData);
    }

    @Test
    public void testBeforeDelete() throws RepositoryException, InterruptedException {
        IndexInfo inclusion = createMockIndexInfo("include", true);
        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion));

        RecordEvent recordEvent = new RecordEvent();
        recordEvent.setType(Type.DELETE);
        recordEvent.setTableName(Table.RECORD.name);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_MoreInclusionsThanExclusions() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusionA = createMockIndexInfo("includeA", true);
        IndexInfo inclusionB = createMockIndexInfo("includeB", true);
        IndexInfo exclusion = createMockIndexInfo("exclude", false);

        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusionA, inclusionB, exclusion));

        indexFilterHook.calculateIndexInclusion(RepoAndTableUtil.DEFAULT_REPOSITORY,
                Table.RECORD.name, oldRecord, newRecord, indexFilterData);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_MoreExclusionsThanInclusions() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusion = createMockIndexInfo("include", true);
        IndexInfo exclusionA = createMockIndexInfo("excludeA", false);
        IndexInfo exclusionB = createMockIndexInfo("excludeB", false);

        when(this.indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion, exclusionA, exclusionB));

        indexFilterHook.calculateIndexInclusion(RepoAndTableUtil.DEFAULT_REPOSITORY,
                Table.RECORD.name, oldRecord, newRecord, indexFilterData);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_AllIndexesIncluded() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusion = createMockIndexInfo("include", true);

        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion));

        indexFilterHook.calculateIndexInclusion(RepoAndTableUtil.DEFAULT_REPOSITORY,
                Table.RECORD.name, oldRecord, newRecord, indexFilterData);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_AllIndexesExcluded() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusion = createMockIndexInfo("exclude", false);

        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusion));

        indexFilterHook.calculateIndexInclusion(RepoAndTableUtil.DEFAULT_REPOSITORY,
                Table.RECORD.name, oldRecord, newRecord, indexFilterData);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_RepoBasedExclusion() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusionA = createMockIndexInfo("includeA", true);
        IndexInfo inclusionB = createMockIndexInfo("includeButNotInThisRepo", true);
        when(inclusionB.getRepositoryName()).thenReturn("someOtherRepo");
        IndexInfo exclusion = createMockIndexInfo("exclude", false);

        when(indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusionA, inclusionB, exclusion));

        indexFilterHook.calculateIndexInclusion(RepoAndTableUtil.DEFAULT_REPOSITORY,
                Table.RECORD.name, oldRecord, newRecord, indexFilterData);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_ForNonDefaultRepository() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusionA = createMockIndexInfo("inclusionA", true);
        IndexInfo exclusion = createMockIndexInfo("excludeA", false);
        IndexInfo inclusionB = createMockIndexInfo("inclusionB", true);
        when(inclusionB.getRepositoryName()).thenReturn("someOtherRepo");
        when(this.indexesInfo.getIndexInfos()).thenReturn(Lists.newArrayList(inclusionA, exclusion, inclusionB));

        indexFilterHook.calculateIndexInclusion("someOtherRepo",
                Table.RECORD.name, oldRecord, newRecord, indexFilterData);
View Full Code Here

    }

    @Test
    public void testCalculateIndexInclusion_RepoBasedInclusion() {
        IndexRecordFilterData indexFilterData = mock(IndexRecordFilterData.class);
        IndexInfo inclusionA = createMockIndexInfo("inclusionA", true);
        IndexInfo exclusion = createMockIndexInfo("excludeA", false);
        IndexInfo inclusionB = createMockIndexInfo("inclusionB", true);
        ArrayList<IndexInfo> infos = Lists.newArrayList(inclusionA, exclusion, inclusionB);
        for (IndexInfo info : infos) {
            when(info.getRepositoryName()).thenReturn("someOtherRepo");
        }
        when(this.indexesInfo.getIndexInfos()).thenReturn(infos);
View Full Code Here

TOP

Related Classes of org.lilyproject.indexer.model.util.IndexInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.