Search in sources :

Example 1 with DataFileConfiguration

use of org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration in project indy by Commonjava.

the class SetBackSettingsManagerTest method setup.

@Before
public void setup() throws Exception {
    storeManager = new MemoryStoreDataManager(true);
    final File dataSrc = new File("./src/main/data");
    final File data = temp.newFolder("data");
    FileUtils.copyDirectory(dataSrc, data);
    final DataFileConfiguration config = new DataFileConfiguration(data, temp.newFolder("work"));
    final DataFileManager fileManager = new DataFileManager(config, new DataFileEventManager());
    final TemplatingEngine templates = new TemplatingEngine(new GStringTemplateEngine(), fileManager);
    manager = new SetBackSettingsManager(storeManager, templates, fileManager, new SetbackConfig(true));
}
Also used : MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) TemplatingEngine(org.commonjava.indy.subsys.template.TemplatingEngine) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) GStringTemplateEngine(groovy.text.GStringTemplateEngine) SetbackConfig(org.commonjava.indy.setback.conf.SetbackConfig) DataFile(org.commonjava.indy.subsys.datafile.DataFile) File(java.io.File) Before(org.junit.Before)

Example 2 with DataFileConfiguration

use of org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration in project indy by Commonjava.

the class DataFileTCKFixtureProvider method before.

@Override
protected void before() throws Throwable {
    super.before();
    configDir = newFolder("db");
    final IndyObjectMapper serializer = new IndyObjectMapper(true);
    dataManager = new TestFlatFileDataManager(new DataFileConfiguration().withDataBasedir(configDir), serializer);
    dataManager.install();
    dataManager.clear(new ChangeSummary(ChangeSummary.SYSTEM_USER, "Setting up test"));
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) ChangeSummary(org.commonjava.indy.audit.ChangeSummary)

Example 3 with DataFileConfiguration

use of org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration in project indy by Commonjava.

the class TestProvider method init.

@PostConstruct
public void init() {
    try {
        this.storageProviderConfig = new DefaultStorageProviderConfiguration(TEMP.newFolder("storage"));
        this.dataConfig = new DataFileConfiguration(TEMP.newFolder("data"), TEMP.newFolder("work"));
    } catch (final IOException e) {
        e.printStackTrace();
        Assert.fail("Failed to setup temporary directory structures: " + e.getMessage());
    }
    this.nfc = new MemoryNotFoundCache();
    this.xmlInfra = new XMLInfrastructure();
    this.typeMapper = new StandardTypeMapper();
    this.indyConfig = new DefaultIndyConfiguration();
    this.objectMapper = new IndyObjectMapper(true);
}
Also used : DefaultStorageProviderConfiguration(org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration) IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) DefaultIndyConfiguration(org.commonjava.indy.conf.DefaultIndyConfiguration) PostConstruct(javax.annotation.PostConstruct)

Example 4 with DataFileConfiguration

use of org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration in project indy by Commonjava.

the class CoreServerProvider method init.

@PostConstruct
public void init() {
    try {
        folder.create();
        this.nfc = new MemoryNotFoundCache();
        this.dataFileManager = new DataFileManager(new DataFileConfiguration(folder.newFolder("indy-data")), dataFileEvents);
        this.storeManager = new DataFileStoreDataManager(dataFileManager, objectMapper, storeDispatch);
        storageConfig.setStorageRootDirectory(folder.newFolder("indy-storage"));
        this.xml = new XMLInfrastructure();
        this.typeMapper = new StandardTypeMapper();
    } catch (IOException e) {
        throw new IllegalStateException("Failed to start core server provider: " + e.getMessage(), e);
    }
}
Also used : DataFileStoreDataManager(org.commonjava.indy.flat.data.DataFileStoreDataManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) XMLInfrastructure(org.commonjava.maven.galley.maven.parse.XMLInfrastructure) MemoryNotFoundCache(org.commonjava.maven.galley.nfc.MemoryNotFoundCache) IOException(java.io.IOException) StandardTypeMapper(org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper) PostConstruct(javax.annotation.PostConstruct)

Example 5 with DataFileConfiguration

use of org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration in project indy by Commonjava.

the class DataFileStoreDataManagerTest method setup.

@Before
public void setup() throws Exception {
    fileCfg = new DataFileConfiguration(temp.newFolder("data"), temp.newFolder("work"));
    final DataFileManager fileMgr = new DataFileManager(fileCfg, new DataFileEventManager());
    mgr = new DataFileStoreDataManager(fileMgr, new IndyObjectMapper(false), new StoreEventDispatcherStub());
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) DataFileEventManager(org.commonjava.indy.subsys.datafile.change.DataFileEventManager) DataFileManager(org.commonjava.indy.subsys.datafile.DataFileManager) DataFileConfiguration(org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration) StoreEventDispatcherStub(org.commonjava.indy.core.data.testutil.StoreEventDispatcherStub) Before(org.junit.Before)

Aggregations

DataFileConfiguration (org.commonjava.indy.subsys.datafile.conf.DataFileConfiguration)6 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)3 DataFileManager (org.commonjava.indy.subsys.datafile.DataFileManager)3 Before (org.junit.Before)3 File (java.io.File)2 IOException (java.io.IOException)2 PostConstruct (javax.annotation.PostConstruct)2 DataFileEventManager (org.commonjava.indy.subsys.datafile.change.DataFileEventManager)2 StandardTypeMapper (org.commonjava.maven.galley.maven.internal.type.StandardTypeMapper)2 XMLInfrastructure (org.commonjava.maven.galley.maven.parse.XMLInfrastructure)2 MemoryNotFoundCache (org.commonjava.maven.galley.nfc.MemoryNotFoundCache)2 GStringTemplateEngine (groovy.text.GStringTemplateEngine)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 DefaultIndyConfiguration (org.commonjava.indy.conf.DefaultIndyConfiguration)1 StoreEventDispatcherStub (org.commonjava.indy.core.data.testutil.StoreEventDispatcherStub)1 DefaultStorageProviderConfiguration (org.commonjava.indy.filer.def.conf.DefaultStorageProviderConfiguration)1 DataFileStoreDataManager (org.commonjava.indy.flat.data.DataFileStoreDataManager)1 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)1 SetbackConfig (org.commonjava.indy.setback.conf.SetbackConfig)1 DataFile (org.commonjava.indy.subsys.datafile.DataFile)1