Search in sources :

Example 6 with MockFileRegistry

use of com.yahoo.config.model.application.provider.MockFileRegistry 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));
}
Also used : ModelContext(com.yahoo.config.model.api.ModelContext) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) Version(com.yahoo.component.Version) Zone(com.yahoo.config.provision.Zone) ModelContextImpl(com.yahoo.vespa.config.server.deploy.ModelContextImpl) Rotation(com.yahoo.config.provision.Rotation) MockFileRegistry(com.yahoo.config.model.application.provider.MockFileRegistry) Test(org.junit.Test)

Aggregations

MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)6 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)3 ModelContext (com.yahoo.config.model.api.ModelContext)2 ModelContextImpl (com.yahoo.vespa.config.server.deploy.ModelContextImpl)2 SessionZooKeeperClient (com.yahoo.vespa.config.server.session.SessionZooKeeperClient)2 Test (org.junit.Test)2 Version (com.yahoo.component.Version)1 FileReference (com.yahoo.config.FileReference)1 ConfigModelContext (com.yahoo.config.model.ConfigModelContext)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1 MockHosts (com.yahoo.config.model.test.MockHosts)1 Rotation (com.yahoo.config.provision.Rotation)1 Zone (com.yahoo.config.provision.Zone)1 ServerCache (com.yahoo.vespa.config.server.ServerCache)1 TestConfigDefinitionRepo (com.yahoo.vespa.config.server.TestConfigDefinitionRepo)1 Application (com.yahoo.vespa.config.server.application.Application)1 ZooKeeperClient (com.yahoo.vespa.config.server.deploy.ZooKeeperClient)1 ZooKeeperDeployer (com.yahoo.vespa.config.server.deploy.ZooKeeperDeployer)1 MetricUpdater (com.yahoo.vespa.config.server.monitoring.MetricUpdater)1 RemoteSession (com.yahoo.vespa.config.server.session.RemoteSession)1