Search in sources :

Example 1 with FileStorageIO

use of org.apache.solr.rest.ManagedResourceStorage.FileStorageIO in project lucene-solr by apache.

the class TestManagedResourceStorage method testFileBasedJsonStorage.

/**
   * Runs persisted managed resource creation and update tests on JSON storage.
   */
@Test
public void testFileBasedJsonStorage() throws Exception {
    File instanceDir = createTempDir("json-storage").toFile();
    SolrResourceLoader loader = new SolrResourceLoader(instanceDir.toPath());
    try {
        NamedList<String> initArgs = new NamedList<>();
        String managedDir = instanceDir.getAbsolutePath() + File.separator + "managed";
        initArgs.add(ManagedResourceStorage.STORAGE_DIR_INIT_ARG, managedDir);
        FileStorageIO fileStorageIO = new FileStorageIO();
        fileStorageIO.configure(loader, initArgs);
        doStorageTests(loader, fileStorageIO);
    } finally {
        loader.close();
    }
}
Also used : SolrResourceLoader(org.apache.solr.core.SolrResourceLoader) FileStorageIO(org.apache.solr.rest.ManagedResourceStorage.FileStorageIO) NamedList(org.apache.solr.common.util.NamedList) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 NamedList (org.apache.solr.common.util.NamedList)1 SolrResourceLoader (org.apache.solr.core.SolrResourceLoader)1 FileStorageIO (org.apache.solr.rest.ManagedResourceStorage.FileStorageIO)1 Test (org.junit.Test)1