//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSeeCorrectDirectoriesForSubProvider()
        public virtual void ShouldSeeCorrectDirectoriesForSubProvider()
        {
            IndexDirectoryStructure parentStructure = directoriesByProvider(_databaseStoreDir).forProvider(_provider);
            IndexProviderDescriptor subProvider     = new IndexProviderDescriptor("sub", "0.3");

            AssertCorrectDirectories(directoriesBySubProvider(parentStructure).forProvider(subProvider), path(_baseIndexDirectory, _provider.Key + "-" + _provider.Version), path(_baseIndexDirectory, _provider.Key + "-" + _provider.Version, _indexId.ToString(), subProvider.Key + "-" + subProvider.Version));
        }
Exemplo n.º 2
0
 protected internal IndexProvider(IndexProviderDescriptor descriptor, IndexDirectoryStructure.Factory directoryStructureFactory)
 {
     this._directoryStructureFactory = directoryStructureFactory;
     Debug.Assert(descriptor != null);
     this._providerDescriptor = descriptor;
     this._directoryStructure = directoryStructureFactory.ForProvider(descriptor);
 }
        private void AssertCorrectDirectories(IndexDirectoryStructure directoryStructure, File expectedRootDirectory, File expectedIndexDirectory)
        {
            // when
            File rootDirectory  = directoryStructure.RootDirectory();
            File indexDirectory = directoryStructure.DirectoryForIndex(_indexId);

            // then
            assertEquals(expectedRootDirectory, rootDirectory);
            assertEquals(expectedIndexDirectory, indexDirectory);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Useful when combining multiple <seealso cref="IndexProvider"/> into one.
 /// </summary>
 /// <param name="parentStructure"> <seealso cref="IndexDirectoryStructure"/> of the parent. </param>
 /// <returns> <seealso cref="Factory"/> creating <seealso cref="IndexDirectoryStructure"/> looking something like:
 ///
 /// <pre>
 /// &lt;db&gt;/schema/index/.../&lt;indexId&gt;/&lt;childProviderKey&gt;-&lt;childProviderVersion&gt;/
 /// </pre> </returns>
 public static Factory DirectoriesBySubProvider(IndexDirectoryStructure parentStructure)
 {
     return(descriptor => new IndexDirectoryStructureAnonymousInnerClass(parentStructure));
 }
Exemplo n.º 5
0
 /// <param name="directoryStructure"> existing <seealso cref="IndexDirectoryStructure"/>. </param>
 /// <returns> a <seealso cref="Factory"/> returning an already existing <seealso cref="IndexDirectoryStructure"/>. </returns>
 public static Factory Given(IndexDirectoryStructure directoryStructure)
 {
     return(descriptor => directoryStructure);
 }