示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(timeout = TEST_TIMEOUT) public void indexCreationDoNotBlockWritesOnOtherLabel() throws java.util.concurrent.ExecutionException, InterruptedException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void IndexCreationDoNotBlockWritesOnOtherLabel()
        {
            Label markerLabel = Label.label("testLabel3");
            Label nodesLabel  = Label.label("testLabel4");

            using (Transaction transaction = _database.beginTx())
            {
                _database.schema().indexFor(markerLabel).on("testProperty").create();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.concurrent.Future<?> creation = executorService.submit(createNodeWithLabel(nodesLabel));
                Future <object> creation = _executorService.submit(CreateNodeWithLabel(nodesLabel));
                creation.get();

                transaction.Success();
            }

            using (Transaction transaction = _database.beginTx())
            {
                using (ResourceIterator <Node> nodes = _database.findNodes(nodesLabel))
                {
                    assertEquals(1, Iterators.count(nodes));
                }
            }
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSupportIndexSeek()
        public virtual void ShouldSupportIndexSeek()
        {
            // GIVEN
            CreateNodes(_db, _label, _nonMatching);
            LongSet expected = CreateNodes(_db, _label, _matching);

            // WHEN
            MutableLongSet found = new LongHashSet();

            using (Transaction tx = _db.beginTx())
            {
                CollectNodes(found, _db.findNodes(_label, _key, _template, _searchMode));
            }

            // THEN
            assertThat(found, equalTo(expected));
        }