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());
}
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;
}
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);
}
Aggregations