Esempio n. 1
0
 public NodeImporter(BatchingNeoStores stores, IdMapper idMapper, Monitor monitor) : base(stores, monitor)
 {
     this._labelTokenRepository = stores.LabelRepository;
     this._idMapper             = idMapper;
     this._nodeStore            = stores.NodeStore;
     this._nodeRecord           = _nodeStore.newRecord();
     this._nodeIds          = new BatchingIdGetter(_nodeStore);
     this._idPropertyStore  = stores.TemporaryPropertyStore;
     this._idPropertyRecord = _idPropertyStore.newRecord();
     _nodeRecord.InUse      = true;
 }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldDedupLabelIds()
        public virtual void ShouldDedupLabelIds()
        {
            // GIVEN
            BatchingLabelTokenRepository repo = new BatchingLabelTokenRepository(mock(typeof(TokenStore)));

            // WHEN
            long[] ids = repo.GetOrCreateIds(new string[] { "One", "Two", "One" });

            // THEN
            assertTrue(NodeLabelsField.isSane(ids));
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSortLabelIds()
        public virtual void ShouldSortLabelIds()
        {
            // GIVEN
            BatchingLabelTokenRepository repo = new BatchingLabelTokenRepository(mock(typeof(TokenStore)));

            long[] expected = new long[] { repo.GetOrCreateId("One"), repo.GetOrCreateId("Two"), repo.GetOrCreateId("Three") };

            // WHEN
            long[] ids = repo.GetOrCreateIds(new string[] { "Two", "One", "Three" });

            // THEN
            assertArrayEquals(expected, ids);
            assertTrue(NodeLabelsField.isSane(ids));
        }