From 6eefc2ddedfc57af712f8a952d5b0710bcceebb2 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 5 Apr 2018 16:42:58 +0200 Subject: Create application package that will guarantee restart. --- .../src/test/apps/app-jdisc-only-restart/hosts.xml | 7 +++ .../searchdefinitions/music.sd | 57 ++++++++++++++++++++++ .../test/apps/app-jdisc-only-restart/services.xml | 22 +++++++++ 3 files changed, 86 insertions(+) create mode 100644 configserver/src/test/apps/app-jdisc-only-restart/hosts.xml create mode 100644 configserver/src/test/apps/app-jdisc-only-restart/searchdefinitions/music.sd create mode 100644 configserver/src/test/apps/app-jdisc-only-restart/services.xml (limited to 'configserver') diff --git a/configserver/src/test/apps/app-jdisc-only-restart/hosts.xml b/configserver/src/test/apps/app-jdisc-only-restart/hosts.xml new file mode 100644 index 00000000000..f4256c9fc81 --- /dev/null +++ b/configserver/src/test/apps/app-jdisc-only-restart/hosts.xml @@ -0,0 +1,7 @@ + + + + + node1 + + diff --git a/configserver/src/test/apps/app-jdisc-only-restart/searchdefinitions/music.sd b/configserver/src/test/apps/app-jdisc-only-restart/searchdefinitions/music.sd new file mode 100644 index 00000000000..2e40523a6d9 --- /dev/null +++ b/configserver/src/test/apps/app-jdisc-only-restart/searchdefinitions/music.sd @@ -0,0 +1,57 @@ +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# A basic search definition - called music, should be saved to music.sd +search music { + + # It contains one document type only - called music as well + document music { + + field title type string { + indexing: summary | index # How this field should be indexed + # index-to: title, default # Create two indexes + weight: 75 # Ranking importancy of this field, used by the built in nativeRank feature + header + } + + field artist type string { + indexing: summary | attribute | index + # index-to: artist, default + + weight: 25 + header + } + + field year type int { + indexing: summary | attribute + header + } + + # Increase query + field popularity type int { + indexing: summary | attribute + body + } + + field url type uri { + indexing: summary | index + header + } + + } + + rank-profile default inherits default { + first-phase { + expression: nativeRank(title,artist) + attribute(popularity) + } + + } + + rank-profile textmatch inherits default { + first-phase { + expression: nativeRank(title,artist) + } + + } + + + +} diff --git a/configserver/src/test/apps/app-jdisc-only-restart/services.xml b/configserver/src/test/apps/app-jdisc-only-restart/services.xml new file mode 100644 index 00000000000..755ca1fd585 --- /dev/null +++ b/configserver/src/test/apps/app-jdisc-only-restart/services.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + someval + + + + + + + + + -- cgit v1.2.3 From 7de818b34106ae4a9054c12f894b325451a3c779 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 5 Apr 2018 16:54:55 +0200 Subject: Use application package that will guarantee restart. --- configserver/src/test/apps/app-jdisc-only-restart/services.xml | 7 +++++++ .../com/yahoo/vespa/config/server/ApplicationRepositoryTest.java | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'configserver') diff --git a/configserver/src/test/apps/app-jdisc-only-restart/services.xml b/configserver/src/test/apps/app-jdisc-only-restart/services.xml index 755ca1fd585..b864ea206ef 100644 --- a/configserver/src/test/apps/app-jdisc-only-restart/services.xml +++ b/configserver/src/test/apps/app-jdisc-only-restart/services.xml @@ -2,6 +2,13 @@ + + + + + + + diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java index ecc3a8a0a54..0b7e9a78967 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java @@ -33,6 +33,8 @@ public class ApplicationRepositoryTest { private final static File testApp = new File("src/test/apps/app"); private final static File testAppJdiscOnly = new File("src/test/apps/app-jdisc-only"); + private final static File testAppJdiscOnlyRestart = new File("src/test/apps/app-jdisc-only-restart"); + private final static TenantName tenantName = TenantName.from("test"); private final static Clock clock = Clock.systemUTC(); @@ -63,7 +65,7 @@ public class ApplicationRepositoryTest { @Test public void prepareAndActivateWithRestart() throws IOException { prepareAndActivateApp(testAppJdiscOnly); - PrepareResult result = prepareAndActivateApp(testApp); + PrepareResult result = prepareAndActivateApp(testAppJdiscOnlyRestart); assertTrue(result.configChangeActions().getRefeedActions().isEmpty()); assertFalse(result.configChangeActions().getRestartActions().isEmpty()); } -- cgit v1.2.3