summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java')
-rw-r--r--container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java b/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java
index 7ff120ddc70..9a0063e7f07 100644
--- a/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/query/profile/test/QueryProfileSubstitutionTestCase.java
@@ -19,7 +19,7 @@ public class QueryProfileSubstitutionTestCase {
@Test
public void testSingleSubstitution() {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message","Hello %{world}!", null);
p.set("world", "world", null);
assertEquals("Hello world!",p.compile(null).get("message"));
@@ -27,7 +27,7 @@ public class QueryProfileSubstitutionTestCase {
QueryProfile p2=new QueryProfile("test2");
p2.addInherited(p);
p2.set("world", "universe", null);
- assertEquals("Hello universe!",p2.compile(null).get("message"));
+ assertEquals("Hello universe!", p2.compile(null).get("message"));
}
@Test
@@ -39,16 +39,16 @@ public class QueryProfileSubstitutionTestCase {
p.set("exclamation","?", null);
assertEquals("Hola local group?",p.compile(null).get("message"));
- QueryProfile p2=new QueryProfile("test2");
+ QueryProfile p2 = new QueryProfile("test2");
p2.addInherited(p);
p2.set("entity","milky way", null);
- assertEquals("Hola milky way?",p2.compile(null).get("message"));
+ assertEquals("Hola milky way?", p2.compile(null).get("message"));
}
@Test
public void testUnclosedSubstitution1() {
try {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message1","%{greeting} %{entity}%{exclamation", null);
fail("Should have produced an exception");
}
@@ -61,7 +61,7 @@ public class QueryProfileSubstitutionTestCase {
@Test
public void testUnclosedSubstitution2() {
try {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message1","%{greeting} %{entity%{exclamation}", null);
fail("Should have produced an exception");
}
@@ -73,26 +73,26 @@ public class QueryProfileSubstitutionTestCase {
@Test
public void testNullSubstitution() {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message","%{greeting} %{entity}%{exclamation}", null);
p.set("greeting","Hola", null);
assertEquals("Hola ", p.compile(null).get("message"));
- QueryProfile p2=new QueryProfile("test2");
+ QueryProfile p2 = new QueryProfile("test2");
p2.addInherited(p);
p2.set("greeting","Hola", null);
p2.set("exclamation", "?", null);
- assertEquals("Hola ?",p2.compile(null).get("message"));
+ assertEquals("Hola ?", p2.compile(null).get("message"));
}
@Test
public void testNoOverridingOfPropertiesSetAtRuntime() {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message","Hello %{world}!", null);
p.set("world","world", null);
p.freeze();
- Properties runtime=new QueryProfileProperties(p.compile(null));
+ Properties runtime = new QueryProfileProperties(p.compile(null));
runtime.set("runtimeMessage","Hello %{world}!");
assertEquals("Hello world!", runtime.get("message"));
assertEquals("Hello %{world}!",runtime.get("runtimeMessage"));
@@ -100,18 +100,18 @@ public class QueryProfileSubstitutionTestCase {
@Test
public void testButPropertiesSetAtRuntimeAreUsedInSubstitutions() {
- QueryProfile p=new QueryProfile("test");
- p.set("message","Hello %{world}!", null);
- p.set("world","world", null);
+ QueryProfile p = new QueryProfile("test");
+ p.set("message", "Hello %{world}!", null);
+ p.set("world", "world", null);
- Properties runtime=new QueryProfileProperties(p.compile(null));
- runtime.set("world","Earth");
- assertEquals("Hello Earth!",runtime.get("message"));
+ Properties runtime = new QueryProfileProperties(p.compile(null));
+ runtime.set("world", "Earth");
+ assertEquals("Hello Earth!", runtime.get("message"));
}
@Test
public void testInspection() {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message", "%{greeting} %{entity}%{exclamation}", null);
assertEquals("message","%{greeting} %{entity}%{exclamation}",
p.declaredContent().entrySet().iterator().next().getValue().toString());
@@ -119,7 +119,7 @@ public class QueryProfileSubstitutionTestCase {
@Test
public void testVariants() {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message","Hello %{world}!", null);
p.set("world","world", null);
p.setDimensions(new String[] {"x"});
@@ -134,7 +134,7 @@ public class QueryProfileSubstitutionTestCase {
@Test
public void testRecursion() {
- QueryProfile p=new QueryProfile("test");
+ QueryProfile p = new QueryProfile("test");
p.set("message","Hello %{world}!", null);
p.set("world","sol planet number %{number}", null);
p.set("number",3, null);