use of io.elastest.etm.model.Project in project elastest-torm by elastest.
the class ModelsTest method executionTest.
@Test
public void executionTest() {
Project project = new Project(3l, "name", new ArrayList<TJob>(), new ArrayList<SutSpecification>());
SutSpecification sut = new SutSpecification(34l, "name", "specification", "description", project, new ArrayList<>(), SutTypeEnum.REPOSITORY, false, null, InstrumentedByEnum.WITHOUT, null, ManagedDockerType.IMAGE, CommandsOptionEnum.DEFAULT);
TJob tjob = new TJob(34l, "name", "imageName", sut, project, false, "execDashboardConfig", null);
List<Parameter> params = new ArrayList<>();
params.add(new Parameter(45l, "param1", "value1", tjob, null));
tjob.setParameters(params);
TJobExecution exec = new TJobExecution(45l, 34543534l, ResultEnum.SUCCESS);
List<Parameter> paramsExec = new ArrayList<>();
paramsExec.add(new Parameter(45l, "param1", "value1", tjob, exec));
exec.setParameters(paramsExec);
TJobExecution exec2 = new TJobExecution(45l, 34543534l, ResultEnum.SUCCESS);
List<Parameter> paramsExec2 = new ArrayList<>();
paramsExec2.add(new Parameter(45l, "param1", "value1", tjob, exec2));
exec2.setParameters(paramsExec2);
exec.setTjob(tjob);
exec2.setTjob(tjob);
SutExecution sutExec = new SutExecution(45l, sut, "ssss", DeployStatusEnum.DEPLOYED);
SutExecution sutExec2 = new SutExecution(45l, sut, "ssss", DeployStatusEnum.DEPLOYED);
exec.setSutExecution(sutExec);
exec2.setSutExecution(sutExec2);
assertEquals(exec, exec2);
assertEquals(exec.hashCode(), exec2.hashCode());
}
use of io.elastest.etm.model.Project in project elastest-torm by elastest.
the class ProjectService method deleteProject.
public void deleteProject(Long projectId) {
Project project = projectRepository.findOne(projectId);
projectRepository.delete(project);
}
use of io.elastest.etm.model.Project in project elastest-torm by elastest.
the class HelloWorldLoader method createHelloWorldProject.
@PostConstruct
public void createHelloWorldProject() {
if (projectService.getProjectByName(PROJECT_NAME) == null) {
// Create Hello World Project
Project project = new Project();
project.setName(PROJECT_NAME);
project = projectService.createProject(project);
// Create Hello World TJob associated with the Hellow project
TJob tJob = new TJob();
tJob.setProject(project);
tJob.setName(TJOB_NAME);
tJob.setResultsPath(TEST_RESULTS_PATH);
tJob.setImageName(BASE_IMAGE);
tJob.setCommands(TJOB_COMMANDS);
tJob.setExecDashboardConfigPath(EXEC_DASHBOARD_CONFIG);
tJobService.createTJob(tJob);
}
}
use of io.elastest.etm.model.Project in project elastest-torm by elastest.
the class ModelsTest method tTobTest.
@Test
public void tTobTest() {
Project project = new Project(3l, "name", new ArrayList<TJob>(), new ArrayList<SutSpecification>());
Project project2 = new Project(3l, "name", new ArrayList<TJob>(), new ArrayList<SutSpecification>());
SutSpecification sut = new SutSpecification(34l, "name", "specification", "description", project, new ArrayList<>(), SutTypeEnum.REPOSITORY, false, null, InstrumentedByEnum.WITHOUT, null, ManagedDockerType.IMAGE, CommandsOptionEnum.DEFAULT);
SutSpecification sut2 = new SutSpecification(34l, "name", "specification", "description", project2, new ArrayList<>(), SutTypeEnum.REPOSITORY, false, null, InstrumentedByEnum.WITHOUT, null, ManagedDockerType.IMAGE, CommandsOptionEnum.DEFAULT);
TJob tjob = new TJob(34l, "name", "imageName", sut, project, false, "execDashboardConfig", null);
TJob tjob2 = new TJob(34l, "name", "imageName", sut2, project2, false, "execDashboardConfig", null);
assertEquals(tjob, tjob2);
assertEquals(tjob.hashCode(), tjob2.hashCode());
}
use of io.elastest.etm.model.Project in project elastest-torm by elastest.
the class ElastestConfigTest method tJob.
@Bean
TJob tJob() {
TJob tJob = new TJob();
tJob.setId(0L);
tJob.setImageName("elastest/test-etm-test1");
tJob.setName("SimpleTest");
tJob.setResultsPath("/app1TestJobsJenkins/target/surefire-reports/");
Project project = new Project();
project.setId(1L);
project.setName("TestProject1");
tJob.setProject(project);
return tJob;
}
Aggregations