diff options
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/result')
8 files changed, 28 insertions, 8 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/result/CoverageTestCase.java b/container-search/src/test/java/com/yahoo/search/result/CoverageTestCase.java index 15ba994441c..cadbc6adf5c 100644 --- a/container-search/src/test/java/com/yahoo/search/result/CoverageTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/CoverageTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result; import com.yahoo.search.Query; @@ -6,7 +6,9 @@ import com.yahoo.search.Result; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author Steinar Knutsen @@ -103,4 +105,22 @@ public class CoverageTestCase { } } + private void verifyNoCoverage(Coverage zero) { + assertFalse(zero.isDegraded()); + assertEquals(100, zero.getResultPercentage()); + assertTrue(zero.getFull()); + zero.setDegradedReason(com.yahoo.container.handler.Coverage.DEGRADED_BY_TIMEOUT); + assertTrue(zero.isDegraded()); + assertEquals(0, zero.getResultPercentage()); + assertFalse(zero.getFull()); + } + @Test + void testCoverageWithNoResponseFromSearchNodesAndTimeout() { + verifyNoCoverage(new Coverage(0, 0, 0)); + } + @Test + void testCoverageWithResponseFromSearchNodesAndTimeout() { + verifyNoCoverage(new Coverage(0, 0, 1)); + } + } diff --git a/container-search/src/test/java/com/yahoo/search/result/DefaultErrorHitTestCase.java b/container-search/src/test/java/com/yahoo/search/result/DefaultErrorHitTestCase.java index 42095e263dd..5af4d393404 100644 --- a/container-search/src/test/java/com/yahoo/search/result/DefaultErrorHitTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/DefaultErrorHitTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result; import static org.junit.jupiter.api.Assertions.*; diff --git a/container-search/src/test/java/com/yahoo/search/result/FeatureDataTestCase.java b/container-search/src/test/java/com/yahoo/search/result/FeatureDataTestCase.java index 5d423eceb98..5ed7430d929 100644 --- a/container-search/src/test/java/com/yahoo/search/result/FeatureDataTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/FeatureDataTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result; import com.yahoo.data.access.slime.SlimeAdapter; diff --git a/container-search/src/test/java/com/yahoo/search/result/NanNumberTestCase.java b/container-search/src/test/java/com/yahoo/search/result/NanNumberTestCase.java index 0790b6754fe..a7abac46391 100644 --- a/container-search/src/test/java/com/yahoo/search/result/NanNumberTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/NanNumberTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/container-search/src/test/java/com/yahoo/search/result/PositionsDataTestCase.java b/container-search/src/test/java/com/yahoo/search/result/PositionsDataTestCase.java index a112cb41a64..e12b38ab6bc 100644 --- a/container-search/src/test/java/com/yahoo/search/result/PositionsDataTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/PositionsDataTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result; import com.yahoo.data.access.simple.Value; diff --git a/container-search/src/test/java/com/yahoo/search/result/test/DeepHitIteratorTestCase.java b/container-search/src/test/java/com/yahoo/search/result/test/DeepHitIteratorTestCase.java index 21a10bf8325..bce4f810ca1 100644 --- a/container-search/src/test/java/com/yahoo/search/result/test/DeepHitIteratorTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/test/DeepHitIteratorTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result.test; import java.util.Iterator; diff --git a/container-search/src/test/java/com/yahoo/search/result/test/FillingTestCase.java b/container-search/src/test/java/com/yahoo/search/result/test/FillingTestCase.java index 8c833ca76f3..298673a1ae7 100644 --- a/container-search/src/test/java/com/yahoo/search/result/test/FillingTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/test/FillingTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result.test; import com.yahoo.search.result.Hit; diff --git a/container-search/src/test/java/com/yahoo/search/result/test/HitGroupTestCase.java b/container-search/src/test/java/com/yahoo/search/result/test/HitGroupTestCase.java index cc4e6193103..5f8fbbd08df 100644 --- a/container-search/src/test/java/com/yahoo/search/result/test/HitGroupTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/result/test/HitGroupTestCase.java @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.search.result.test; import com.yahoo.search.Query; |