Ejemplo n.º 1
0
            internal Phase(string name, InnerEnum innerEnum, Org.Neo4j.Kernel.Api.Exceptions.Status status)
            {
                this._status = status;

                nameValue      = name;
                ordinalValue   = nextOrdinal++;
                innerEnumValue = innerEnum;
            }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldEnforcePropertyExistenceConstraintWhenCreatingEntityWithoutProperty() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldEnforcePropertyExistenceConstraintWhenCreatingEntityWithoutProperty()
            {
                // given
                CreateConstraint("Type1", "key1");

                Transaction transaction = NewTransaction(AnonymousContext.writeToken());

                // when
                CreateEntity(transaction, "Type1");
                try
                {
                    Commit();
                    fail("should have thrown exception");
                }
                // then
                catch (ConstraintViolationTransactionFailureException e)
                {
                    Status expected = Org.Neo4j.Kernel.Api.Exceptions.Status_Schema.ConstraintValidationFailed;
                    assertThat(e.Status(), @is(expected));
                }
            }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldEnforceConstraintWhenRemoving() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
            public virtual void ShouldEnforceConstraintWhenRemoving()
            {
                // given
                long        entity      = CreateConstraintAndEntity("Type1", "key1", "value1");
                Transaction transaction = NewTransaction(AnonymousContext.writeToken());

                // when
                int key = transaction.TokenWrite().propertyKeyGetOrCreateForName("key1");

                RemoveProperty(transaction.DataWrite(), entity, key);
                try
                {
                    Commit();
                    fail("should have thrown exception");
                }
                // then
                catch (ConstraintViolationTransactionFailureException e)
                {
                    Status expected = Org.Neo4j.Kernel.Api.Exceptions.Status_Schema.ConstraintValidationFailed;
                    assertThat(e.Status(), @is(expected));
                }
            }
Ejemplo n.º 4
0
 public FailureMessage(Status status, string message)
 {
     this._status  = status;
     this._message = message;
 }
Ejemplo n.º 5
0
 internal HasStatus(Status status)
 {
     this.Status = status;
 }
Ejemplo n.º 6
0
 private HasStatus HasStatus(Status status)
 {
     return(new HasStatus(status));
 }
Ejemplo n.º 7
0
 public FatalFailureMessage(Status status, string message) : base(status, message)
 {
 }
 protected internal TransactionTerminatedException(Status status, string additionalInfo) : base("The transaction has been terminated. Retry your operation in a new transaction, " + "and you should see a successful result. " + status.Code().description() + " " + additionalInfo)
 {
     this._status = status;
 }
 public TransactionTerminatedException(Status status) : this(status, "")
 {
 }