Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRecreateSchemaRuleWhenDeleteCommandReadFromDisk() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRecreateSchemaRuleWhenDeleteCommandReadFromDisk()
        {
            // GIVEN
            SchemaRecord beforeRecords = Serialize(_rule, _id, true, true);
            SchemaRecord afterRecords  = Serialize(_rule, _id, false, false);

            Command.SchemaRuleCommand command = new Command.SchemaRuleCommand(beforeRecords, afterRecords, _rule);
            InMemoryClosableChannel   buffer  = new InMemoryClosableChannel();

            when(_neoStores.SchemaStore).thenReturn(_schemaStore);

            // WHEN
            command.Serialize(buffer);
            Command readCommand = _reader.read(buffer);

            // THEN
            assertThat(readCommand, instanceOf(typeof(Command.SchemaRuleCommand)));

            AssertSchemaRule((Command.SchemaRuleCommand)readCommand);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void visitSchemaRuleCommand(org.neo4j.kernel.impl.api.BatchTransactionApplier applier, org.neo4j.kernel.impl.transaction.command.Command.SchemaRuleCommand command) throws Exception
        private void VisitSchemaRuleCommand(BatchTransactionApplier applier, Command.SchemaRuleCommand command)
        {
            TransactionToApply tx = new TransactionToApply(new PhysicalTransactionRepresentation(singletonList(command)), _txId);

            CommandHandlerContract.apply(applier, tx);
        }
Esempio n. 3
0
 private void AssertSchemaRule(Command.SchemaRuleCommand readSchemaCommand)
 {
     assertEquals(_id, readSchemaCommand.Key);
     assertTrue(SchemaDescriptorPredicates.hasLabel(readSchemaCommand.SchemaRule, _labelId));
     assertTrue(SchemaDescriptorPredicates.hasProperty(readSchemaCommand.SchemaRule, _propertyKey));
 }