use of com.yahoo.vespa.config.server.application.PermanentApplicationPackage in project vespa by vespa-engine.
the class RemoteSessionTest method require_that_permanent_app_is_used.
@Test
public void require_that_permanent_app_is_used() {
Optional<PermanentApplicationPackage> permanentApp = Optional.of(new PermanentApplicationPackage(new ConfigserverConfig(new ConfigserverConfig.Builder().applicationDirectory(Files.createTempDir().getAbsolutePath()))));
MockModelFactory mockModelFactory = new MockModelFactory();
try {
int sessionId = 3;
SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenantName, sessionId);
createSession(sessionId, zkc, Collections.singletonList(mockModelFactory), permanentApp, mockModelFactory.clock()).ensureApplicationLoaded();
} catch (Exception e) {
e.printStackTrace();
// ignore, we're not interested in deploy errors as long as the below state is OK.
}
assertNotNull(mockModelFactory.modelContext);
assertTrue(mockModelFactory.modelContext.permanentApplicationPackage().isPresent());
}
use of com.yahoo.vespa.config.server.application.PermanentApplicationPackage in project vespa by vespa-engine.
the class InjectedGlobalComponentRegistryTest method setupRegistry.
@Before
public void setupRegistry() {
curator = new MockCurator();
ConfigCurator configCurator = ConfigCurator.create(curator);
metrics = Metrics.createTestMetrics();
modelFactoryRegistry = new ModelFactoryRegistry(Collections.singletonList(new VespaModelFactory(new NullConfigModelRegistry())));
configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder().configServerDBDir(Files.createTempDir().getAbsolutePath()).configDefinitionsDir(Files.createTempDir().getAbsolutePath()));
serverDB = new ConfigServerDB(configserverConfig);
sessionPreparer = new SessionTest.MockSessionPreparer();
rpcServer = new RpcServer(configserverConfig, null, Metrics.createTestMetrics(), new HostRegistries(), new ConfigRequestHostLivenessTracker(), new FileServer(FileDistribution.getDefaultFileDBPath()));
generationCounter = new SuperModelGenerationCounter(curator);
defRepo = new StaticConfigDefinitionRepo();
permanentApplicationPackage = new PermanentApplicationPackage(configserverConfig);
hostRegistries = new HostRegistries();
HostProvisionerProvider hostProvisionerProvider = HostProvisionerProvider.withProvisioner(new SessionHandlerTest.MockProvisioner());
zone = Zone.defaultZone();
globalComponentRegistry = new InjectedGlobalComponentRegistry(curator, configCurator, metrics, modelFactoryRegistry, serverDB, sessionPreparer, rpcServer, configserverConfig, generationCounter, defRepo, permanentApplicationPackage, hostRegistries, hostProvisionerProvider, zone);
}
Aggregations