Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @After public void tearDown() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TearDown()
        {
            if (_populator != null)
            {
                _populator.close(false);
            }
            IOUtils.closeAll(_index, _directoryFactory);
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRemoveEntryForNodeThatHasAlreadyBeenIndexed() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRemoveEntryForNodeThatHasAlreadyBeenIndexed()
        {
            // given
            _populator = NewPopulator();

            AddUpdate(_populator, 1, "value1");

            // when
            IndexUpdater updater = _populator.newPopulatingUpdater(_nodePropertyAccessor);

            updater.Process(remove(1, _schemaDescriptor, "value1"));

            _populator.close(true);

            // then
            assertEquals(Collections.EMPTY_LIST, GetAllNodes(Directory, "value1"));
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldUpdateEntryForNodeThatHasPropertyRemovedAndThenAddedAgain() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldUpdateEntryForNodeThatHasPropertyRemovedAndThenAddedAgain()
        {
            // given
            _populator = NewPopulator();

            AddUpdate(_populator, 1, "value1");

            // when
            IndexUpdater updater = _populator.newPopulatingUpdater(_nodePropertyAccessor);

            updater.Process(remove(1, _schemaDescriptor, "value1"));
            updater.Process(add(1, _schemaDescriptor, "value1"));

            _populator.close(true);

            // then
            assertEquals(asList(1L), GetAllNodes(Directory, "value1"));
        }
Exemple #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldVerifyThatThereAreNoDuplicates() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldVerifyThatThereAreNoDuplicates()
        {
            // given
            _populator = NewPopulator();

            AddUpdate(_populator, 1, "value1");
            AddUpdate(_populator, 2, "value2");
            AddUpdate(_populator, 3, "value3");

            // when
            _populator.verifyDeferredConstraints(_nodePropertyAccessor);
            _populator.close(true);

            // then
            assertEquals(asList(1L), GetAllNodes(Directory, "value1"));
            assertEquals(asList(2L), GetAllNodes(Directory, "value2"));
            assertEquals(asList(3L), GetAllNodes(Directory, "value3"));
        }
Exemple #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBeAbleToHandleSwappingOfIndexValues() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldBeAbleToHandleSwappingOfIndexValues()
        {
            // given
            _populator = NewPopulator();

            AddUpdate(_populator, 1, "value1");
            AddUpdate(_populator, 2, "value2");

            // when
            IndexUpdater updater = _populator.newPopulatingUpdater(_nodePropertyAccessor);

            updater.Process(change(1, _schemaDescriptor, "value1", "value2"));
            updater.Process(change(2, _schemaDescriptor, "value2", "value1"));

            _populator.close(true);

            // then
            assertEquals(asList(2L), GetAllNodes(Directory, "value1"));
            assertEquals(asList(1L), GetAllNodes(Directory, "value2"));
        }
Exemple #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotRejectDuplicateEntryOnSameNodeIdAfterUsingPopulatingUpdater() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotRejectDuplicateEntryOnSameNodeIdAfterUsingPopulatingUpdater()
        {
            // given
            _populator = NewPopulator();

            when(_nodePropertyAccessor.getNodePropertyValue(1, PROPERTY_KEY_ID)).thenReturn(Values.of("value1"));

            IndexUpdater updater = _populator.newPopulatingUpdater(_nodePropertyAccessor);

            updater.Process(add(1, _schemaDescriptor, "value1"));
            updater.Process(change(1, _schemaDescriptor, "value1", "value1"));
            updater.Close();
            AddUpdate(_populator, 2, "value2");
            AddUpdate(_populator, 3, "value3");

            // when
            _populator.verifyDeferredConstraints(_nodePropertyAccessor);
            _populator.close(true);

            // then
            assertEquals(asList(1L), GetAllNodes(Directory, "value1"));
            assertEquals(asList(2L), GetAllNodes(Directory, "value2"));
            assertEquals(asList(3L), GetAllNodes(Directory, "value3"));
        }