Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPreserveNoId()
        public virtual void ShouldPreserveNoId()
        {
            assertThat(RelationshipReferenceEncoding.encodeForFiltering(NO_ID), equalTo(( long )NO_ID));
            assertThat(RelationshipReferenceEncoding.encodeForTxStateFiltering(NO_ID), equalTo(( long )NO_ID));
            assertThat(RelationshipReferenceEncoding.encodeGroup(NO_ID), equalTo(( long )NO_ID));
            assertThat(RelationshipReferenceEncoding.encodeNoIncomingRels(NO_ID), equalTo(( long )NO_ID));
            assertThat(RelationshipReferenceEncoding.encodeNoOutgoingRels(NO_ID), equalTo(( long )NO_ID));
            assertThat(RelationshipReferenceEncoding.encodeNoLoopRels(NO_ID), equalTo(( long )NO_ID));

            assertThat(GroupReferenceEncoding.EncodeRelationship(NO_ID), equalTo(( long )NO_ID));
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void encodeRelationship()
        public virtual void EncodeRelationship()
        {
            ThreadLocalRandom random = ThreadLocalRandom.current();

            for (int i = 0; i < 1000; i++)
            {
                long reference = random.nextLong(_maxIdLimit);
                assertFalse(GroupReferenceEncoding.IsRelationship(reference));
                assertTrue(GroupReferenceEncoding.IsRelationship(GroupReferenceEncoding.EncodeRelationship(reference)));
                assertTrue("encoded reference is negative", GroupReferenceEncoding.EncodeRelationship(reference) < 0);
            }
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldClearFlags()
        public virtual void ShouldClearFlags()
        {
            ThreadLocalRandom random = ThreadLocalRandom.current();

            for (int i = 0; i < 1000; i++)
            {
                long reference = random.nextLong(_maxIdLimit);
                int  token     = random.Next(int.MaxValue);

                assertThat(clearEncoding(RelationshipReferenceEncoding.encodeGroup(reference)), equalTo(reference));
                assertThat(clearEncoding(RelationshipReferenceEncoding.encodeForFiltering(reference)), equalTo(reference));
                assertThat(clearEncoding(RelationshipReferenceEncoding.encodeForTxStateFiltering(reference)), equalTo(reference));
                assertThat(clearEncoding(RelationshipReferenceEncoding.encodeNoIncomingRels(token)), equalTo(( long )token));
                assertThat(clearEncoding(RelationshipReferenceEncoding.encodeNoOutgoingRels(token)), equalTo(( long )token));
                assertThat(clearEncoding(RelationshipReferenceEncoding.encodeNoLoopRels(token)), equalTo(( long )token));

                assertThat(clearEncoding(GroupReferenceEncoding.EncodeRelationship(reference)), equalTo(reference));
            }
        }
Beispiel #4
0
 public override long RelationshipGroupReference()
 {
     return(Dense ? NextRel : GroupReferenceEncoding.EncodeRelationship(NextRel));
 }