blob: 106b227599fdce009557b71d9f37c41befcbb70e (
plain) (
blame)
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
30
31
32
33
34
35
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.grouping.result;
import com.yahoo.search.grouping.Continuation;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
/**
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
public class HitListTestCase {
@Test
public void requireThatAccessorsWork() {
HitList lst = new HitList("foo");
assertEquals("foo", lst.getLabel());
assertEquals(0, lst.continuations().size());
MyContinuation foo = new MyContinuation();
lst.continuations().put("foo", foo);
assertEquals(1, lst.continuations().size());
assertSame(foo, lst.continuations().get("foo"));
MyContinuation bar = new MyContinuation();
lst.continuations().put("bar", bar);
assertEquals(2, lst.continuations().size());
assertSame(bar, lst.continuations().get("bar"));
}
private static class MyContinuation extends Continuation {
}
}
|