//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Before public void before() public virtual void Before() { _indexMap = new IndexMap(); _indexProxy1 = mock(typeof(IndexProxy)); _schemaIndexDescriptor1 = forSchema(forLabel(2, 3), PROVIDER_DESCRIPTOR).withId(0).withoutCapabilities(); _indexUpdater1 = mock(typeof(IndexUpdater)); when(_indexProxy1.Descriptor).thenReturn(_schemaIndexDescriptor1); when(_indexProxy1.newUpdater(any(typeof(IndexUpdateMode)))).thenReturn(_indexUpdater1); _indexProxy2 = mock(typeof(IndexProxy)); _schemaIndexDescriptor2 = forSchema(forLabel(5, 6), PROVIDER_DESCRIPTOR).withId(1).withoutCapabilities(); IndexUpdater indexUpdater2 = mock(typeof(IndexUpdater)); when(_indexProxy2.Descriptor).thenReturn(_schemaIndexDescriptor2); when(_indexProxy2.newUpdater(any(typeof(IndexUpdateMode)))).thenReturn(indexUpdater2); _indexProxy3 = mock(typeof(IndexProxy)); _schemaIndexDescriptor3 = forSchema(forLabel(5, 7, 8), PROVIDER_DESCRIPTOR).withId(2).withoutCapabilities(); IndexUpdater indexUpdater3 = mock(typeof(IndexUpdater)); when(_indexProxy3.Descriptor).thenReturn(_schemaIndexDescriptor3); when(_indexProxy3.newUpdater(any(typeof(IndexUpdateMode)))).thenReturn(indexUpdater3); _updaterMap = new IndexUpdaterMap(_indexMap, IndexUpdateMode.Online); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRetrieveNoUpdaterForNonExistingIndex() public virtual void ShouldRetrieveNoUpdaterForNonExistingIndex() { // when IndexUpdater updater = _updaterMap.getUpdater(_schemaIndexDescriptor1.schema()); // then assertNull(updater); assertTrue("updater map must be empty", _updaterMap.Empty); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRetrieveUpdateUsingLabelAndProperty() public virtual void ShouldRetrieveUpdateUsingLabelAndProperty() { // given _indexMap.putIndexProxy(_indexProxy1); // when IndexUpdater updater = _updaterMap.getUpdater(_schemaIndexDescriptor1.schema()); // then assertThat(updater, equalTo(_indexUpdater1)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRetrieveUpdaterFromIndexMapForExistingIndex() public virtual void ShouldRetrieveUpdaterFromIndexMapForExistingIndex() { // given _indexMap.putIndexProxy(_indexProxy1); // when IndexUpdater updater = _updaterMap.getUpdater(_schemaIndexDescriptor1.schema()); // then assertEquals(_indexUpdater1, updater); assertEquals(1, _updaterMap.size()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldCloseAllUpdaters() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldCloseAllUpdaters() { // given _indexMap.putIndexProxy(_indexProxy1); _indexMap.putIndexProxy(_indexProxy2); IndexUpdater updater1 = _updaterMap.getUpdater(_schemaIndexDescriptor1.schema()); IndexUpdater updater2 = _updaterMap.getUpdater(_schemaIndexDescriptor2.schema()); // hen _updaterMap.close(); // then verify(updater1).close(); verify(updater2).close(); assertTrue("updater map must be empty", _updaterMap.Empty); }
public DelegatingIndexUpdaterAnonymousInnerClass(ContractCheckingIndexProxy outerInstance, IndexUpdater newUpdater) : base(newUpdater) { this.outerInstance = outerInstance; }