diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java |
Publish
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java new file mode 100644 index 00000000000..53d29bd3ca1 --- /dev/null +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/MailTestCase.java @@ -0,0 +1,54 @@ +// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.searchdefinition.derived; + +import com.yahoo.config.ConfigInstance; +import com.yahoo.document.config.DocumentmanagerConfig; +import com.yahoo.searchdefinition.SearchBuilder; +import com.yahoo.searchdefinition.UnprocessingSearchBuilder; +import com.yahoo.searchdefinition.parser.ParseException; +import com.yahoo.vespa.model.VespaModel; +import com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg; +import org.junit.Test; +import org.xml.sax.SAXException; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +/** + * Tests VDS+streaming configuration deriving + * + * @author bratseth + */ +public class MailTestCase extends AbstractExportingTestCase { + + @Test + public void testMail() throws IOException, ParseException { + String dir = "src/test/derived/mail/"; + SearchBuilder sb = new SearchBuilder(); + sb.importFile(dir + "mail.sd"); + assertCorrectDeriving(sb, dir); + } + + @Test + public void testMailDocumentsonlyDeriving() { + String root = "src/test/derived/mail/"; + File toDir = new File("temp/documentderiver/"); + if (!toDir.exists()) { + toDir.mkdir(); + } + List<String> files = new ArrayList<>(); + files.add(root + "mail.sd"); + Deriver.deriveDocuments(files, toDir.getPath()); + try { + assertEqualFiles(root + "onlydoc/documentmanager.cfg", + toDir.getPath() + "/documentmanager.cfg"); + } catch (IOException e) { + throw new RuntimeException("Exception while comparing files", e); + } + } + +} |