Skip to content

Commit 6abc3cc

Browse files
committed
Update GetCQLBase.java
1 parent f19532f commit 6abc3cc

File tree

1 file changed

+4
-23
lines changed
  • nifi/cql-processor/nifi-cql-processors/src/test/java/org/george0st/processors/cql

1 file changed

+4
-23
lines changed

nifi/cql-processor/nifi-cql-processors/src/test/java/org/george0st/processors/cql/GetCQLBase.java

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected List<MockFlowFile> runTestParallelWithProperty(TestSetupRead setup, St
116116
testRunner.enableControllerService(testService);
117117
if (parallel>1)
118118
testRunner.setThreadCount(parallel);
119-
results = coreTestParallel(setup, content, validate);
119+
results = coreTestParallel(setup, content, validate, parallel);
120120
testRunner.disableControllerService(testService);
121121
return results;
122122
}
@@ -135,32 +135,22 @@ private void printResult(MockFlowFile result, TestSetupRead setup, long start, l
135135
System.lineSeparator());
136136
}
137137

138-
private List<MockFlowFile> coreTestParallel(TestSetupRead setup, String content, boolean validate) throws Exception {
138+
private List<MockFlowFile> coreTestParallel(TestSetupRead setup, String content, boolean validate, int parallel) throws Exception {
139139
try {
140140
long finish, start, countWrite;
141141
List<MockFlowFile> results;
142142
boolean ok;
143143

144144
start = System.currentTimeMillis();
145-
testRunner.run(2);
145+
testRunner.run(parallel);
146146
if (!testRunner.getFlowFilesForRelationship(PutCQL.REL_SUCCESS).isEmpty()) {
147147
results = testRunner.getFlowFilesForRelationship(PutCQL.REL_SUCCESS);
148148
ok = testRunner.getFlowFilesForRelationship(PutCQL.REL_FAILURE).isEmpty();
149149
finish = System.currentTimeMillis();
150150

151151
if (ok) {
152-
for (MockFlowFile result: results) {
152+
for (MockFlowFile result: results)
153153
printResult(result, setup, start, finish);
154-
// countWrite = Long.parseLong(result.getAttribute(CQLAttributes.READ_COUNT));
155-
// System.out.printf("Source: '%s'; READ; '%s': %s (%d ms); Items: %d; Perf: %.1f [calls/sec]%s",
156-
// setup.name,
157-
// "FlowFile",
158-
// ReadableValue.fromMillisecond(finish - start),
159-
// finish - start,
160-
// countWrite,
161-
// countWrite / ((finish - start) / 1000.0),
162-
// System.lineSeparator());
163-
}
164154
return results;
165155
}
166156
}
@@ -186,15 +176,6 @@ private MockFlowFile coreTest(TestSetupRead setup, String content, boolean valid
186176

187177
if (ok) {
188178
printResult(result, setup, start, finish);
189-
// countWrite = Long.parseLong(result.getAttribute(CQLAttributes.READ_COUNT));
190-
// System.out.printf("Source: '%s'; READ; '%s': %s (%d ms); Items: %d; Perf: %.1f [calls/sec]%s",
191-
// setup.name,
192-
// "FlowFile",
193-
// ReadableValue.fromMillisecond(finish - start),
194-
// finish - start,
195-
// countWrite,
196-
// countWrite / ((finish - start) / 1000.0),
197-
// System.lineSeparator());
198179
return result;
199180
}
200181
}

0 commit comments

Comments
 (0)