1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.content;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* @author bjorncs
*/
public class RedundancyTest {
@Test
public void effectively_globally_distributed_is_correct() {
assertFalse(createRedundancy(4, 2, 10).isEffectivelyGloballyDistributed());
assertFalse(createRedundancy(5, 1, 10).isEffectivelyGloballyDistributed());
assertFalse(createRedundancy(5, 2, 12).isEffectivelyGloballyDistributed());
assertTrue(createRedundancy(5, 2, 10).isEffectivelyGloballyDistributed());
assertTrue(createRedundancy(5, 3, 10).isEffectivelyGloballyDistributed());
assertTrue(createRedundancy(1, 1, 1).isEffectivelyGloballyDistributed());
}
private static Redundancy createRedundancy(int redundancy, int implicitGroups, int totalNodes) {
Redundancy r = new Redundancy(1, redundancy, 1, implicitGroups, totalNodes);
return r;
}
}
|