コード例 #1
0
        private void InitiateMocks()
        {
            IndexSlot[] activeSlots = FusionVersion.aliveSlots();
            _accessors = new Dictionary <IndexSlot, IndexAccessor>(typeof(IndexSlot));
            fill(_accessors, Org.Neo4j.Kernel.Api.Index.IndexAccessor_Fields.Empty);
            _aliveAccessors = new IndexAccessor[activeSlots.Length];
            for (int i = 0; i < activeSlots.Length; i++)
            {
                IndexAccessor mock = mock(typeof(IndexAccessor));
                _aliveAccessors[i] = mock;
                switch (activeSlots[i])
                {
                case STRING:
                    _accessors[STRING] = mock;
                    break;

                case NUMBER:
                    _accessors[NUMBER] = mock;
                    break;

                case SPATIAL:
                    _accessors[SPATIAL] = mock;
                    break;

                case TEMPORAL:
                    _accessors[TEMPORAL] = mock;
                    break;

                case LUCENE:
                    _accessors[LUCENE] = mock;
                    break;

                default:
                    throw new Exception();
                }
            }
            _fusionIndexAccessor = new FusionIndexAccessor(FusionVersion.slotSelector(), new InstanceSelector <IndexAccessor>(_accessors), _indexDescriptor, _dropAction);
        }
コード例 #2
0
        private static void VerifyFailOnSingleDropFailure(IndexAccessor failingAccessor, FusionIndexAccessor fusionIndexAccessor)
        {
            UncheckedIOException expectedFailure = new UncheckedIOException(new IOException("fail"));

            doThrow(expectedFailure).when(failingAccessor).drop();
            try
            {
                fusionIndexAccessor.Drop();
                fail("Should have failed");
            }
            catch (UncheckedIOException e)
            {
                assertSame(expectedFailure, e);
            }
            doAnswer(invocation => null).when(failingAccessor).drop();
        }
コード例 #3
0
 public BoundedIterableAnonymousInnerClass(FusionIndexAccessor outerInstance, IEnumerable <BoundedIterable <long> > entries)
 {
     this.outerInstance = outerInstance;
     this._entries      = entries;
 }