Search in sources :

Example 6 with TestCaseExecutionFile

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

the class FactoryTestCaseExecutionFile method create.

@Override
public TestCaseExecutionFile create(long id, long exeId, String level, String fileDesc, String fileName, String fileType, String usrCreated, Timestamp dateCreated, String usrModif, Timestamp dateModif) {
    TestCaseExecutionFile newObject = new TestCaseExecutionFile();
    newObject.setId(id);
    newObject.setExeId(exeId);
    newObject.setLevel(level);
    newObject.setFileDesc(fileDesc);
    newObject.setFileName(fileName);
    newObject.setFileType(fileType);
    newObject.setUsrCreated(usrCreated);
    newObject.setDateCreated(dateCreated);
    newObject.setUsrModif(usrModif);
    newObject.setDateModif(dateModif);
    return newObject;
}
Also used : TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile) IFactoryTestCaseExecutionFile(org.cerberus.crud.factory.IFactoryTestCaseExecutionFile)

Example 7 with TestCaseExecutionFile

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

the class TestCaseExecutionFileService method save.

@Override
public Answer save(long exeId, String level, String fileDesc, String fileName, String fileType, String usrCreated) {
    TestCaseExecutionFile object = null;
    object = testCaseExecutionFileFactory.create(0, exeId, level, fileDesc, fileName, fileType, usrCreated, null, "", null);
    return this.save(object);
}
Also used : TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile) IFactoryTestCaseExecutionFile(org.cerberus.crud.factory.IFactoryTestCaseExecutionFile)

Example 8 with TestCaseExecutionFile

use of org.cerberus.crud.entity.TestCaseExecutionFile 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 9 with TestCaseExecutionFile

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

the class TestCaseExecutionDataService method readByIdWithDependency.

@Override
public AnswerList<TestCaseExecutionData> readByIdWithDependency(long id) {
    AnswerList data = this.readByIdByCriteria(id, 0, 0, "exd.property", "asc", null, null);
    AnswerList response = null;
    List<TestCaseExecutionData> tcsaceList = new ArrayList();
    for (Object mydata : data.getDataList()) {
        TestCaseExecutionData tcsace = (TestCaseExecutionData) mydata;
        AnswerList files = testCaseExecutionFileService.readByVarious(id, tcsace.getProperty() + "-" + tcsace.getIndex());
        tcsace.setFileList((List<TestCaseExecutionFile>) files.getDataList());
        tcsaceList.add(tcsace);
    }
    response = new AnswerList(tcsaceList, data.getTotalRows());
    return response;
}
Also used : AnswerList(org.cerberus.util.answer.AnswerList) TestCaseExecutionData(org.cerberus.crud.entity.TestCaseExecutionData) ArrayList(java.util.ArrayList) TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile)

Example 10 with TestCaseExecutionFile

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

the class TestCaseExecutionService method readByKeyWithDependency.

@Override
public AnswerItem readByKeyWithDependency(long executionId) {
    AnswerItem tce = this.readByKey(executionId);
    TestCaseExecution testCaseExecution = (TestCaseExecution) tce.getItem();
    AnswerItem<TestCase> ai = testCaseService.readByKeyWithDependency(testCaseExecution.getTest(), testCaseExecution.getTestCase());
    testCaseExecution.setTestCaseObj(ai.getItem());
    AnswerList a = testCaseExecutionDataService.readByIdWithDependency(executionId);
    for (Object object : a.getDataList()) {
        TestCaseExecutionData tced = (TestCaseExecutionData) object;
        if (tced.getIndex() == 1) {
            testCaseExecution.getTestCaseExecutionDataMap().put(tced.getProperty(), tced);
        }
    }
    // We frist add the 'Pres Testing' testcase execution steps.
    AnswerList preTestCaseSteps = testCaseStepExecutionService.readByVarious1WithDependency(executionId, "Pre Testing", null);
    testCaseExecution.setTestCaseStepExecutionList(preTestCaseSteps.getDataList());
    // Then we add the steps from the main testcase.
    AnswerList steps = testCaseStepExecutionService.readByVarious1WithDependency(executionId, testCaseExecution.getTest(), testCaseExecution.getTestCase());
    testCaseExecution.addTestCaseStepExecutionList(steps.getDataList());
    AnswerList files = testCaseExecutionFileService.readByVarious(executionId, "");
    testCaseExecution.setFileList((List<TestCaseExecutionFile>) files.getDataList());
    AnswerItem response = new AnswerItem(testCaseExecution, tce.getResultMessage());
    return response;
}
Also used : TestCaseExecution(org.cerberus.crud.entity.TestCaseExecution) AnswerList(org.cerberus.util.answer.AnswerList) TestCase(org.cerberus.crud.entity.TestCase) TestCaseExecutionData(org.cerberus.crud.entity.TestCaseExecutionData) TestCaseExecutionFile(org.cerberus.crud.entity.TestCaseExecutionFile) AnswerItem(org.cerberus.util.answer.AnswerItem)

Aggregations

TestCaseExecutionFile (org.cerberus.crud.entity.TestCaseExecutionFile)28 IFactoryTestCaseExecutionFile (org.cerberus.crud.factory.IFactoryTestCaseExecutionFile)15 ArrayList (java.util.ArrayList)13 MessageEvent (org.cerberus.engine.entity.MessageEvent)8 AnswerList (org.cerberus.util.answer.AnswerList)7 Recorder (org.cerberus.engine.entity.Recorder)6 CerberusException (org.cerberus.exception.CerberusException)6 IOException (java.io.IOException)5 AnswerItem (org.cerberus.util.answer.AnswerItem)5 File (java.io.File)4 FileNotFoundException (java.io.FileNotFoundException)4 TestCaseExecutionData (org.cerberus.crud.entity.TestCaseExecutionData)4 TestCaseStepActionControlExecution (org.cerberus.crud.entity.TestCaseStepActionControlExecution)4 TestCaseStepActionExecution (org.cerberus.crud.entity.TestCaseStepActionExecution)4 Connection (java.sql.Connection)3 PreparedStatement (java.sql.PreparedStatement)3 ResultSet (java.sql.ResultSet)3 SQLException (java.sql.SQLException)3 TestCaseExecution (org.cerberus.crud.entity.TestCaseExecution)3 FactoryTestCaseExecutionFile (org.cerberus.crud.factory.impl.FactoryTestCaseExecutionFile)3