use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class FileSenderTest method require_that_leaf_maps_are_modified.
@Test
public void require_that_leaf_maps_are_modified() {
def.leafMapDef("fileMap").setTypeSpec(new ConfigDefinition.TypeSpec("fileMap", "file", null, null, null, null));
def.leafMapDef("pathMap").setTypeSpec(new ConfigDefinition.TypeSpec("pathMap", "path", null, null, null, null));
def.leafMapDef("stringMap").setTypeSpec(new ConfigDefinition.TypeSpec("stringMap", "string", null, null, null, null));
builder.getMap("fileMap").put("foo", "foo.txt");
builder.getMap("fileMap").put("bar", "bar.txt");
builder.getMap("pathMap").put("path", "path.txt");
builder.getMap("stringMap").put("bar", "bar.txt");
service.pathToRef.put("foo.txt", new FileNode("foohash").value());
service.pathToRef.put("bar.txt", new FileNode("barhash").value());
service.pathToRef.put("path.txt", new FileNode("pathhash").value());
FileSender.sendUserConfiguredFiles(producer, serviceList, new BaseDeployLogger());
assertThat(builder.getMap("fileMap").get("foo").getValue(), is("foohash"));
assertThat(builder.getMap("fileMap").get("bar").getValue(), is("barhash"));
assertThat(builder.getMap("pathMap").get("path").getValue(), is("pathhash"));
assertThat(builder.getMap("stringMap").get("bar").getValue(), is("bar.txt"));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class SessionActiveHandlerTest method createRemoteSession.
private RemoteSession createRemoteSession(long sessionId, Session.Status status, SessionZooKeeperClient zkClient, Clock clock) throws IOException {
zkClient.writeStatus(status);
ZooKeeperClient zkC = new ZooKeeperClient(configCurator, new BaseDeployLogger(), false, Tenants.getSessionsPath(tenant).append(String.valueOf(sessionId)));
zkC.write(Collections.singletonMap(modelFactory.getVersion(), new MockFileRegistry()));
zkC.write(AllocatedHosts.withHosts(Collections.emptySet()));
RemoteSession session = new RemoteSession(TenantName.from("default"), sessionId, componentRegistry, zkClient, clock);
remoteSessionRepo.addSession(session);
return session;
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class TenantRequestHandlerTest method feedApp.
private void feedApp(File appDir, long sessionId, ApplicationId appId) throws IOException {
SessionZooKeeperClient zkc = new SessionZooKeeperClient(curator, configCurator, Tenants.getSessionsPath(tenant).append(String.valueOf(sessionId)), new TestConfigDefinitionRepo(), "", Optional.empty());
zkc.writeApplicationId(appId);
File app = tempFolder.newFolder();
IOUtils.copyDirectory(appDir, app);
ZooKeeperDeployer deployer = zkc.createDeployer(new BaseDeployLogger());
deployer.deploy(FilesApplicationPackage.fromFile(appDir), Collections.singletonMap(vespaVersion, new MockFileRegistry()), AllocatedHosts.withHosts(Collections.emptySet()));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class ModelContextImplTest method testModelContextTest.
@Test
public void testModelContextTest() {
final Rotation rotation = new Rotation("this.is.a.mock.rotation");
final Set<Rotation> rotations = Collections.singleton(rotation);
ModelContext context = new ModelContextImpl(MockApplicationPackage.createEmpty(), Optional.empty(), Optional.empty(), new BaseDeployLogger(), new StaticConfigDefinitionRepo(), new MockFileRegistry(), Optional.empty(), new ModelContextImpl.Properties(ApplicationId.defaultId(), true, Collections.emptyList(), null, false, Zone.defaultZone(), rotations), Optional.empty(), new Version(6), new Version(6));
assertTrue(context.applicationPackage() instanceof MockApplicationPackage);
assertFalse(context.hostProvisioner().isPresent());
assertFalse(context.permanentApplicationPackage().isPresent());
assertFalse(context.previousModel().isPresent());
assertTrue(context.getFileRegistry() instanceof MockFileRegistry);
assertTrue(context.configDefinitionRepo() instanceof StaticConfigDefinitionRepo);
assertThat(context.properties().applicationId(), is(ApplicationId.defaultId()));
assertTrue(context.properties().configServerSpecs().isEmpty());
assertTrue(context.properties().multitenant());
assertTrue(context.properties().zone() instanceof Zone);
assertFalse(context.properties().hostedVespa());
assertThat(context.properties().rotations(), equalTo(rotations));
}
Aggregations