Search in sources :

Example 1 with TestCaseStepActionControlExecution

use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.

the class TestCaseStepActionControlExecutionDAO method findTestCaseStepActionControlExecutionByCriteria.

@Override
public List<TestCaseStepActionControlExecution> findTestCaseStepActionControlExecutionByCriteria(long id, String test, String testCase, int step, int index, int sequence) {
    List<TestCaseStepActionControlExecution> result = null;
    TestCaseStepActionControlExecution resultData;
    boolean throwEx = false;
    final String query = "SELECT * FROM testcasestepactioncontrolexecution WHERE id = ? AND test = ? AND testcase = ? AND step = ? AND `index` = ? AND sequence = ? ORDER BY sort";
    Connection connection = this.databaseSpring.connect();
    try {
        PreparedStatement preStat = connection.prepareStatement(query);
        try {
            preStat.setString(1, String.valueOf(id));
            preStat.setString(2, test);
            preStat.setString(3, testCase);
            preStat.setInt(4, step);
            preStat.setInt(5, index);
            preStat.setInt(6, sequence);
            ResultSet resultSet = preStat.executeQuery();
            try {
                result = new ArrayList<TestCaseStepActionControlExecution>();
                while (resultSet.next()) {
                    result.add(this.loadFromResultset(resultSet));
                }
            } catch (SQLException exception) {
                LOG.warn("Unable to execute query : " + exception.toString());
            } finally {
                resultSet.close();
            }
        } catch (SQLException exception) {
            LOG.warn("Unable to execute query : " + exception.toString());
        } finally {
            preStat.close();
        }
    } catch (SQLException exception) {
        LOG.warn("Unable to execute query : " + exception.toString());
    } finally {
        try {
            if (connection != null) {
                connection.close();
            }
        } catch (SQLException e) {
            LOG.warn(e.toString());
        }
    }
    return result;
}
Also used : IFactoryTestCaseStepActionControlExecution(org.cerberus.crud.factory.IFactoryTestCaseStepActionControlExecution) TestCaseStepActionControlExecution(org.cerberus.crud.entity.TestCaseStepActionControlExecution) SQLException(java.sql.SQLException) Connection(java.sql.Connection) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement)

Example 2 with TestCaseStepActionControlExecution

use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.

the class TestCaseStepActionControlExecutionDAO method readByVarious1.

@Override
public AnswerList readByVarious1(long executionId, String test, String testCase, int step, int index, int sequence) {
    MessageEvent msg;
    AnswerList answer = new AnswerList();
    List<TestCaseStepActionControlExecution> list = new ArrayList<TestCaseStepActionControlExecution>();
    StringBuilder query = new StringBuilder();
    query.append("SELECT * FROM testcasestepactioncontrolexecution a ");
    query.append("where id = ? and test = ? and testcase = ? and step = ? and `index` = ? ");
    query.append("and sequence = ?");
    // Debug message on SQL.
    if (LOG.isDebugEnabled()) {
        LOG.debug("SQL : " + query.toString());
    }
    Connection connection = this.databaseSpring.connect();
    try {
        PreparedStatement preStat = connection.prepareStatement(query.toString());
        try {
            preStat.setLong(1, executionId);
            preStat.setString(2, test);
            preStat.setString(3, testCase);
            preStat.setInt(4, step);
            preStat.setInt(5, index);
            preStat.setInt(6, sequence);
            ResultSet resultSet = preStat.executeQuery();
            try {
                while (resultSet.next()) {
                    list.add(this.loadFromResultset(resultSet));
                }
                if (list.isEmpty()) {
                    msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_NO_DATA_FOUND);
                } else {
                    msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_OK);
                }
            } catch (SQLException exception) {
                LOG.error("Unable to execute query : " + exception.toString());
                msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);
                msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", exception.toString()));
                list.clear();
            } finally {
                if (resultSet != null) {
                    resultSet.close();
                }
            }
        } catch (SQLException exception) {
            LOG.error("Unable to execute query : " + exception.toString());
            msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);
            msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", exception.toString()));
        } finally {
            if (preStat != null) {
                preStat.close();
            }
        }
    } catch (SQLException exception) {
        LOG.error("Unable to execute query : " + exception.toString());
        msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);
        msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", exception.toString()));
    } finally {
        try {
            if (connection != null) {
                connection.close();
            }
        } catch (SQLException exception) {
            LOG.warn("Unable to close connection : " + exception.toString());
        }
    }
    answer.setTotalRows(list.size());
    answer.setDataList(list);
    answer.setResultMessage(msg);
    return answer;
}
Also used : AnswerList(org.cerberus.util.answer.AnswerList) IFactoryTestCaseStepActionControlExecution(org.cerberus.crud.factory.IFactoryTestCaseStepActionControlExecution) TestCaseStepActionControlExecution(org.cerberus.crud.entity.TestCaseStepActionControlExecution) SQLException(java.sql.SQLException) MessageEvent(org.cerberus.engine.entity.MessageEvent) ArrayList(java.util.ArrayList) Connection(java.sql.Connection) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement)

Example 3 with TestCaseStepActionControlExecution

use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.

the class TestCaseStepActionControlExecutionDAO method readByKey.

@Override
public AnswerItem readByKey(long executionId, String test, String testCase, int step, int index, int sequence, int controlSequence) {
    MessageEvent msg;
    AnswerItem answer = new AnswerItem();
    TestCaseStepActionControlExecution tcsa = null;
    StringBuilder query = new StringBuilder();
    query.append("SELECT * FROM testcasestepactioncontrolexecution a ");
    query.append("where id = ? and test = ? and testcase = ? and step = ? and `index` = ? and controlSequence = ?");
    query.append("and sequence = ?");
    // Debug message on SQL.
    if (LOG.isDebugEnabled()) {
        LOG.debug("SQL : " + query.toString());
    }
    Connection connection = this.databaseSpring.connect();
    try {
        PreparedStatement preStat = connection.prepareStatement(query.toString());
        try {
            preStat.setLong(1, executionId);
            preStat.setString(2, test);
            preStat.setString(3, testCase);
            preStat.setInt(4, step);
            preStat.setInt(5, index);
            preStat.setInt(6, sequence);
            preStat.setInt(7, controlSequence);
            ResultSet resultSet = preStat.executeQuery();
            try {
                while (resultSet.next()) {
                    tcsa = this.loadFromResultset(resultSet);
                }
                if (tcsa == null) {
                    msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_NO_DATA_FOUND);
                } else {
                    msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_OK);
                }
            } catch (SQLException exception) {
                LOG.error("Unable to execute query : " + exception.toString());
                msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);
                msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", exception.toString()));
            } finally {
                if (resultSet != null) {
                    resultSet.close();
                }
            }
        } catch (SQLException exception) {
            LOG.error("Unable to execute query : " + exception.toString());
            msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);
            msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", exception.toString()));
        } finally {
            if (preStat != null) {
                preStat.close();
            }
        }
    } catch (SQLException exception) {
        LOG.error("Unable to execute query : " + exception.toString());
        msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);
        msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", exception.toString()));
    } finally {
        try {
            if (connection != null) {
                connection.close();
            }
        } catch (SQLException exception) {
            LOG.warn("Unable to close connection : " + exception.toString());
        }
    }
    answer.setItem(tcsa);
    answer.setResultMessage(msg);
    return answer;
}
Also used : IFactoryTestCaseStepActionControlExecution(org.cerberus.crud.factory.IFactoryTestCaseStepActionControlExecution) TestCaseStepActionControlExecution(org.cerberus.crud.entity.TestCaseStepActionControlExecution) SQLException(java.sql.SQLException) MessageEvent(org.cerberus.engine.entity.MessageEvent) Connection(java.sql.Connection) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement) AnswerItem(org.cerberus.util.answer.AnswerItem)

Example 4 with TestCaseStepActionControlExecution

use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.

the class FactoryTestCaseStepActionControlExecution method create.

@Override
public TestCaseStepActionControlExecution create(long id, String test, String testCase, int step, int index, int sequence, int controlSequence, int sort, String returnCode, String returnMessage, String conditionOper, String conditionVal1Init, String conditionVal2Init, String conditionVal1, String conditionVal2, String control, String value1Init, String value2Init, String value1, String value2, String fatal, long start, long end, long startLong, long endLong, String description, TestCaseStepActionExecution testCaseStepActionExecution, MessageEvent resultMessage) {
    TestCaseStepActionControlExecution testCaseStepActionControlExecution = new TestCaseStepActionControlExecution();
    testCaseStepActionControlExecution.setId(id);
    testCaseStepActionControlExecution.setTest(test);
    testCaseStepActionControlExecution.setTestCase(testCase);
    testCaseStepActionControlExecution.setStep(step);
    testCaseStepActionControlExecution.setIndex(index);
    testCaseStepActionControlExecution.setSequence(sequence);
    testCaseStepActionControlExecution.setControlSequence(controlSequence);
    testCaseStepActionControlExecution.setSort(sort);
    testCaseStepActionControlExecution.setReturnCode(returnCode);
    testCaseStepActionControlExecution.setReturnMessage(returnMessage);
    testCaseStepActionControlExecution.setConditionOper(conditionOper);
    testCaseStepActionControlExecution.setConditionVal1Init(conditionVal1Init);
    testCaseStepActionControlExecution.setConditionVal2Init(conditionVal2Init);
    testCaseStepActionControlExecution.setConditionVal1(conditionVal1);
    testCaseStepActionControlExecution.setConditionVal2(conditionVal2);
    testCaseStepActionControlExecution.setControl(control);
    testCaseStepActionControlExecution.setValue1(value1);
    testCaseStepActionControlExecution.setValue2(value2);
    testCaseStepActionControlExecution.setValue1Init(value1Init);
    testCaseStepActionControlExecution.setValue2Init(value2Init);
    testCaseStepActionControlExecution.setFatal(fatal);
    testCaseStepActionControlExecution.setStart(start);
    testCaseStepActionControlExecution.setEnd(end);
    testCaseStepActionControlExecution.setStartLong(startLong);
    testCaseStepActionControlExecution.setEndLong(endLong);
    testCaseStepActionControlExecution.setTestCaseStepActionExecution(testCaseStepActionExecution);
    testCaseStepActionControlExecution.setControlResultMessage(resultMessage);
    testCaseStepActionControlExecution.setDescription(description);
    // List objects
    List<TestCaseExecutionFile> objectFileList = new ArrayList<TestCaseExecutionFile>();
    testCaseStepActionControlExecution.setFileList(objectFileList);
    return testCaseStepActionControlExecution;
}
Also used : IFactoryTestCaseStepActionControlExecution(org.cerberus.crud.factory.IFactoryTestCaseStepActionControlExecution) TestCaseStepActionControlExecution(org.cerberus.crud.entity.TestCaseStepActionControlExecution) ArrayList(java.util.ArrayList) TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile)

Example 5 with TestCaseStepActionControlExecution

use of org.cerberus.crud.entity.TestCaseStepActionControlExecution in project cerberus-source by cerberustesting.

the class ExecutionRunService method executeAction.

private TestCaseStepActionExecution executeAction(TestCaseStepActionExecution testCaseStepActionExecution, TestCaseExecution tcExecution) {
    LOG.debug("Starting execute Action : " + testCaseStepActionExecution.getAction());
    AnswerItem<String> answerDecode = new AnswerItem();
    /**
     * If execution is not manual, do action and record files
     */
    if (!tcExecution.getManualExecution().equals("Y")) {
        testCaseStepActionExecution = this.actionService.doAction(testCaseStepActionExecution);
        /**
         * Record Screenshot, PageSource
         */
        try {
            testCaseStepActionExecution.addFileList(recorderService.recordExecutionInformationAfterStepActionandControl(testCaseStepActionExecution, null));
        } catch (Exception ex) {
            LOG.warn("Unable to record Screenshot/PageSource : " + ex.toString());
        }
    } else {
        /**
         * If execution manual, set Action result message as notExecuted
         */
        testCaseStepActionExecution.setActionResultMessage(new MessageEvent(MessageEventEnum.ACTION_NOTEXECUTED));
        testCaseStepActionExecution.setExecutionResultMessage(new MessageGeneral(MessageGeneralEnum.EXECUTION_NE));
        testCaseStepActionExecution.setEnd(new Date().getTime());
    }
    /**
     * Register Action in database
     */
    LOG.debug("Registering Action : " + testCaseStepActionExecution.getAction());
    this.testCaseStepActionExecutionService.updateTestCaseStepActionExecution(testCaseStepActionExecution);
    LOG.debug("Registered Action");
    if (testCaseStepActionExecution.isStopExecution()) {
        return testCaseStepActionExecution;
    }
    // As controls are associated with an action, the current state for the action is stored in order to restore it
    // if some property is not defined for the country
    MessageEvent actionMessage = testCaseStepActionExecution.getActionResultMessage();
    MessageGeneral excutionResultMessage = testCaseStepActionExecution.getExecutionResultMessage();
    /**
     * Iterate Control
     */
    List<TestCaseStepActionControl> tcsacList = testCaseStepActionExecution.getTestCaseStepAction().getTestCaseStepActionControl();
    for (TestCaseStepActionControl testCaseStepActionControl : tcsacList) {
        /**
         * Start Execution of TestCAseStepActionControl
         */
        long startControl = new Date().getTime();
        /**
         * Create and Register TestCaseStepActionControlExecution
         */
        LOG.debug("Creating TestCaseStepActionControlExecution");
        TestCaseStepActionControlExecution testCaseStepActionControlExecution = factoryTestCaseStepActionControlExecution.create(testCaseStepActionExecution.getId(), testCaseStepActionControl.getTest(), testCaseStepActionControl.getTestCase(), testCaseStepActionControl.getStep(), testCaseStepActionExecution.getIndex(), testCaseStepActionControl.getSequence(), testCaseStepActionControl.getControlSequence(), testCaseStepActionControl.getSort(), null, null, testCaseStepActionControl.getConditionOper(), testCaseStepActionControl.getConditionVal1(), testCaseStepActionControl.getConditionVal2(), testCaseStepActionControl.getConditionVal1(), testCaseStepActionControl.getConditionVal2(), testCaseStepActionControl.getControl(), testCaseStepActionControl.getValue1(), testCaseStepActionControl.getValue2(), testCaseStepActionControl.getValue1(), testCaseStepActionControl.getValue2(), testCaseStepActionControl.getFatal(), startControl, 0, 0, 0, testCaseStepActionControl.getDescription(), testCaseStepActionExecution, new MessageEvent(MessageEventEnum.CONTROL_PENDING));
        this.testCaseStepActionControlExecutionService.insertTestCaseStepActionControlExecution(testCaseStepActionControlExecution);
        LOG.debug("Executing control : " + testCaseStepActionControlExecution.getControlSequence() + " type : " + testCaseStepActionControlExecution.getControl());
        /**
         * We populate the TestCase Control List
         */
        testCaseStepActionExecution.addTestCaseStepActionExecutionList(testCaseStepActionControlExecution);
        // Evaluate the condition at the control level.
        AnswerItem<Boolean> conditionAnswer;
        boolean conditionDecodeError = false;
        if (!tcExecution.getManualExecution().equals("Y")) {
            try {
                answerDecode = variableService.decodeStringCompletly(testCaseStepActionControlExecution.getConditionVal1(), tcExecution, null, false);
                testCaseStepActionControlExecution.setConditionVal1((String) answerDecode.getItem());
                if (!(answerDecode.isCodeStringEquals("OK"))) {
                    // If anything wrong with the decode --> we stop here with decode message in the action result.
                    testCaseStepActionControlExecution.setControlResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "Control Condition Value1"));
                    testCaseStepActionControlExecution.setExecutionResultMessage(new MessageGeneral(answerDecode.getResultMessage().getMessage()));
                    testCaseStepActionControlExecution.setStopExecution(answerDecode.getResultMessage().isStopTest());
                    testCaseStepActionControlExecution.setEnd(new Date().getTime());
                    LOG.debug("Control interupted due to decode 'Control Condition Value1' Error.");
                    conditionDecodeError = true;
                }
            } catch (CerberusEventException cex) {
                LOG.warn(cex);
            }
            try {
                answerDecode = variableService.decodeStringCompletly(testCaseStepActionControlExecution.getConditionVal2(), tcExecution, null, false);
                testCaseStepActionControlExecution.setConditionVal2((String) answerDecode.getItem());
                if (!(answerDecode.isCodeStringEquals("OK"))) {
                    // If anything wrong with the decode --> we stop here with decode message in the action result.
                    testCaseStepActionControlExecution.setControlResultMessage(answerDecode.getResultMessage().resolveDescription("FIELD", "Control Condition Value2"));
                    testCaseStepActionControlExecution.setExecutionResultMessage(new MessageGeneral(answerDecode.getResultMessage().getMessage()));
                    testCaseStepActionControlExecution.setStopExecution(answerDecode.getResultMessage().isStopTest());
                    testCaseStepActionControlExecution.setEnd(new Date().getTime());
                    LOG.debug("Control interupted due to decode 'Control Condition Value2' Error.");
                    conditionDecodeError = true;
                }
            } catch (CerberusEventException cex) {
                LOG.warn(cex);
            }
        }
        if (!(conditionDecodeError)) {
            conditionAnswer = this.conditionService.evaluateCondition(testCaseStepActionControlExecution.getConditionOper(), testCaseStepActionControlExecution.getConditionVal1(), testCaseStepActionControlExecution.getConditionVal2(), tcExecution);
            boolean execute_Control = (boolean) conditionAnswer.getItem();
            /**
             * If condition OK or if manual execution, then execute the
             * control
             */
            if (conditionAnswer.getResultMessage().getMessage().getCodeString().equals("PE") || tcExecution.getManualExecution().equals("Y")) {
                if (execute_Control || tcExecution.getManualExecution().equals("Y")) {
                    /**
                     * We execute the control
                     */
                    testCaseStepActionControlExecution = executeControl(testCaseStepActionControlExecution, tcExecution);
                    /**
                     * We update the Action with the execution message and
                     * stop flag from the control. We update the status only
                     * if the control is not OK. This is to prevent moving
                     * the status to OK when it should stay KO when a
                     * control failed previously.
                     */
                    testCaseStepActionExecution.setStopExecution(testCaseStepActionControlExecution.isStopExecution());
                    if (!(testCaseStepActionControlExecution.getControlResultMessage().equals(new MessageEvent(MessageEventEnum.CONTROL_SUCCESS)))) {
                        // NA is a special case of not having success while calculating the property; the action shouldn't be stopped
                        if (testCaseStepActionControlExecution.getControlResultMessage().equals(new MessageEvent(MessageEventEnum.PROPERTY_FAILED_NO_PROPERTY_DEFINITION))) {
                            // restores the messages information if the property is not defined for the country
                            testCaseStepActionExecution.setActionResultMessage(actionMessage);
                            testCaseStepActionExecution.setExecutionResultMessage(excutionResultMessage);
                        } else {
                            testCaseStepActionExecution.setExecutionResultMessage(testCaseStepActionControlExecution.getExecutionResultMessage());
                            testCaseStepActionExecution.setActionResultMessage(testCaseStepActionControlExecution.getControlResultMessage());
                        }
                    }
                    /**
                     * If Control reported to stop the testcase, we stop it.
                     */
                    if (testCaseStepActionControlExecution.isStopExecution()) {
                        break;
                    }
                } else {
                    // We don't execute the control and record a generic execution.
                    /**
                     * Record Screenshot, PageSource
                     */
                    testCaseStepActionControlExecution.addFileList(recorderService.recordExecutionInformationAfterStepActionandControl(testCaseStepActionControlExecution.getTestCaseStepActionExecution(), testCaseStepActionControlExecution));
                    /**
                     * Register Control in database
                     */
                    LOG.debug("Registering Control : " + testCaseStepActionControlExecution.getControlSequence());
                    // We change the Action message only if the action is not executed due to condition.
                    MessageEvent controlMes = new MessageEvent(MessageEventEnum.CONDITION_TESTCASECONTROL_NOTEXECUTED);
                    testCaseStepActionControlExecution.setControlResultMessage(controlMes);
                    testCaseStepActionControlExecution.setReturnMessage(testCaseStepActionControlExecution.getReturnMessage().replace("%COND%", testCaseStepActionControlExecution.getConditionOper()).replace("%MESSAGE%", conditionAnswer.getResultMessage().getDescription()));
                    testCaseStepActionControlExecution.setEnd(new Date().getTime());
                    this.testCaseStepActionControlExecutionService.updateTestCaseStepActionControlExecution(testCaseStepActionControlExecution);
                    LOG.debug("Registered Control");
                    // Websocket --> we refresh the corresponding Detail Execution pages attached to this execution.
                    if (tcExecution.isCerberus_featureflipping_activatewebsocketpush()) {
                        TestCaseExecutionEndPoint.getInstance().send(tcExecution, false);
                    }
                }
            } else {
                // Error when performing the condition evaluation. We force no execution (false)
                MessageGeneral mes = new MessageGeneral(MessageGeneralEnum.EXECUTION_FA_CONDITION);
                mes.setDescription(mes.getDescription().replace("%COND%", testCaseStepActionControlExecution.getConditionOper()).replace("%AREA%", "control ").replace("%MES%", conditionAnswer.getResultMessage().getDescription()));
                testCaseStepActionControlExecution.setExecutionResultMessage(mes);
                testCaseStepActionExecution.setExecutionResultMessage(mes);
                testCaseStepActionControlExecution.setControlResultMessage(new MessageEvent(MessageEventEnum.CONDITION_TESTCASECONTROL_FAILED).resolveDescription("AREA", "").resolveDescription("COND", testCaseStepActionControlExecution.getConditionOper()).resolveDescription("MESSAGE", conditionAnswer.getResultMessage().getDescription()));
                testCaseStepActionExecution.setActionResultMessage(new MessageEvent(MessageEventEnum.CONDITION_TESTCASEACTION_FAILED).resolveDescription("AREA", "control ").resolveDescription("COND", testCaseStepActionControlExecution.getConditionOper()).resolveDescription("MESSAGE", conditionAnswer.getResultMessage().getDescription()));
                testCaseStepActionControlExecution.setEnd(new Date().getTime());
                this.testCaseStepActionControlExecutionService.updateTestCaseStepActionControlExecution(testCaseStepActionControlExecution);
                LOG.debug("Control interupted due to condition error.");
                // We stop any further Control execution.
                break;
            }
        } else {
            testCaseStepActionControlExecution.setEnd(new Date().getTime());
            testCaseStepActionExecution.setExecutionResultMessage(testCaseStepActionControlExecution.getExecutionResultMessage());
            testCaseStepActionExecution.setActionResultMessage(testCaseStepActionControlExecution.getControlResultMessage());
            this.testCaseStepActionControlExecutionService.updateTestCaseStepActionControlExecution(testCaseStepActionControlExecution);
            LOG.debug("Registered Control");
            // Websocket --> we refresh the corresponding Detail Execution pages attached to this execution.
            if (tcExecution.isCerberus_featureflipping_activatewebsocketpush()) {
                TestCaseExecutionEndPoint.getInstance().send(tcExecution, false);
            }
        }
        /**
         * Log TestCaseStepActionControlExecution
         */
        if (tcExecution.getVerbose() > 0) {
            LOG.info(testCaseStepActionControlExecution.toJson(false, true));
        }
    }
    // Websocket --> we refresh the corresponding Detail Execution pages attached to this execution.
    if (tcExecution.isCerberus_featureflipping_activatewebsocketpush()) {
        TestCaseExecutionEndPoint.getInstance().send(tcExecution, false);
    }
    LOG.debug("Finished execute Action : " + testCaseStepActionExecution.getAction());
    return testCaseStepActionExecution;
}
Also used : MessageEvent(org.cerberus.engine.entity.MessageEvent) AnswerItem(org.cerberus.util.answer.AnswerItem) CerberusEventException(org.cerberus.exception.CerberusEventException) CerberusException(org.cerberus.exception.CerberusException) WebDriverException(org.openqa.selenium.WebDriverException) Date(java.util.Date) CerberusEventException(org.cerberus.exception.CerberusEventException) MessageGeneral(org.cerberus.engine.entity.MessageGeneral) TestCaseStepActionControlExecution(org.cerberus.crud.entity.TestCaseStepActionControlExecution) IFactoryTestCaseStepActionControlExecution(org.cerberus.crud.factory.IFactoryTestCaseStepActionControlExecution) TestCaseStepActionControl(org.cerberus.crud.entity.TestCaseStepActionControl)

Aggregations

TestCaseStepActionControlExecution (org.cerberus.crud.entity.TestCaseStepActionControlExecution)39 TestCaseStepActionExecution (org.cerberus.crud.entity.TestCaseStepActionExecution)29 TestCaseStepExecution (org.cerberus.crud.entity.TestCaseStepExecution)26 Test (org.junit.Test)26 ArrayList (java.util.ArrayList)5 IFactoryTestCaseStepActionControlExecution (org.cerberus.crud.factory.IFactoryTestCaseStepActionControlExecution)5 TestCaseExecutionFile (org.cerberus.crud.entity.TestCaseExecutionFile)4 MessageEvent (org.cerberus.engine.entity.MessageEvent)4 Connection (java.sql.Connection)3 PreparedStatement (java.sql.PreparedStatement)3 ResultSet (java.sql.ResultSet)3 SQLException (java.sql.SQLException)3 AnswerList (org.cerberus.util.answer.AnswerList)3 JSONObject (org.json.JSONObject)3 AnswerItem (org.cerberus.util.answer.AnswerItem)2 Ignore (org.junit.Ignore)2 Gson (com.google.gson.Gson)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 FileItem (org.apache.commons.fileupload.FileItem)1