Skip to content

Commit aa8684f

Browse files
committed
#512
1 parent 170614d commit aa8684f

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

marklogic-data-hub/src/main/java/com/marklogic/hub/deploy/commands/LoadUserModulesCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ public void execute(CommandContext context) {
174174
handle.setFormat(Format.XML);
175175
documentWriteSet.add(flow.getFlowDbPath(), handle);
176176
}
177-
documentManager.write(documentWriteSet);
177+
if (documentWriteSet.size() > 0) {
178+
documentManager.write(documentWriteSet);
179+
}
178180

179181
Files.walkFileTree(startPath, new SimpleFileVisitor<Path>() {
180182
@Override

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ public static void setup() throws IOException, InterruptedException, ParserConfi
146146
createLegacyFlow("legacy", codeFormat, dataFormat, flowType);
147147
});
148148

149+
allCombos((codeFormat, dataFormat, flowType) -> {
150+
createFlow("has a space ", codeFormat, dataFormat, flowType, null);
151+
});
152+
149153
flowManager = new FlowManager(getHubConfig());
150154
List<String> legacyFlows = flowManager.getLegacyFlows();
151155
assertEquals(8, legacyFlows.size(), String.join("\n", legacyFlows));
@@ -214,6 +218,30 @@ public List<DynamicTest> generateTests() throws InterruptedException, ParserConf
214218
});
215219

216220

221+
allCombos((codeFormat, dataFormat, flowType) -> {
222+
String prefix = "has a space ";
223+
String flowName = getFlowName(prefix, codeFormat, dataFormat, flowType);
224+
if (flowType.equals(FlowType.INPUT)) {
225+
tests.add(DynamicTest.dynamicTest(flowName + " MLCP", () -> {
226+
Map<String, Object> options = new HashMap<>();
227+
FinalCounts finalCounts = new FinalCounts(1, 0, 2, 1, 0, 0, 1, 0, 0, 0, "FINISHED");
228+
testInputFlowViaMlcp(prefix, "", stagingClient, codeFormat, dataFormat, options, finalCounts);
229+
}));
230+
tests.add(DynamicTest.dynamicTest(flowName + " REST", () -> {
231+
Map<String, Object> options = new HashMap<>();
232+
FinalCounts finalCounts = new FinalCounts(1, 0, 2, 0, 0, 0, 0, 0, 0, 0, "FINISHED");
233+
testInputFlowViaREST(prefix, "", codeFormat, dataFormat, options, finalCounts);
234+
}));
235+
}
236+
else {
237+
Map<String, Object> options = new HashMap<>();
238+
tests.add(DynamicTest.dynamicTest(flowName + " wait", () -> {
239+
FinalCounts finalCounts = new FinalCounts(TEST_SIZE, TEST_SIZE + 1, TEST_SIZE + 1, 1, TEST_SIZE, 0, TEST_SIZE, 0, TEST_SIZE/BATCH_SIZE, 0, "FINISHED");
240+
testHarmonizeFlow(prefix, codeFormat, dataFormat, options, stagingClient, HubConfig.DEFAULT_FINAL_NAME, finalCounts, true);
241+
}));
242+
}
243+
});
244+
217245
allCombos((codeFormat, dataFormat, flowType) -> {
218246
String prefix = "1x-legacy";
219247
String flowName = getFlowName(prefix, codeFormat, dataFormat, flowType);

0 commit comments

Comments
 (0)