blob: 2bb8584cba32730d4c2d5f957fd4e08d62b416ed (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.prelude.query.test;
import org.junit.jupiter.api.Test;
import com.yahoo.prelude.query.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author havardpe
*/
public class DotProductItemTestCase {
@Test
void testDotProductItem() {
DotProductItem item = new DotProductItem("index_name");
assertEquals("index_name", item.getIndexName());
assertEquals(Item.ItemType.DOTPRODUCT, item.getItemType());
}
@Test
void testDotProductClone() {
DotProductItem dpOrig = new DotProductItem("myDP");
dpOrig.addToken("first", 11);
dpOrig.getTokens();
DotProductItem dpClone = (DotProductItem) dpOrig.clone();
dpClone.addToken("second", 22);
assertEquals(2, dpClone.getNumTokens());
}
}
|