summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-09-02 16:52:01 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-09-02 16:52:01 +0200
commit126d3b2627b783d7476fb218d43db50632f39ea2 (patch)
tree1a305960e6aa108e151110d143ead37ea1c26898 /configserver
parent6027e9d30acfde1e959399307210dffa6c341cd2 (diff)
Completely avoid test implementation superclass in new tests
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java12
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java6
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/RedeployTest.java6
3 files changed, 14 insertions, 10 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 905b3a08071..c5c0b6351d2 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
@@ -26,8 +26,12 @@ import com.yahoo.vespa.config.server.session.PrepareParams;
import com.yahoo.vespa.config.server.session.SilentDeployLogger;
import com.yahoo.vespa.config.server.tenant.Tenant;
import com.yahoo.vespa.config.server.tenant.Tenants;
+import com.yahoo.vespa.config.server.zookeeper.ConfigCurator;
import com.yahoo.vespa.curator.Curator;
+import com.yahoo.vespa.curator.mock.MockCurator;
import com.yahoo.vespa.model.VespaModelFactory;
+import org.apache.curator.framework.CuratorFramework;
+import org.junit.Before;
import java.io.File;
import java.io.IOException;
@@ -52,12 +56,12 @@ public class DeployTester {
private ApplicationId id;
- public DeployTester(String appPath, Curator curator) {
+ public DeployTester(String appPath) {
try {
- this.curator = curator;
+ this.curator = new MockCurator();
this.testApp = new File(appPath);
- tenants = new Tenants(new TestComponentRegistry(curator, modelFactoryRegistry), Metrics.createTestMetrics());
- tenant = tenants.defaultTenant();
+ this.tenants = new Tenants(new TestComponentRegistry(curator, modelFactoryRegistry), Metrics.createTestMetrics());
+ this.tenant = tenants.defaultTenant();
}
catch (Exception e) {
throw new IllegalArgumentException(e);
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
index 44e296829b5..585b988bffc 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
@@ -47,11 +47,11 @@ import static org.junit.Assert.assertTrue;
/**
* @author bratseth
*/
-public class HostedDeployTest extends TestWithCurator {
+public class HostedDeployTest {
@Test
public void testRedeploy() throws InterruptedException, IOException {
- DeployTester tester = new DeployTester("src/test/apps/hosted/", curator);
+ DeployTester tester = new DeployTester("src/test/apps/hosted/");
tester.deployApp("myApp");
Optional<com.yahoo.config.provision.Deployment> deployment = tester.redeployFromLocalActive();
@@ -62,7 +62,7 @@ public class HostedDeployTest extends TestWithCurator {
@Test
public void testRedeployAfterExpiredValidationOverride() throws InterruptedException, IOException {
- DeployTester tester = new DeployTester("src/test/apps/validationOverride/", curator);
+ DeployTester tester = new DeployTester("src/test/apps/validationOverride/");
tester.deployApp("myApp");
Optional<com.yahoo.config.provision.Deployment> deployment = tester.redeployFromLocalActive();
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 79975808b06..6a58c6cd4e4 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
@@ -41,11 +41,11 @@ import static org.junit.Assert.assertTrue;
*
* @author bratseth
*/
-public class RedeployTest extends TestWithCurator {
+public class RedeployTest {
@Test
public void testRedeploy() throws InterruptedException, IOException {
- DeployTester tester = new DeployTester("src/test/apps/app", curator);
+ DeployTester tester = new DeployTester("src/test/apps/app");
tester.deployApp("myapp");
Optional<com.yahoo.config.provision.Deployment> deployment = tester.redeployFromLocalActive();
@@ -62,7 +62,7 @@ public class RedeployTest extends TestWithCurator {
/** No deployment is done because there is no local active session. */
@Test
public void testNoRedeploy() {
- DeployTester tester = new DeployTester("ignored/app/path", curator);
+ DeployTester tester = new DeployTester("ignored/app/path");
ApplicationId id = ApplicationId.from(TenantName.from("default"),
ApplicationName.from("default"),
InstanceName.from("default"));