//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldConsiderNodesChangedInSameTxInIndexSeek()
        public virtual void ShouldConsiderNodesChangedInSameTxInIndexSeek()
        {
            // GIVEN
            CreateNodes(_db, _label, _nonMatching[0]);
            LongSet        toChangeToMatch    = CreateNodes(_db, _label, _nonMatching[1]);
            MutableLongSet toChangeToNotMatch = CreateNodes(_db, _label, _matching[0]);
            MutableLongSet expected           = CreateNodes(_db, _label, _matching[1]);
            // WHEN
            MutableLongSet found = new LongHashSet();

            using (Transaction tx = _db.beginTx())
            {
                LongIterator toMatching = toChangeToMatch.longIterator();
                while (toMatching.hasNext())
                {
                    long id = toMatching.next();
                    _db.getNodeById(id).setProperty(_key, _matching[2]);
                    expected.add(id);
                }
                LongIterator toNotMatching = toChangeToNotMatch.longIterator();
                while (toNotMatching.hasNext())
                {
                    long id = toNotMatching.next();
                    _db.getNodeById(id).setProperty(_key, _nonMatching[2]);
                    expected.remove(id);
                }

                CollectNodes(found, _db.findNodes(_label, _key, _template, _searchMode));
            }
            // THEN
            assertThat(found, equalTo(expected));
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldConsiderNodesChangedInSameTxInIndexSeek()
        public virtual void ShouldConsiderNodesChangedInSameTxInIndexSeek()
        {
            // GIVEN
            CreateNodes(_db, _label, NonMatching[0]);
            LongSet        toChangeToMatch    = CreateNodes(_db, _label, NonMatching[1]);
            LongSet        toChangeToNotMatch = CreateNodes(_db, _label, Values);
            MutableLongSet expected           = CreateNodes(_db, _label, Values);
            // WHEN
            MutableLongSet found = new LongHashSet();

            using (Transaction tx = _db.beginTx())
            {
                LongIterator toMatching = toChangeToMatch.longIterator();
                while (toMatching.hasNext())
                {
                    long id = toMatching.next();
                    SetProperties(id, Values);
                    expected.add(id);
                }
                LongIterator toNotMatching = toChangeToNotMatch.longIterator();
                while (toNotMatching.hasNext())
                {
                    long id = toNotMatching.next();
                    SetProperties(id, NonMatching[2]);
                    expected.remove(id);
                }

                CollectNodes(found, IndexSeek.findNodes(Keys, Values, _db));
            }
            // THEN
            assertThat(found, equalTo(expected));
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void marshalIndexIds(org.neo4j.storageengine.api.WritableChannel buffer, org.eclipse.collections.api.set.primitive.LongSet indexIds) throws java.io.IOException
            internal virtual void MarshalIndexIds(WritableChannel buffer, LongSet indexIds)
            {
                buffer.PutInt(indexIds.size());
                LongIterator itr = indexIds.longIterator();

                while (itr.hasNext())
                {
                    long indexId = itr.next();
                    buffer.PutLong(indexId);
                }
            }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotIncludeNodesDeletedInSameTxInIndexSeek()
        public virtual void ShouldNotIncludeNodesDeletedInSameTxInIndexSeek()
        {
            // GIVEN
            CreateNodes(_db, _label, _nonMatching[0]);
            LongSet        toDelete = CreateNodes(_db, _label, _matching[0], _nonMatching[1], _matching[1], _nonMatching[2]);
            MutableLongSet expected = CreateNodes(_db, _label, _matching[2]);
            // WHEN
            MutableLongSet found = new LongHashSet();

            using (Transaction tx = _db.beginTx())
            {
                LongIterator deleting = toDelete.longIterator();
                while (deleting.hasNext())
                {
                    long id = deleting.next();
                    _db.getNodeById(id).delete();
                    expected.remove(id);
                }

                CollectNodes(found, _db.findNodes(_label, _key, _template, _searchMode));
            }
            // THEN
            assertThat(found, equalTo(expected));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Convert primitive set into a plain old java <seealso cref="System.Collections.Generic.ISet<object>"/>, boxing each long.
 /// </summary>
 /// <param name="set"> <seealso cref="LongSet"/> set of primitive values. </param>
 /// <returns> a <seealso cref="System.Collections.Generic.ISet<object>"/> containing all items. </returns>
 public static ISet <long> ToSet(LongSet set)
 {
     return(ToSet(set.longIterator()));
 }