コード例 #1
0
ファイル: IdContainerTest.cs プロジェクト: Neo4Net/Neo4Net
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void includeFileNameIntoReadHeaderException() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void IncludeFileNameIntoReadHeaderException()
        {
            CreateEmptyFile();
            _fs.truncate(_file, 0);

            try
            {
                IdContainer idContainer = new IdContainer(_fs, _file, 100, false);
                idContainer.Init();
            }
            catch (InvalidIdGeneratorException e)
            {
                assertThat(e.Message, Matchers.containsString(_file.AbsolutePath));
            }
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotReturnPrunedReaders() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNotReturnPrunedReaders()
        {
            Reader readerA = _pool.acquire(0, 0);
            Reader readerB = _pool.acquire(0, 0);

            _pool.release(readerA);
            _pool.release(readerB);

            _clock.forward(2, MINUTES);
            _pool.prune(1, MINUTES);

            // when
            Reader readerC = _pool.acquire(0, 0);
            Reader readerD = _pool.acquire(0, 0);

            // then
            assertThat(asSet(readerC, readerD), not(Matchers.containsInAnyOrder(readerA, readerB)));
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotDuplicateToAnyLog()
        public virtual void ShouldNotDuplicateToAnyLog()
        {
            AssertableLogProvider userLogProvider  = new AssertableLogProvider();
            AssertableLogProvider debugLogProvider = new AssertableLogProvider();

            SimpleLogService logService = new SimpleLogService(userLogProvider, debugLogProvider);

            Monitors monitors = new Monitors();

            CoreMonitor.Register(logService.InternalLogProvider, logService.UserLogProvider, monitors);

            ClusterBinder.Monitor monitor = monitors.NewMonitor(typeof(ClusterBinder.Monitor));

            ClusterId clusterId = new ClusterId(System.Guid.randomUUID());

            monitor.BoundToCluster(clusterId);

            userLogProvider.RawMessageMatcher().assertContainsSingle(Matchers.allOf(Matchers.containsString("Bound to cluster with id " + clusterId.Uuid())));

            debugLogProvider.RawMessageMatcher().assertContainsSingle(Matchers.allOf(Matchers.containsString("Bound to cluster with id " + clusterId.Uuid())));
        }
コード例 #4
0
 private void AssertRecord(PropertyRecord record, ExpectedRecord expectedRecord)
 {
     assertEquals(expectedRecord.Properties.Length, record.NumberOfProperties());
     foreach (ExpectedProperty expectedProperty in expectedRecord.Properties)
     {
         PropertyBlock block = record.GetPropertyBlock(expectedProperty.Key);
         assertNotNull(block);
         assertEquals(expectedProperty.Value, block.Type.value(block, _propertyStore));
         if (expectedProperty.AssertHasDynamicRecords != null)
         {
             if (expectedProperty.AssertHasDynamicRecords.Value)
             {
                 assertThat(block.ValueRecords.Count, Matchers.greaterThan(0));
             }
             else
             {
                 assertEquals(0, block.ValueRecords.Count);
             }
         }
     }
 }
コード例 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotGetEagerPlanForANonEagerProcedure()
        public virtual void ShouldNotGetEagerPlanForANonEagerProcedure()
        {
            // When explaining a call to an non-eagerized procedure
            Result res = _db.execute("EXPLAIN MATCH (n) WHERE n.key = 'value' " + "WITH n CALL org.neo4j.procedure.deleteNeighboursNotEagerized(n, 'FOLLOWS') " + "YIELD value RETURN value");

            assertThat("The plan description shouldn't contain the 'Eager' operation", res.ExecutionPlanDescription.ToString(), Matchers.not(containsString("+Eager")));
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void migrateHighLimit3_0StoreFiles() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void MigrateHighLimit3_0StoreFiles()
        {
            FileSystemAbstraction fileSystem = _fileSystemRule.get();
            PageCache             pageCache  = _pageCacheRule.getPageCache(fileSystem);

            using (JobScheduler jobScheduler = new ThreadPoolJobScheduler())
            {
                StoreMigrator migrator = new StoreMigrator(fileSystem, pageCache, Config.defaults(), NullLogService.Instance, jobScheduler);

                DatabaseLayout databaseLayout  = _testDirectory.databaseLayout();
                DatabaseLayout migrationLayout = _testDirectory.databaseLayout("migration");

                PrepareNeoStoreFile(fileSystem, databaseLayout, HighLimitV3_0_0.STORE_VERSION, pageCache);

                ProgressReporter progressMonitor = mock(typeof(ProgressReporter));

                migrator.Migrate(databaseLayout, migrationLayout, progressMonitor, HighLimitV3_0_0.STORE_VERSION, HighLimit.StoreVersion);

                int newStoreFilesCount = fileSystem.ListFiles(migrationLayout.DatabaseDirectory()).Length;
                assertThat("Store should be migrated and new store files should be created.", newStoreFilesCount, Matchers.greaterThanOrEqualTo(StoreType.values().length));
            }
        }