Search in sources :

Example 1 with FileRegistry

use of com.yahoo.config.application.api.FileRegistry in project vespa by vespa-engine.

the class PreGeneratedFileRegistryTestCase method importAndExport.

@Test
public void importAndExport() {
    FileRegistry fileRegistry = new MockFileRegistry();
    String serializedRegistry = PreGeneratedFileRegistry.exportRegistry(fileRegistry);
    PreGeneratedFileRegistry importedRegistry = PreGeneratedFileRegistry.importRegistry(new StringReader(serializedRegistry));
    assertTrue(importedRegistry.getPaths().containsAll(Arrays.asList(MockFileRegistry.entry1.relativePath, MockFileRegistry.entry2.relativePath)));
    assertEquals(2, importedRegistry.getPaths().size());
    checkConsistentEntry(MockFileRegistry.entry1, importedRegistry);
    checkConsistentEntry(MockFileRegistry.entry2, importedRegistry);
    assertEquals(fileRegistry.fileSourceHost(), importedRegistry.fileSourceHost());
}
Also used : StringReader(java.io.StringReader) FileRegistry(com.yahoo.config.application.api.FileRegistry) Test(org.junit.Test)

Example 2 with FileRegistry

use of com.yahoo.config.application.api.FileRegistry in project vespa by vespa-engine.

the class ZooKeeperClientTest method createFileRegistries.

private Map<Version, FileRegistry> createFileRegistries() {
    FileRegistry a = new MockFileRegistry();
    a.addFile("fileA");
    FileRegistry b = new MockFileRegistry();
    b.addFile("fileB");
    Map<Version, FileRegistry> registryMap = new HashMap<>();
    registryMap.put(Version.fromIntValues(1, 2, 3), a);
    registryMap.put(Version.fromIntValues(3, 2, 1), b);
    return registryMap;
}
Also used : FileRegistry(com.yahoo.config.application.api.FileRegistry)

Example 3 with FileRegistry

use of com.yahoo.config.application.api.FileRegistry in project vespa by vespa-engine.

the class ZooKeeperClientTest method setupZK.

@Before
public void setupZK() throws IOException {
    this.zk = ConfigCurator.create(curator);
    ZooKeeperClient zkc = new ZooKeeperClient(zk, new BaseDeployLogger(), true, Path.fromString(appPath));
    ApplicationPackage app = FilesApplicationPackage.fromFileWithDeployData(new File("src/test/apps/zkfeed"), new DeployData("foo", "/bar/baz", "appName", 1345l, 3l, 2l));
    Map<Version, FileRegistry> fileRegistries = createFileRegistries();
    app.writeMetaData();
    zkc.setupZooKeeper();
    zkc.write(app);
    zkc.write(fileRegistries);
}
Also used : FileRegistry(com.yahoo.config.application.api.FileRegistry) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) ZKApplicationPackage(com.yahoo.vespa.config.server.zookeeper.ZKApplicationPackage) File(java.io.File) Before(org.junit.Before)

Aggregations

FileRegistry (com.yahoo.config.application.api.FileRegistry)3 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)1 ZKApplicationPackage (com.yahoo.vespa.config.server.zookeeper.ZKApplicationPackage)1 File (java.io.File)1 StringReader (java.io.StringReader)1 Before (org.junit.Before)1 Test (org.junit.Test)1