diff options
author | Lester Solbakken <lesters@yahoo-inc.com> | 2017-05-09 13:59:16 +0200 |
---|---|---|
committer | Lester Solbakken <lesters@yahoo-inc.com> | 2017-05-09 13:59:16 +0200 |
commit | fd7d16d2ea68a38be38783decdfbf1097db3741c (patch) | |
tree | bef755c29e24f557b7f4569bfe73da1eb7a2ea8a /documentgen-test/src | |
parent | 0e638682e7e319df2f0650033b484f85bfd3a7e0 (diff) |
Add tensor support to vespa-documentgen-plugin
Diffstat (limited to 'documentgen-test/src')
-rw-r--r-- | documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java b/documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java index 7e9365a0e6b..b113dc365ba 100644 --- a/documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java +++ b/documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java @@ -14,6 +14,7 @@ import com.yahoo.document.datatypes.*; import com.yahoo.document.serialization.*; import com.yahoo.io.GrowableByteBuffer; import com.yahoo.searchdefinition.derived.Deriver; +import com.yahoo.tensor.Tensor; import com.yahoo.vespa.document.NodeImpl; import com.yahoo.vespa.document.dom.DocumentImpl; import com.yahoo.vespa.documentgen.test.*; @@ -918,5 +919,13 @@ public class DocumentGenPluginTest { System.out.println(unmasked); assertEquals(unmasked.size(), 0); // probably not needed } + + @Test + public void testTensorType() { + Book book = new Book(new DocumentId("doc:book:0")); + assertNull(book.getVector()); + book.setVector(Tensor.from("{{x:0}:1.0, {x:1}:2.0, {x:2}:3.0}")); + assertEquals("{{x:0}:1.0,{x:1}:2.0,{x:2}:3.0}", book.getVector().toString()); + } } |