use of com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry in project vespa by vespa-engine.
the class DeployTester method createComponentRegistry.
private TestComponentRegistry createComponentRegistry(Curator curator, Metrics metrics, List<ModelFactory> modelFactories, ConfigserverConfig configserverConfig, Clock clock) {
TestComponentRegistry.Builder builder = new TestComponentRegistry.Builder();
if (configserverConfig.hostedVespa()) {
builder.provisioner(createHostProvisioner());
}
builder.configServerConfig(configserverConfig).curator(curator).modelFactoryRegistry(new ModelFactoryRegistry(modelFactories)).metrics(metrics).clock(clock);
return builder.build();
}
use of com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry in project vespa by vespa-engine.
the class ModelFactoryRegistryTest method testThatAllFactoriesAreReturned.
@Test
public void testThatAllFactoriesAreReturned() {
TestFactory a = new TestFactory(Version.fromIntValues(5, 38, 4));
TestFactory b = new TestFactory(Version.fromIntValues(5, 58, 1));
TestFactory c = new TestFactory(Version.fromIntValues(5, 48, 44));
TestFactory d = new TestFactory(Version.fromIntValues(5, 18, 44));
ModelFactoryRegistry registry = new ModelFactoryRegistry(Arrays.asList(a, b, c, d));
assertThat(registry.getFactories().size(), is(4));
assertTrue(registry.getFactories().contains(a));
assertTrue(registry.getFactories().contains(b));
assertTrue(registry.getFactories().contains(c));
assertTrue(registry.getFactories().contains(d));
}
use of com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry in project vespa by vespa-engine.
the class ModelFactoryRegistryTest method testThatUnknownVersionGivesError.
@Test(expected = UnknownVespaVersionException.class)
public void testThatUnknownVersionGivesError() {
ModelFactoryRegistry registry = new ModelFactoryRegistry(Arrays.asList(new TestFactory(Version.fromIntValues(1, 2, 3))));
registry.getFactory(Version.fromIntValues(3, 2, 1));
}
use of com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry in project vespa by vespa-engine.
the class SessionActiveHandlerTest method setup.
@Before
public void setup() throws Exception {
remoteSessionRepo = new RemoteSessionRepo(tenant);
applicationRepo = new MemoryTenantApplications();
curator = new MockCurator();
configCurator = ConfigCurator.create(curator);
localRepo = new LocalSessionRepo(Clock.systemUTC());
pathPrefix = "/application/v2/tenant/" + tenant + "/session/";
hostProvisioner = new MockProvisioner();
modelFactory = new VespaModelFactory(new NullConfigModelRegistry());
componentRegistry = new TestComponentRegistry.Builder().curator(curator).configCurator(configCurator).modelFactoryRegistry(new ModelFactoryRegistry(Collections.singletonList(modelFactory))).build();
}
use of com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry in project vespa by vespa-engine.
the class RemoteSessionTest method createSession.
private RemoteSession createSession(long sessionId, SessionZooKeeperClient zkc, List<ModelFactory> modelFactories, Optional<PermanentApplicationPackage> permanentApplicationPackage, Clock clock) {
zkc.writeStatus(Session.Status.NEW);
zkc.writeApplicationId(new ApplicationId.Builder().applicationName("foo").instanceName("bim").build());
TestComponentRegistry.Builder registryBuilder = new TestComponentRegistry.Builder().curator(curator).modelFactoryRegistry(new ModelFactoryRegistry(modelFactories));
if (permanentApplicationPackage.isPresent())
registryBuilder.permanentApplicationPackage(permanentApplicationPackage.get());
return new RemoteSession(tenantName, sessionId, registryBuilder.build(), zkc, clock);
}
Aggregations