From 3259d8a1aa2b0f2b552c5cdcc48ac09262225af2 Mon Sep 17 00:00:00 2001 From: Paxton Hare Date: Wed, 17 Feb 2016 13:33:52 -0500 Subject: [PATCH] fixing path for xquery modules --- .../root/com.marklogic.hub/lib/flow-lib.xqy | 6 +-- .../com/marklogic/hub/DomainManagerTest.java | 28 +++++----- .../com/marklogic/hub/FlowManagerTest.java | 52 +++++++++---------- .../com/marklogic/hub/model/FlowType.java | 2 +- .../hub/service/DomainManagerService.java | 2 +- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/flow-lib.xqy b/data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/flow-lib.xqy index 51daa78410..e1207da24b 100644 --- a/data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/flow-lib.xqy +++ b/data-hub/src/main/resources/ml-modules/root/com.marklogic.hub/lib/flow-lib.xqy @@ -283,10 +283,10 @@ declare function flow:get-flows( cts:uri-match($DOMAINS-DIR || "*") }) let $flows := - for $flow in $uris[fn:matches(., $DOMAINS-DIR || $domain-name || "/(input|canonical)/[^/]+/$")] - let $name := fn:replace($flow, $DOMAINS-DIR || $domain-name || "/(input|canonical)/([^/]+)/$", "$2") + for $flow in $uris[fn:matches(., $DOMAINS-DIR || $domain-name || "/(input|conformance)/[^/]+/$")] + let $name := fn:replace($flow, $DOMAINS-DIR || $domain-name || "/(input|conformance)/([^/]+)/$", "$2") return - flow:get-flow($domain-name, $name, (), $uris[fn:matches(., $DOMAINS-DIR || $domain-name || "/(input|canonical)/" || $name || "/.+")]) + flow:get-flow($domain-name, $name, (), $uris[fn:matches(., $DOMAINS-DIR || $domain-name || "/(input|conformance)/" || $name || "/.+")]) return { diff --git a/data-hub/src/test/java/com/marklogic/hub/DomainManagerTest.java b/data-hub/src/test/java/com/marklogic/hub/DomainManagerTest.java index 6f36390fea..460db06bdc 100644 --- a/data-hub/src/test/java/com/marklogic/hub/DomainManagerTest.java +++ b/data-hub/src/test/java/com/marklogic/hub/DomainManagerTest.java @@ -53,16 +53,16 @@ public static void setup() throws IOException { installDoc("/incoming/employee1.xml", meta, getResource("flow-manager-test/input/employee1.xml")); installDoc("/incoming/employee2.xml", meta, getResource("flow-manager-test/input/employee2.xml")); runInModules( - "xdmp:directory-create(\"/ext/domains/test/my-test-flow1/collector/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow1/headers/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow1/triples/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow1/content/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow2/collector/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow2/headers/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow2/triples/\")," + - "xdmp:directory-create(\"/ext/domains/test/my-test-flow2/content/\")"); - installModule("/ext/domains/test/my-test-flow1/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); - installModule("/ext/domains/test/my-test-flow2/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/collector/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/headers/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/triples/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/content/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/collector/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/headers/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/triples/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/content/\")"); + installModule("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow2/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); } @AfterClass @@ -91,7 +91,7 @@ public void testGetDomains() { ServerCollector c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); ServerPlugin t = (ServerPlugin)flow1.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -109,7 +109,7 @@ public void testGetDomains() { c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); t = (ServerPlugin)flow2.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -137,7 +137,7 @@ public void testGetDomain() { ServerCollector c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); ServerPlugin t = (ServerPlugin)flow1.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -154,7 +154,7 @@ public void testGetDomain() { c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); t = (ServerPlugin)flow2.getContentPlugin(); assertEquals("xquery", t.getType()); diff --git a/data-hub/src/test/java/com/marklogic/hub/FlowManagerTest.java b/data-hub/src/test/java/com/marklogic/hub/FlowManagerTest.java index 17719e37f9..c16921526c 100644 --- a/data-hub/src/test/java/com/marklogic/hub/FlowManagerTest.java +++ b/data-hub/src/test/java/com/marklogic/hub/FlowManagerTest.java @@ -64,16 +64,16 @@ public static void setup() throws IOException { installDoc("/incoming/employee1.xml", meta, getResource("flow-manager-test/input/employee1.xml")); installDoc("/incoming/employee2.xml", meta, getResource("flow-manager-test/input/employee2.xml")); runInModules( - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow1/collector/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow1/headers/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow1/triples/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow1/content/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow2/collector/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow2/headers/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow2/triples/\")," + - "xdmp:directory-create(\"/ext/domains/test/canonical/my-test-flow2/content/\")"); - installModule("/ext/domains/test/canonical/my-test-flow1/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); - installModule("/ext/domains/test/canonical/my-test-flow2/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/collector/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/headers/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/triples/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow1/content/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/collector/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/headers/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/triples/\")," + + "xdmp:directory-create(\"/ext/domains/test/conformance/my-test-flow2/content/\")"); + installModule("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow2/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); } @AfterClass @@ -106,8 +106,8 @@ public void testSimpleFlowFromXml() throws IOException, ParserConfigurationExcep @Test public void testEmptyFlow() throws IOException { - runInModules("xdmp:directory-create(\"/ext/domains/test/canonical/empty-flow/\")"); - installModule("/ext/domains/test/canonical/empty-flow/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); + runInModules("xdmp:directory-create(\"/ext/domains/test/conformance/empty-flow/\")"); + installModule("/ext/domains/test/conformance/empty-flow/collector/collector.xqy", "flow-manager-test/my-test-flow1/collector/collector.xqy"); FlowManager fm = new FlowManager(client); SimpleFlow flow1 = (SimpleFlow)fm.getFlow("test", "empty-flow"); @@ -115,7 +115,7 @@ public void testEmptyFlow() throws IOException { ServerCollector c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/canonical/empty-flow/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/empty-flow/collector/collector.xqy", c.getModule()); ServerPlugin t = (ServerPlugin)flow1.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -127,12 +127,12 @@ public void testEmptyFlow() throws IOException { DefaultWriter w = (DefaultWriter)flow1.getWriter(); assertNotNull(w); - runInModules("xdmp:directory-delete(\"/ext/domains/test/canonical/empty-flow/\")"); + runInModules("xdmp:directory-delete(\"/ext/domains/test/conformance/empty-flow/\")"); } @Test public void testSimpleFlowToXml() throws IOException, ParserConfigurationException, SAXException { - SimpleFlow flow = new SimpleFlow("test", "my-test-flow", "canonical"); + SimpleFlow flow = new SimpleFlow("test", "my-test-flow", "conformance"); flow.setCollector(new QueryCollector()); flow.setContentPlugin(new ContentPlugin()); flow.setHeaderPlugin(new HeadersPlugin()); @@ -155,7 +155,7 @@ public void testGetFlows() { ServerCollector c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/canonical/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); ServerPlugin t = (ServerPlugin)flow1.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -172,7 +172,7 @@ public void testGetFlows() { c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/canonical/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); t = (ServerPlugin)flow2.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -193,7 +193,7 @@ public void getTestFlow() { ServerCollector c = (ServerCollector)flow1.getCollector(); assertEquals("xquery", c.getType()); - assertEquals("/ext/domains/test/canonical/my-test-flow1/collector/collector.xqy", c.getModule()); + assertEquals("/ext/domains/test/conformance/my-test-flow1/collector/collector.xqy", c.getModule()); ServerPlugin t = (ServerPlugin)flow1.getContentPlugin(); assertEquals("xquery", t.getType()); @@ -218,8 +218,8 @@ public void testRunFlow() throws SAXException, IOException, ParserConfigurationE @Test public void testRunFlowWithHeader() throws SAXException, IOException, ParserConfigurationException, XMLStreamException { - installModule("/ext/domains/test/canonical/my-test-flow-with-header/collector/collector.xqy", "flow-manager-test/my-test-flow-with-header/collector/collector.xqy"); - installModule("/ext/domains/test/canonical/my-test-flow-with-header/headers/headers.xqy", "flow-manager-test/my-test-flow-with-header/headers/headers.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow-with-header/collector/collector.xqy", "flow-manager-test/my-test-flow-with-header/collector/collector.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow-with-header/headers/headers.xqy", "flow-manager-test/my-test-flow-with-header/headers/headers.xqy"); assertEquals(2, getDocCount()); FlowManager fm = new FlowManager(client); @@ -229,15 +229,15 @@ public void testRunFlowWithHeader() throws SAXException, IOException, ParserConf assertXMLEqual(getXmlFromResource("flow-manager-test/conformed-with-header/conformed1.xml"), docMgr.read("/conformed/incoming/employee1.xml").next().getContent(new DOMHandle()).get() ); assertXMLEqual(getXmlFromResource("flow-manager-test/conformed-with-header/conformed2.xml"), docMgr.read("/conformed/incoming/employee2.xml").next().getContent(new DOMHandle()).get()); - runInModules("xdmp:directory-delete(\"/ext/domains/test/canonical/my-test-flow-with-header/\")"); + runInModules("xdmp:directory-delete(\"/ext/domains/test/conformance/my-test-flow-with-header/\")"); } @Test public void testRunFlowWithAll() throws SAXException, IOException, ParserConfigurationException, XMLStreamException { - installModule("/ext/domains/test/canonical/my-test-flow-with-all/collector/collector.xqy", "flow-manager-test/my-test-flow-with-all/collector/collector.xqy"); - installModule("/ext/domains/test/canonical/my-test-flow-with-all/headers/headers.xqy", "flow-manager-test/my-test-flow-with-all/headers/headers.xqy"); - installModule("/ext/domains/test/canonical/my-test-flow-with-all/content/content.xqy", "flow-manager-test/my-test-flow-with-all/content/content.xqy"); - installModule("/ext/domains/test/canonical/my-test-flow-with-all/triples/triples.xqy", "flow-manager-test/my-test-flow-with-all/triples/triples.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow-with-all/collector/collector.xqy", "flow-manager-test/my-test-flow-with-all/collector/collector.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow-with-all/headers/headers.xqy", "flow-manager-test/my-test-flow-with-all/headers/headers.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow-with-all/content/content.xqy", "flow-manager-test/my-test-flow-with-all/content/content.xqy"); + installModule("/ext/domains/test/conformance/my-test-flow-with-all/triples/triples.xqy", "flow-manager-test/my-test-flow-with-all/triples/triples.xqy"); assertEquals(2, getDocCount()); FlowManager fm = new FlowManager(client); @@ -247,6 +247,6 @@ public void testRunFlowWithAll() throws SAXException, IOException, ParserConfigu assertXMLEqual(getXmlFromResource("flow-manager-test/conformed-with-all/conformed1.xml"), docMgr.read("/conformed/incoming/employee1.xml").next().getContent(new DOMHandle()).get() ); assertXMLEqual(getXmlFromResource("flow-manager-test/conformed-with-all/conformed2.xml"), docMgr.read("/conformed/incoming/employee2.xml").next().getContent(new DOMHandle()).get()); - runInModules("xdmp:directory-delete(\"/ext/domains/test/canonical/my-test-flow-with-all/\")"); + runInModules("xdmp:directory-delete(\"/ext/domains/test/conformance/my-test-flow-with-all/\")"); } } diff --git a/quick-start/src/main/java/com/marklogic/hub/model/FlowType.java b/quick-start/src/main/java/com/marklogic/hub/model/FlowType.java index 4bd478c848..61ccbb5a04 100644 --- a/quick-start/src/main/java/com/marklogic/hub/model/FlowType.java +++ b/quick-start/src/main/java/com/marklogic/hub/model/FlowType.java @@ -2,7 +2,7 @@ public enum FlowType { - INPUT("input", "Input Flow"), CONFORM("conform", "Conformance Flow"); + INPUT("input", "Input Flow"), CONFORM("conformance", "Conformance Flow"); public String name; public String type; diff --git a/quick-start/src/main/java/com/marklogic/hub/service/DomainManagerService.java b/quick-start/src/main/java/com/marklogic/hub/service/DomainManagerService.java index bdbe6dec90..c3338724ef 100644 --- a/quick-start/src/main/java/com/marklogic/hub/service/DomainManagerService.java +++ b/quick-start/src/main/java/com/marklogic/hub/service/DomainManagerService.java @@ -66,7 +66,7 @@ private List getDomainsInServer() { try { DomainManager domainManager = getDomainManager(); domainsInServer = domainManager.getDomains(); - } catch (MarkLogicServerException e) { + } catch (Exception e) { // TODO catch this temporarily // This should not return an error as the deploy to server should // validate the plugins beforehand