use of com.sequenceiq.flow.domain.FlowLog in project cloudbreak by hortonworks.
the class EvenFlowDistributorTest method getFlowLogs.
private List<FlowLog> getFlowLogs(int flowCount) {
List<FlowLog> flows = new ArrayList<>();
Random random = new SecureRandom();
int flowId = random.nextInt(5000);
long stackId = random.nextLong();
for (int i = 0; i < flowCount; i++) {
flows.add(new FlowLog(stackId + i, "" + flowId + i, "RUNNING", false, StateStatus.PENDING, OperationType.UNKNOWN));
}
return flows;
}
use of com.sequenceiq.flow.domain.FlowLog in project cloudbreak by hortonworks.
the class FlowComponentTest method shouldTolerateWhenFlowLogTypeOrPayloadTypeClassIsNotOnClassPath.
@Test
public void shouldTolerateWhenFlowLogTypeOrPayloadTypeClassIsNotOnClassPath() {
long resourceId = RESOURCE_ID_SEC.incrementAndGet();
FlowLog flowLog = new FlowLog(resourceId, "test-flow-id", null, "userCrn", "NEXT_EVENT", "payload", ClassValue.ofUnknown("nope.NopePayload"), "variables", ClassValue.ofUnknown("nope.NopeFlowType"), "CURRENT_STATE");
flowLog.setFinalized(true);
flowLogRepository.save(flowLog);
List<FlowLog> flowLogs = flowLogRepository.findAllByResourceIdOrderByCreatedDesc(resourceId);
assertEquals(1, flowLogs.size());
ClassValue flowType = flowLogs.get(0).getFlowType();
ClassValue payloadType = flowLogs.get(0).getPayloadType();
assertFalse(flowType.isOnClassPath());
assertFalse(payloadType.isOnClassPath());
}
use of com.sequenceiq.flow.domain.FlowLog in project cloudbreak by hortonworks.
the class FlowOperationStatisticsServiceTest method flowLogs.
private List<FlowLog> flowLogs() {
List<FlowLog> result = new ArrayList<>();
FlowLog fl1 = new FlowLog();
fl1.setOperationType(OperationType.PROVISION);
fl1.setFlowId("flowid");
fl1.setResourceId(1L);
fl1.setFlowType(ClassValue.of(flowConfiguration.getClass()));
result.add(fl1);
return result;
}
use of com.sequenceiq.flow.domain.FlowLog in project cloudbreak by hortonworks.
the class FlowCancelServiceTest method testCancelFlowSilentlyIgnoresException.
@Test
public void testCancelFlowSilentlyIgnoresException() throws TransactionExecutionException {
doThrow(new TransactionExecutionException("asdf", new RuntimeException())).when(flow2Handler).cancelFlow(anyLong(), anyString());
FlowLog flowLog = new FlowLog();
flowLog.setFlowId("asdf");
flowLog.setResourceId(1L);
underTest.cancelFlowSilently(flowLog);
}
use of com.sequenceiq.flow.domain.FlowLog in project cloudbreak by hortonworks.
the class FlowRetryServiceTest method createFlowLog.
private FlowLog createFlowLog(String currentState, StateStatus stateStatus, long created, String name) {
FlowLog flowLog = new FlowLog(STACK_ID, FLOW_ID, currentState, true, stateStatus, OperationType.UNKNOWN);
flowLog.setCreated(created);
flowLog.setFlowType(ClassValue.of(flowConfig.getClass()));
flowLog.setNextEvent(name);
return flowLog;
}
Aggregations