Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetEmptyUsernameForAnonymousContext()
        public virtual void ShouldGetEmptyUsernameForAnonymousContext()
        {
            when(_transaction.securityContext()).thenReturn(AnonymousContext.read().authorize(s => - 1, GraphDatabaseSettings.DEFAULT_DATABASE_NAME));

            TxStateTransactionDataSnapshot transactionDataSnapshot = Snapshot();

            assertEquals("", transactionDataSnapshot.Username());
        }
Beispiel #2
0
 protected internal override long FetchNext()
 {
     Ktx.assertOpen();
     while (Cursor.next())
     {
         long reference = Cursor.relationshipReference();
         if (Ktx.dataRead().relationshipExists(reference))
         {
             return(reference);
         }
         else if (Ktx.securityContext().mode().allowsWrites())
         {
             //remove it from index so it doesn't happen again
             try
             {
                 RELATIONSHIP.remove(Ktx.indexWrite(), Name, reference);
             }
             catch (Exception e) when(e is ExplicitIndexNotFoundKernelException || e is InvalidTransactionTypeKernelException)
             {
                 //ignore
             }
         }
     }
     Close();
     return(NO_ID);
 }
Beispiel #3
0
 public override SecurityContext SecurityContext()
 {
     return(_transaction.securityContext());
 }
Beispiel #4
0
 public override SecurityContext SecurityContext()
 {
     return(Internal.securityContext());
 }