diff options
author | Haakon Dybdahl <dybis@users.noreply.github.com> | 2016-11-01 11:15:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-01 11:15:43 +0100 |
commit | 666ef9fe96674467aa470d08adaae1c59ab1fc35 (patch) | |
tree | 2dbc29e4727af20b060f13c16c9179b253b3b885 /configserver | |
parent | 43b09c1cde2411b782aae149ef9b26b01c01db68 (diff) | |
parent | 4cb534d2ea5c7a89d3d5509d03f7bad97f9d79b2 (diff) |
Merge pull request #984 from yahoo/hmusum/minor-fixes
Hmusum/minor fixes
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java | 14 | ||||
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/deploy/RedeployTest.java | 33 |
2 files changed, 8 insertions, 39 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java index 3c19725c22f..887a931c900 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java @@ -21,7 +21,6 @@ import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.ProvisionLogger; import com.yahoo.config.provision.Provisioner; import com.yahoo.config.provision.Version; -import com.yahoo.path.Path; import com.yahoo.transaction.NestedTransaction; import com.yahoo.vespa.config.server.ApplicationRepository; import com.yahoo.vespa.config.server.TestComponentRegistry; @@ -61,7 +60,6 @@ public class DeployTester { private final Curator curator; private final Tenants tenants; - private final Path tenantPath = Path.createRoot().append("testapp"); private final File testApp; private ApplicationId id; @@ -94,11 +92,15 @@ public class DeployTester { * Do the initial "deploy" with the existing API-less code as the deploy API doesn't support first deploys yet. */ public ApplicationId deployApp(String appName) throws InterruptedException, IOException { - LocalSession session = tenant().getSessionFactory().createSession(testApp, "default", new SilentDeployLogger(), new TimeoutBudget(Clock.systemUTC(), Duration.ofSeconds(60))); - ApplicationId id = ApplicationId.from(tenant().getName(), ApplicationName.from(appName), InstanceName.defaultName()); - session.prepare(new SilentDeployLogger(), new PrepareParams(new ConfigserverConfig(new ConfigserverConfig.Builder())).applicationId(id), Optional.empty(), tenantPath); + final Tenant tenant = tenant(); + LocalSession session = tenant.getSessionFactory().createSession(testApp, appName, new SilentDeployLogger(), new TimeoutBudget(Clock.systemUTC(), Duration.ofSeconds(60))); + ApplicationId id = ApplicationId.from(tenant.getName(), ApplicationName.from(appName), InstanceName.defaultName()); + session.prepare(new SilentDeployLogger(), + new PrepareParams(new ConfigserverConfig(new ConfigserverConfig.Builder())).applicationId(id), + Optional.empty(), + tenant.getPath()); session.createActivateTransaction().commit(); - tenant().getLocalSessionRepo().addSession(session); + tenant.getLocalSessionRepo().addSession(session); this.id = id; return id; } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/RedeployTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/RedeployTest.java index ebfcca5c6a7..cf3dba9caa4 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/RedeployTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/RedeployTest.java @@ -1,50 +1,17 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.server.deploy; -import com.yahoo.cloud.config.ConfigserverConfig; -import com.yahoo.config.application.api.ApplicationPackage; -import com.yahoo.config.model.NullConfigModelRegistry; -import com.yahoo.config.model.api.Model; -import com.yahoo.config.model.api.ModelContext; -import com.yahoo.config.model.api.ModelCreateResult; import com.yahoo.config.model.api.ModelFactory; -import com.yahoo.config.model.deploy.DeployState; -import com.yahoo.config.model.test.MockApplicationPackage; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ApplicationName; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.Version; -import com.yahoo.path.Path; -import com.yahoo.test.ManualClock; -import com.yahoo.vespa.config.server.ApplicationRepository; -import com.yahoo.vespa.config.server.TestComponentRegistry; -import com.yahoo.vespa.config.server.TestWithCurator; -import com.yahoo.vespa.config.server.modelfactory.ModelFactoryRegistry; -import com.yahoo.vespa.config.server.monitoring.Metrics; -import com.yahoo.vespa.config.server.tenant.Tenant; -import com.yahoo.vespa.config.server.tenant.Tenants; -import com.yahoo.vespa.config.server.tenant.TestWithTenant; -import com.yahoo.vespa.config.server.TimeoutBudget; -import com.yahoo.vespa.config.server.provision.HostProvisionerProvider; -import com.yahoo.vespa.config.server.session.LocalSession; -import com.yahoo.vespa.config.server.session.PrepareParams; -import com.yahoo.vespa.config.server.session.SilentDeployLogger; -import com.yahoo.vespa.model.VespaModel; -import com.yahoo.vespa.model.VespaModelFactory; -import org.junit.Before; import org.junit.Test; -import java.io.File; import java.io.IOException; import java.time.Clock; -import java.time.Duration; -import java.time.Instant; -import java.time.LocalDate; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Optional; |