summaryrefslogtreecommitdiffstats
path: root/docprocs
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2021-12-10 09:43:05 +0000
committerArne H Juul <arnej@yahooinc.com>2021-12-10 09:49:16 +0000
commitfc7acec41cdef74ecd7c69a4fd376f77702e16e7 (patch)
treef716bc060025c61ed0e6b1496b09b7530d7de6d9 /docprocs
parent175cc78a3934916aa21680c88c3aa09de127a7bd (diff)
deprecate parts of DocumentTypeManager
* we want to stop using IDs as unique key for DataTypes; these methods are only used in our own config setup. * nothing should setup a self-subscribing manager; add a convenience to create a manager from a config file to use from unit tests.
Diffstat (limited to 'docprocs')
-rw-r--r--docprocs/src/test/java/com/yahoo/docprocs/indexing/ScriptManagerTestCase.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/docprocs/src/test/java/com/yahoo/docprocs/indexing/ScriptManagerTestCase.java b/docprocs/src/test/java/com/yahoo/docprocs/indexing/ScriptManagerTestCase.java
index ed996f56078..a35dd0da4f3 100644
--- a/docprocs/src/test/java/com/yahoo/docprocs/indexing/ScriptManagerTestCase.java
+++ b/docprocs/src/test/java/com/yahoo/docprocs/indexing/ScriptManagerTestCase.java
@@ -20,8 +20,7 @@ public class ScriptManagerTestCase {
@Test
public void requireThatScriptsAreAppliedToSubType() throws ParseException {
- DocumentTypeManager typeMgr = new DocumentTypeManager();
- typeMgr.configure("file:src/test/cfg/documentmanager_inherit.cfg");
+ var typeMgr = DocumentTypeManager.fromFile("src/test/cfg/documentmanager_inherit.cfg");
DocumentType docType = typeMgr.getDocumentType("newssummary");
assertNotNull(docType);
@@ -36,8 +35,7 @@ public class ScriptManagerTestCase {
@Test
public void requireThatScriptsAreAppliedToSuperType() throws ParseException {
- DocumentTypeManager typeMgr = new DocumentTypeManager();
- typeMgr.configure("file:src/test/cfg/documentmanager_inherit.cfg");
+ var typeMgr = DocumentTypeManager.fromFile("src/test/cfg/documentmanager_inherit.cfg");
DocumentType docType = typeMgr.getDocumentType("newsarticle");
assertNotNull(docType);
@@ -51,16 +49,14 @@ public class ScriptManagerTestCase {
@Test
public void requireThatEmptyConfigurationDoesNotThrow() {
- DocumentTypeManager typeMgr = new DocumentTypeManager();
- typeMgr.configure("file:src/test/cfg/documentmanager_inherit.cfg");
+ var typeMgr = DocumentTypeManager.fromFile("src/test/cfg/documentmanager_inherit.cfg");
ScriptManager scriptMgr = new ScriptManager(typeMgr, new IlscriptsConfig(new IlscriptsConfig.Builder()), null, Embedder.throwsOnUse);
assertNull(scriptMgr.getScript(new DocumentType("unknown")));
}
@Test
public void requireThatUnknownDocumentTypeReturnsNull() {
- DocumentTypeManager typeMgr = new DocumentTypeManager();
- typeMgr.configure("file:src/test/cfg/documentmanager_inherit.cfg");
+ var typeMgr = DocumentTypeManager.fromFile("src/test/cfg/documentmanager_inherit.cfg");
ScriptManager scriptMgr = new ScriptManager(typeMgr, new IlscriptsConfig(new IlscriptsConfig.Builder()), null, Embedder.throwsOnUse);
for (Iterator<DocumentType> it = typeMgr.documentTypeIterator(); it.hasNext(); ) {
assertNull(scriptMgr.getScript(it.next()));