Skip to content

Commit bc85759

Browse files
committed
fixing broken tests
1 parent 5ee571a commit bc85759

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

marklogic-data-hub/src/test/java/com/marklogic/hub/DataHubInstallTest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package com.marklogic.hub;
22

3-
import org.apache.commons.io.FileUtils;
43
import org.custommonkey.xmlunit.XMLUnit;
54
import org.junit.AfterClass;
65
import org.junit.BeforeClass;
76
import org.junit.Test;
87
import org.xml.sax.SAXException;
98

109
import javax.xml.parsers.ParserConfigurationException;
11-
import java.io.File;
1210
import java.io.IOException;
1311
import java.net.URISyntaxException;
1412
import java.net.URL;
@@ -20,13 +18,11 @@
2018

2119
public class DataHubInstallTest extends HubTestBase {
2220

23-
private static File projectPath = new File("ye-olde-project");
24-
2521
private static DataHub dataHub;
2622
@BeforeClass
2723
public static void setup() throws IOException {
2824
XMLUnit.setIgnoreWhitespace(true);
29-
dataHub = new DataHub(getHubConfig(projectPath.toString()));
25+
dataHub = new DataHub(getHubConfig());
3026

3127
InstallInfo installInfo = dataHub.isInstalled();
3228
if (installInfo.isInstalled()) {
@@ -38,9 +34,7 @@ public static void setup() throws IOException {
3834

3935
@AfterClass
4036
public static void teardown() throws IOException {
41-
dataHub = new DataHub(getHubConfig(projectPath.toString()));
42-
dataHub.uninstall();
43-
FileUtils.deleteDirectory(projectPath);
37+
uninstallHub();
4438
}
4539

4640
@Test

marklogic-data-hub/src/test/java/com/marklogic/hub/EndToEndTestXqyXml.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ public static void setup() throws IOException {
4545

4646
installHub();
4747

48-
enableDebugging();
49-
5048
Scaffolding scaffolding = new Scaffolding(projectDir.toString());
5149
scaffolding.createEntity(ENTITY);
5250
scaffolding.createFlow(ENTITY, "testinput", FlowType.INPUT,

marklogic-data-hub/src/test/java/com/marklogic/hub/HubTestBase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ protected static void installHub() throws IOException {
221221
getDataHub().install();
222222
isInstalled = true;
223223
}
224+
else {
225+
File projectDir = new File(PROJECT_PATH);
226+
if (!projectDir.isDirectory() || !projectDir.exists()) {
227+
getDataHub().initProject();
228+
}
229+
}
224230
}
225231

226232
protected static void uninstallHub() throws IOException {

0 commit comments

Comments
 (0)