Search in sources :

Example 1 with TestCaseStepExecution

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

the class VariableService method decodeStringWithSystemVariable.

@Override
public String decodeStringWithSystemVariable(String stringToDecode, TestCaseExecution tCExecution) {
    try {
        /**
         * Trying to replace by system environment variables from Execution.
         */
        stringToDecode = stringToDecode.replace("%SYS_SYSTEM%", tCExecution.getApplicationObj().getSystem());
        stringToDecode = stringToDecode.replace("%SYS_APPLI%", tCExecution.getApplicationObj().getApplication());
        stringToDecode = stringToDecode.replace("%SYS_BROWSER%", tCExecution.getBrowser());
        stringToDecode = stringToDecode.replace("%SYS_APP_DOMAIN%", tCExecution.getCountryEnvironmentParameters().getDomain());
        stringToDecode = stringToDecode.replace("%SYS_APP_HOST%", tCExecution.getCountryEnvironmentParameters().getIp());
        stringToDecode = stringToDecode.replace("%SYS_APP_VAR1%", tCExecution.getCountryEnvironmentParameters().getVar1());
        stringToDecode = stringToDecode.replace("%SYS_APP_VAR2%", tCExecution.getCountryEnvironmentParameters().getVar2());
        stringToDecode = stringToDecode.replace("%SYS_APP_VAR3%", tCExecution.getCountryEnvironmentParameters().getVar3());
        stringToDecode = stringToDecode.replace("%SYS_APP_VAR4%", tCExecution.getCountryEnvironmentParameters().getVar4());
        stringToDecode = stringToDecode.replace("%SYS_ENV%", tCExecution.getEnvironmentData());
        stringToDecode = stringToDecode.replace("%SYS_ENVGP%", tCExecution.getEnvironmentDataObj().getGp1());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRY%", tCExecution.getCountry());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP1%", tCExecution.getCountryObj().getGp1());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP2%", tCExecution.getCountryObj().getGp2());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP3%", tCExecution.getCountryObj().getGp3());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP4%", tCExecution.getCountryObj().getGp4());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP5%", tCExecution.getCountryObj().getGp5());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP6%", tCExecution.getCountryObj().getGp6());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP7%", tCExecution.getCountryObj().getGp7());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP8%", tCExecution.getCountryObj().getGp8());
        stringToDecode = stringToDecode.replace("%SYS_COUNTRYGP9%", tCExecution.getCountryObj().getGp9());
        stringToDecode = stringToDecode.replace("%SYS_TEST%", tCExecution.getTest());
        stringToDecode = stringToDecode.replace("%SYS_TESTCASE%", tCExecution.getTestCase());
        stringToDecode = stringToDecode.replace("%SYS_TESTCASEDESCRIPTION%", tCExecution.getDescription());
        stringToDecode = stringToDecode.replace("%SYS_SSIP%", tCExecution.getSeleniumIP());
        stringToDecode = stringToDecode.replace("%SYS_SSPORT%", tCExecution.getSeleniumPort());
        stringToDecode = stringToDecode.replace("%SYS_TAG%", tCExecution.getTag());
        stringToDecode = stringToDecode.replace("%SYS_EXECUTIONID%", String.valueOf(tCExecution.getId()));
        stringToDecode = stringToDecode.replace("%SYS_EXESTART%", String.valueOf(new Timestamp(tCExecution.getStart())));
        stringToDecode = stringToDecode.replace("%SYS_EXESTORAGEURL%", recorderService.getStorageSubFolderURL(tCExecution.getId()));
        long nowInMS = new Date().getTime();
        stringToDecode = stringToDecode.replace("%SYS_EXEELAPSEDMS%", String.valueOf(nowInMS - tCExecution.getStart()));
        // New syntax
        stringToDecode = stringToDecode.replace("%system.SYSTEM%", tCExecution.getApplicationObj().getSystem());
        stringToDecode = stringToDecode.replace("%system.APPLI%", tCExecution.getApplicationObj().getApplication());
        stringToDecode = stringToDecode.replace("%system.BROWSER%", tCExecution.getBrowser());
        stringToDecode = stringToDecode.replace("%system.APP_DOMAIN%", tCExecution.getCountryEnvironmentParameters().getDomain());
        stringToDecode = stringToDecode.replace("%system.APP_HOST%", tCExecution.getCountryEnvironmentParameters().getIp());
        stringToDecode = stringToDecode.replace("%system.APP_VAR1%", tCExecution.getCountryEnvironmentParameters().getVar1());
        stringToDecode = stringToDecode.replace("%system.APP_VAR2%", tCExecution.getCountryEnvironmentParameters().getVar2());
        stringToDecode = stringToDecode.replace("%system.APP_VAR3%", tCExecution.getCountryEnvironmentParameters().getVar3());
        stringToDecode = stringToDecode.replace("%system.APP_VAR4%", tCExecution.getCountryEnvironmentParameters().getVar4());
        stringToDecode = stringToDecode.replace("%system.ENV%", tCExecution.getEnvironmentData());
        stringToDecode = stringToDecode.replace("%system.ENVGP%", tCExecution.getEnvironmentDataObj().getGp1());
        stringToDecode = stringToDecode.replace("%system.COUNTRY%", tCExecution.getCountry());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP1%", tCExecution.getCountryObj().getGp1());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP2%", tCExecution.getCountryObj().getGp2());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP3%", tCExecution.getCountryObj().getGp3());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP4%", tCExecution.getCountryObj().getGp4());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP5%", tCExecution.getCountryObj().getGp5());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP6%", tCExecution.getCountryObj().getGp6());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP7%", tCExecution.getCountryObj().getGp7());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP8%", tCExecution.getCountryObj().getGp8());
        stringToDecode = stringToDecode.replace("%system.COUNTRYGP9%", tCExecution.getCountryObj().getGp9());
        stringToDecode = stringToDecode.replace("%system.TEST%", tCExecution.getTest());
        stringToDecode = stringToDecode.replace("%system.TESTCASE%", tCExecution.getTestCase());
        stringToDecode = stringToDecode.replace("%system.TESTCASEDESCRIPTION%", tCExecution.getDescription());
        stringToDecode = stringToDecode.replace("%system.SSIP%", tCExecution.getSeleniumIP());
        stringToDecode = stringToDecode.replace("%system.SSPORT%", tCExecution.getSeleniumPort());
        stringToDecode = stringToDecode.replace("%system.TAG%", tCExecution.getTag());
        stringToDecode = stringToDecode.replace("%system.EXECUTIONID%", String.valueOf(tCExecution.getId()));
        stringToDecode = stringToDecode.replace("%system.EXESTART%", String.valueOf(new Timestamp(tCExecution.getStart())));
        stringToDecode = stringToDecode.replace("%system.EXESTORAGEURL%", recorderService.getStorageSubFolderURL(tCExecution.getId()));
        nowInMS = new Date().getTime();
        stringToDecode = stringToDecode.replace("%system.EXEELAPSEDMS%", String.valueOf(nowInMS - tCExecution.getStart()));
        /**
         * Trying to replace by system environment variables from Step
         * Execution .
         */
        if (tCExecution.getTestCaseStepExecutionList() != null) {
            if (tCExecution.getTestCaseStepExecutionList().size() > 0) {
                stringToDecode = stringToDecode.replace("%system.CURRENTSTEP_SORT%", String.valueOf(tCExecution.getTestCaseStepExecutionList().get(tCExecution.getTestCaseStepExecutionList().size() - 1).getSort()));
                stringToDecode = stringToDecode.replace("%SYS_CURRENTSTEP_SORT%", String.valueOf(tCExecution.getTestCaseStepExecutionList().get(tCExecution.getTestCaseStepExecutionList().size() - 1).getSort()));
                // %SYS_CURRENTSTEP_INDEX%
                if (stringToDecode.contains("%SYS_CURRENTSTEP_")) {
                    TestCaseStepExecution currentStep = (TestCaseStepExecution) tCExecution.getTestCaseStepExecutionList().get(tCExecution.getTestCaseStepExecutionList().size() - 1);
                    stringToDecode = stringToDecode.replace("%SYS_CURRENTSTEP_INDEX%", String.valueOf(currentStep.getIndex()));
                    stringToDecode = stringToDecode.replace("%SYS_CURRENTSTEP_STARTISO%", new Timestamp(currentStep.getStart()).toString());
                    nowInMS = new Date().getTime();
                    stringToDecode = stringToDecode.replace("%SYS_CURRENTSTEP_ELAPSEDMS%", String.valueOf(nowInMS - currentStep.getFullStart()));
                }
                if (stringToDecode.contains("%system.CURRENTSTEP_")) {
                    TestCaseStepExecution currentStep = (TestCaseStepExecution) tCExecution.getTestCaseStepExecutionList().get(tCExecution.getTestCaseStepExecutionList().size() - 1);
                    stringToDecode = stringToDecode.replace("%system.CURRENTSTEP_INDEX%", String.valueOf(currentStep.getIndex()));
                    stringToDecode = stringToDecode.replace("%system.CURRENTSTEP_STARTISO%", new Timestamp(currentStep.getStart()).toString());
                    nowInMS = new Date().getTime();
                    stringToDecode = stringToDecode.replace("%system.CURRENTSTEP_ELAPSEDMS%", String.valueOf(nowInMS - currentStep.getFullStart()));
                }
            }
            // %SYS_STEP.n.RETURNCODE%
            if (stringToDecode.contains("%SYS_STEP.")) {
                String syntaxToReplace = "";
                for (Object testCaseStepExecution : tCExecution.getTestCaseStepExecutionList()) {
                    TestCaseStepExecution tcse = (TestCaseStepExecution) testCaseStepExecution;
                    syntaxToReplace = "%SYS_STEP." + tcse.getSort() + "." + tcse.getIndex() + ".RETURNCODE%";
                    stringToDecode = stringToDecode.replace(syntaxToReplace, tcse.getReturnCode());
                }
            }
            if (stringToDecode.contains("%system.STEP.")) {
                String syntaxToReplace = "";
                for (Object testCaseStepExecution : tCExecution.getTestCaseStepExecutionList()) {
                    TestCaseStepExecution tcse = (TestCaseStepExecution) testCaseStepExecution;
                    syntaxToReplace = "%system.STEP." + tcse.getSort() + "." + tcse.getIndex() + ".RETURNCODE%";
                    stringToDecode = stringToDecode.replace(syntaxToReplace, tcse.getReturnCode());
                }
            }
        }
        /**
         * Last Service Called Variables.
         */
        if (!(tCExecution.getLastServiceCalled() == null)) {
            stringToDecode = stringToDecode.replace("%SYS_LASTSERVICE_HTTPCODE%", String.valueOf(tCExecution.getLastServiceCalled().getResponseHTTPCode()));
        } else {
            stringToDecode = stringToDecode.replace("%SYS_LASTSERVICE_HTTPCODE%", VALUE_WHEN_NULL);
        }
        if (!(tCExecution.getLastServiceCalled() == null)) {
            stringToDecode = stringToDecode.replace("%system.LASTSERVICE_HTTPCODE%", String.valueOf(tCExecution.getLastServiceCalled().getResponseHTTPCode()));
        } else {
            stringToDecode = stringToDecode.replace("%system.LASTSERVICE_HTTPCODE%", VALUE_WHEN_NULL);
        }
        /**
         * Trying to replace date variables .
         */
        stringToDecode = stringToDecode.replace("%SYS_TODAY-yyyy%", DateUtil.getTodayFormat("yyyy"));
        stringToDecode = stringToDecode.replace("%SYS_TODAY-MM%", DateUtil.getTodayFormat("MM"));
        stringToDecode = stringToDecode.replace("%SYS_TODAY-dd%", DateUtil.getTodayFormat("dd"));
        stringToDecode = stringToDecode.replace("%SYS_TODAY-doy%", DateUtil.getTodayFormat("D"));
        stringToDecode = stringToDecode.replace("%SYS_TODAY-HH%", DateUtil.getTodayFormat("HH"));
        stringToDecode = stringToDecode.replace("%SYS_TODAY-mm%", DateUtil.getTodayFormat("mm"));
        stringToDecode = stringToDecode.replace("%SYS_TODAY-ss%", DateUtil.getTodayFormat("ss"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-yyyy%", DateUtil.getYesterdayFormat("yyyy"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-MM%", DateUtil.getYesterdayFormat("MM"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-dd%", DateUtil.getYesterdayFormat("dd"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-doy%", DateUtil.getYesterdayFormat("D"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-HH%", DateUtil.getYesterdayFormat("HH"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-mm%", DateUtil.getYesterdayFormat("mm"));
        stringToDecode = stringToDecode.replace("%SYS_YESTERDAY-ss%", DateUtil.getYesterdayFormat("ss"));
        stringToDecode = stringToDecode.replace("%SYS_TOMORROW-yyyy%", DateUtil.getTomorrowFormat("yyyy"));
        stringToDecode = stringToDecode.replace("%SYS_TOMORROW-MM%", DateUtil.getTomorrowFormat("MM"));
        stringToDecode = stringToDecode.replace("%SYS_TOMORROW-dd%", DateUtil.getTomorrowFormat("dd"));
        stringToDecode = stringToDecode.replace("%SYS_TOMORROW-doy%", DateUtil.getTomorrowFormat("D"));
        // New syntax
        stringToDecode = stringToDecode.replace("%system.TODAY-yyyy%", DateUtil.getTodayFormat("yyyy"));
        stringToDecode = stringToDecode.replace("%system.TODAY-MM%", DateUtil.getTodayFormat("MM"));
        stringToDecode = stringToDecode.replace("%system.TODAY-dd%", DateUtil.getTodayFormat("dd"));
        stringToDecode = stringToDecode.replace("%system.TODAY-doy%", DateUtil.getTodayFormat("D"));
        stringToDecode = stringToDecode.replace("%system.TODAY-HH%", DateUtil.getTodayFormat("HH"));
        stringToDecode = stringToDecode.replace("%system.TODAY-mm%", DateUtil.getTodayFormat("mm"));
        stringToDecode = stringToDecode.replace("%system.TODAY-ss%", DateUtil.getTodayFormat("ss"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-yyyy%", DateUtil.getYesterdayFormat("yyyy"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-MM%", DateUtil.getYesterdayFormat("MM"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-dd%", DateUtil.getYesterdayFormat("dd"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-doy%", DateUtil.getYesterdayFormat("D"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-HH%", DateUtil.getYesterdayFormat("HH"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-mm%", DateUtil.getYesterdayFormat("mm"));
        stringToDecode = stringToDecode.replace("%system.YESTERDAY-ss%", DateUtil.getYesterdayFormat("ss"));
        stringToDecode = stringToDecode.replace("%system.TOMORROW-yyyy%", DateUtil.getTomorrowFormat("yyyy"));
        stringToDecode = stringToDecode.replace("%system.TOMORROW-MM%", DateUtil.getTomorrowFormat("MM"));
        stringToDecode = stringToDecode.replace("%system.TOMORROW-dd%", DateUtil.getTomorrowFormat("dd"));
        stringToDecode = stringToDecode.replace("%system.TOMORROW-doy%", DateUtil.getTomorrowFormat("D"));
        return stringToDecode;
    } catch (Exception e) {
        LOG.error("Error when decoding system variable.", e, e.getStackTrace());
    }
    return stringToDecode;
}
Also used : TestCaseStepExecution(org.cerberus.crud.entity.TestCaseStepExecution) Timestamp(java.sql.Timestamp) Date(java.util.Date) CerberusEventException(org.cerberus.exception.CerberusEventException)

Example 2 with TestCaseStepExecution

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

the class UpdateTestCaseExecution method createTestCaseStepExecution.

// create a TestCaseStepExecution with the parameters
private TestCaseStepExecution createTestCaseStepExecution(long id, String test, String testCase, int step, int index, int sort, String loop, String conditionOper, String conditionVal1Init, String conditionVal2Init, String conditionVal1, String conditionVal2, String batNumExe, long start, long end, long fullStart, long fullEnd, BigDecimal timeElapsed, String returnCode, String returnMessage, String description) {
    TestCaseStepExecution testCaseStepExecution = new TestCaseStepExecution();
    testCaseStepExecution.setBatNumExe(batNumExe);
    testCaseStepExecution.setEnd(end);
    testCaseStepExecution.setFullEnd(fullEnd);
    testCaseStepExecution.setFullStart(fullStart);
    testCaseStepExecution.setId(id);
    testCaseStepExecution.setReturnCode(returnCode);
    testCaseStepExecution.setStart(start);
    testCaseStepExecution.setStep(step);
    testCaseStepExecution.setIndex(index);
    testCaseStepExecution.setSort(sort);
    testCaseStepExecution.setLoop(loop);
    testCaseStepExecution.setConditionOper(conditionOper);
    testCaseStepExecution.setConditionVal1Init(conditionVal1Init);
    testCaseStepExecution.setConditionVal2Init(conditionVal2Init);
    testCaseStepExecution.setConditionVal1(conditionVal1);
    testCaseStepExecution.setConditionVal2(conditionVal2);
    testCaseStepExecution.setTest(test);
    testCaseStepExecution.setTestCase(testCase);
    testCaseStepExecution.setTimeElapsed(timeElapsed);
    testCaseStepExecution.setDescription(description);
    testCaseStepExecution.setReturnMessage(returnMessage);
    return testCaseStepExecution;
}
Also used : TestCaseStepExecution(org.cerberus.crud.entity.TestCaseStepExecution)

Example 3 with TestCaseStepExecution

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

the class FactoryTestCaseStepExecution method create.

@Override
public TestCaseStepExecution create(long id, String test, String testCase, int step, int index, int sort, String loop, String conditionOper, String conditionVal1Init, String conditionVal2Init, String conditionVal1, String conditionVal2, String batNumExe, long start, long end, long fullStart, long fullEnd, BigDecimal timeElapsed, String returnCode, MessageEvent stepResultMessage, TestCaseStep testCaseStep, TestCaseExecution tCExecution, String useStep, String useStepTest, String useStepTestCase, int useStepTestCaseStep, String description) {
    TestCaseStepExecution testCaseStepExecution = new TestCaseStepExecution();
    testCaseStepExecution.setBatNumExe(batNumExe);
    testCaseStepExecution.setEnd(end);
    testCaseStepExecution.setFullEnd(fullEnd);
    testCaseStepExecution.setFullStart(fullStart);
    testCaseStepExecution.setId(id);
    testCaseStepExecution.setReturnCode(returnCode);
    testCaseStepExecution.setStart(start);
    testCaseStepExecution.setStep(step);
    testCaseStepExecution.setIndex(index);
    testCaseStepExecution.setSort(sort);
    testCaseStepExecution.setLoop(loop);
    testCaseStepExecution.setConditionOper(conditionOper);
    testCaseStepExecution.setConditionVal1Init(conditionVal1Init);
    testCaseStepExecution.setConditionVal2Init(conditionVal2Init);
    testCaseStepExecution.setConditionVal1(conditionVal1);
    testCaseStepExecution.setConditionVal2(conditionVal2);
    testCaseStepExecution.setTest(test);
    testCaseStepExecution.setTestCase(testCase);
    testCaseStepExecution.setTimeElapsed(timeElapsed);
    testCaseStepExecution.setStepResultMessage(stepResultMessage);
    testCaseStepExecution.setTestCaseStep(testCaseStep);
    testCaseStepExecution.settCExecution(tCExecution);
    testCaseStepExecution.setUseStep(useStep);
    testCaseStepExecution.setUseStepTest(useStepTest);
    testCaseStepExecution.setUseStepTestCase(useStepTestCase);
    testCaseStepExecution.setUseStepTestCaseStep(useStepTestCaseStep);
    testCaseStepExecution.setDescription(description);
    // List objects
    List<TestCaseExecutionFile> objectFileList = new ArrayList<>();
    testCaseStepExecution.setFileList(objectFileList);
    List<TestCaseStepActionExecution> testCaseStepActionExecution = new ArrayList<>();
    testCaseStepExecution.setTestCaseStepActionExecutionList(testCaseStepActionExecution);
    return testCaseStepExecution;
}
Also used : IFactoryTestCaseStepExecution(org.cerberus.crud.factory.IFactoryTestCaseStepExecution) TestCaseStepExecution(org.cerberus.crud.entity.TestCaseStepExecution) ArrayList(java.util.ArrayList) TestCaseStepActionExecution(org.cerberus.crud.entity.TestCaseStepActionExecution) TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile)

Example 4 with TestCaseStepExecution

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

the class TestCaseStepExecutionService method readByVarious1WithDependency.

@Override
public AnswerList readByVarious1WithDependency(long executionId, String test, String testcase) {
    AnswerList steps = this.readByVarious1(executionId, test, testcase);
    AnswerList response = null;
    List<TestCaseStepExecution> tcseList = new ArrayList();
    for (Object step : steps.getDataList()) {
        TestCaseStepExecution tces = (TestCaseStepExecution) step;
        AnswerList actions = testCaseStepActionExecutionService.readByVarious1WithDependency(executionId, tces.getTest(), tces.getTestCase(), tces.getStep(), tces.getIndex());
        tces.setTestCaseStepActionExecutionList((List<TestCaseStepActionExecution>) actions.getDataList());
        AnswerList files = testCaseExecutionFileService.readByVarious(executionId, tces.getTest() + "-" + tces.getTestCase() + "-" + tces.getStep() + "-" + tces.getIndex());
        tces.setFileList((List<TestCaseExecutionFile>) files.getDataList());
        tcseList.add(tces);
    }
    response = new AnswerList(tcseList, steps.getTotalRows());
    return response;
}
Also used : TestCaseStepExecution(org.cerberus.crud.entity.TestCaseStepExecution) AnswerList(org.cerberus.util.answer.AnswerList) ArrayList(java.util.ArrayList) TestCaseStepActionExecution(org.cerberus.crud.entity.TestCaseStepActionExecution) TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile)

Example 5 with TestCaseStepExecution

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

the class ControlServiceTest method testDoControlStringDifferentWhenFail.

@Test
public void testDoControlStringDifferentWhenFail() {
    String property = "test";
    String value = "test";
    String msg = "'" + value + "' is not different from '" + property + "'.";
    TestCaseStepActionControlExecution tcsace = new TestCaseStepActionControlExecution();
    tcsace.setControl("verifyStringDifferent");
    tcsace.setValue1(property);
    tcsace.setValue2(value);
    tcsace.setFatal("Y");
    TestCaseStepExecution tcse = new TestCaseStepExecution();
    tcse.settCExecution(tCExecution);
    TestCaseStepActionExecution tcsae = new TestCaseStepActionExecution();
    tcsae.setTestCaseStepExecution(tcse);
    tcsace.setTestCaseStepActionExecution(tcsae);
    this.controlService.doControl(tcsace);
    Assert.assertEquals(msg, tcsace.getControlResultMessage().getDescription());
    Assert.assertEquals("KO", tcsace.getReturnCode());
    Assert.assertEquals("Y", tcsace.getFatal());
}
Also used : TestCaseStepExecution(org.cerberus.crud.entity.TestCaseStepExecution) TestCaseStepActionControlExecution(org.cerberus.crud.entity.TestCaseStepActionControlExecution) TestCaseStepActionExecution(org.cerberus.crud.entity.TestCaseStepActionExecution) Test(org.junit.Test)

Aggregations

TestCaseStepExecution (org.cerberus.crud.entity.TestCaseStepExecution)35 TestCaseStepActionExecution (org.cerberus.crud.entity.TestCaseStepActionExecution)28 TestCaseStepActionControlExecution (org.cerberus.crud.entity.TestCaseStepActionControlExecution)26 Test (org.junit.Test)26 IFactoryTestCaseStepExecution (org.cerberus.crud.factory.IFactoryTestCaseStepExecution)5 ArrayList (java.util.ArrayList)4 AnswerList (org.cerberus.util.answer.AnswerList)3 BigDecimal (java.math.BigDecimal)2 Connection (java.sql.Connection)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)2 Timestamp (java.sql.Timestamp)2 Date (java.util.Date)2 TestCaseExecutionFile (org.cerberus.crud.entity.TestCaseExecutionFile)2 MessageEvent (org.cerberus.engine.entity.MessageEvent)2 CerberusEventException (org.cerberus.exception.CerberusEventException)2 Ignore (org.junit.Ignore)2 CountryEnvLink (org.cerberus.crud.entity.CountryEnvLink)1 CountryEnvParam (org.cerberus.crud.entity.CountryEnvParam)1