diff --git a/data-hub/src/test/java/com/marklogic/hub/DataHubTest.java b/data-hub/src/test/java/com/marklogic/hub/DataHubTest.java index 13bb22267a..16d309ba12 100644 --- a/data-hub/src/test/java/com/marklogic/hub/DataHubTest.java +++ b/data-hub/src/test/java/com/marklogic/hub/DataHubTest.java @@ -27,26 +27,12 @@ import org.junit.rules.ExpectedException; public class DataHubTest extends HubTestBase { - private static String host; - private static int restPort; - private static String user; - private static String password; - @Rule public final ExpectedException exception = ExpectedException.none(); - @BeforeClass - public static void setup() { - Properties properties = getProperties(); - host = properties.getProperty("mlHost"); - restPort = Integer.parseInt(properties.getProperty("mlRestPort")); - user = properties.getProperty("mlUsername"); - password = properties.getProperty("mlPassword"); - } - @Test public void testInstall() throws IOException { - DataHub dh = new DataHub(host, restPort, user, password); + DataHub dh = new DataHub(host, port, user, password); if (dh.isInstalled()) { // uninstall first dh.uninstall(); @@ -59,9 +45,8 @@ public void testInstall() throws IOException { @Test public void testUnInstall() throws IOException { - DataHub dh = new DataHub(host, restPort, user, password); + DataHub dh = new DataHub(host, port, user, password); if (false == dh.isInstalled()) { - // uninstall first dh.install(); } assertTrue(dh.isInstalled()); @@ -71,7 +56,7 @@ public void testUnInstall() throws IOException { @Test public void testValidateServer() throws ServerValidationException { - DataHub dh = new DataHub(host, restPort, user, password); + DataHub dh = new DataHub(host, port, user, password); dh.validateServer(); } 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 9ce4ec1638..6f36390fea 100644 --- a/data-hub/src/test/java/com/marklogic/hub/DomainManagerTest.java +++ b/data-hub/src/test/java/com/marklogic/hub/DomainManagerTest.java @@ -42,6 +42,12 @@ public class DomainManagerTest extends HubTestBase { @BeforeClass public static void setup() throws IOException { XMLUnit.setIgnoreWhitespace(true); + + DataHub dh = new DataHub(host, port, user, password); + if (false == dh.isInstalled()) { + dh.install(); + } + DocumentMetadataHandle meta = new DocumentMetadataHandle(); meta.getCollections().add("tester"); installDoc("/incoming/employee1.xml", meta, getResource("flow-manager-test/input/employee1.xml")); 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 e9f5382baf..17719e37f9 100644 --- a/data-hub/src/test/java/com/marklogic/hub/FlowManagerTest.java +++ b/data-hub/src/test/java/com/marklogic/hub/FlowManagerTest.java @@ -53,6 +53,12 @@ public class FlowManagerTest extends HubTestBase { @BeforeClass public static void setup() throws IOException { XMLUnit.setIgnoreWhitespace(true); + + DataHub dh = new DataHub(host, port, user, password); + if (false == dh.isInstalled()) { + dh.install(); + } + DocumentMetadataHandle meta = new DocumentMetadataHandle(); meta.getCollections().add("tester"); installDoc("/incoming/employee1.xml", meta, getResource("flow-manager-test/input/employee1.xml")); diff --git a/data-hub/src/test/java/com/marklogic/hub/HubTestBase.java b/data-hub/src/test/java/com/marklogic/hub/HubTestBase.java index e873df811a..d550fe0333 100644 --- a/data-hub/src/test/java/com/marklogic/hub/HubTestBase.java +++ b/data-hub/src/test/java/com/marklogic/hub/HubTestBase.java @@ -69,7 +69,6 @@ private static XMLDocumentManager init() { } catch (IOException e) { System.err.println("Properties file not loaded."); - System.exit(1); } // try to load the local environment overrides file @@ -80,7 +79,6 @@ private static XMLDocumentManager init() { } catch (IOException e) { System.err.println("Properties file not loaded."); - System.exit(1); } host = properties.getProperty("mlHost"); diff --git a/quick-start/src/main/java/com/marklogic/hub/factory/DomainModelFactory.java b/quick-start/src/main/java/com/marklogic/hub/factory/DomainModelFactory.java index f2ea7c08cb..19f151240f 100644 --- a/quick-start/src/main/java/com/marklogic/hub/factory/DomainModelFactory.java +++ b/quick-start/src/main/java/com/marklogic/hub/factory/DomainModelFactory.java @@ -35,21 +35,26 @@ public DomainModel createNewDomain(String userPluginDir, String domainName, domainModel.setDomainName(domainName); domainModel.setInputFlows(new ArrayList<>()); domainModel.setConformFlows(new ArrayList<>()); - FileUtil.createFolderIfNecessary(userPluginDir + File.separator - + FileUtil.DOMAINS_FOLDER, domainName); + + String domainsPath = userPluginDir + File.separator + FileUtil.DOMAINS_FOLDER; + FileUtil.createFolderIfNecessary(domainsPath, domainName); FlowModelFactory flowModelFactory = new FlowModelFactory(domainName); - String domainDirPath = userPluginDir + File.separator - + FileUtil.DOMAINS_FOLDER + File.separator + domainName; - FlowModel inputFlow = flowModelFactory.createNewFlow(domainDirPath - + File.separator + FlowType.INPUT, inputFlowName, - FlowType.INPUT); - FlowModel conformFlow = flowModelFactory.createNewFlow(domainDirPath + String domainDirPath = domainsPath + File.separator + domainName; + if (inputFlowName != null) { + FlowModel inputFlow = flowModelFactory.createNewFlow(domainDirPath + + File.separator + FlowType.INPUT, inputFlowName, + FlowType.INPUT); + domainModel.getInputFlows().add(inputFlow); + } + + if (conformFlowName != null) { + FlowModel conformFlow = flowModelFactory.createNewFlow(domainDirPath + File.separator + FlowType.CONFORM, conformFlowName, FlowType.CONFORM); - domainModel.getInputFlows().add(inputFlow); - domainModel.getConformFlows().add(conformFlow); + domainModel.getConformFlows().add(conformFlow); + } return domainModel; } 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 ecf0d0ed27..509af7c531 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 @@ -28,4 +28,8 @@ public static FlowType getFlowType(String type) { } return null; } + + public String toString() { + return name; + } } diff --git a/quick-start/src/main/webapp/WEB-INF/static/top/modal/domainModal.html b/quick-start/src/main/webapp/WEB-INF/static/top/modal/domainModal.html index dc74f8872f..cfc9ffc587 100644 --- a/quick-start/src/main/webapp/WEB-INF/static/top/modal/domainModal.html +++ b/quick-start/src/main/webapp/WEB-INF/static/top/modal/domainModal.html @@ -1,44 +1,43 @@