Search in sources :

Example 1 with PipelineVO

use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.

the class ObjectCreatorUtils method constructPipelineVO.

public static PipelineVO constructPipelineVO(String name, String repo, Long parentFolderId) {
    PipelineVO pipeline = new PipelineVO();
    pipeline.setName(name);
    pipeline.setRepository(repo);
    pipeline.setParentFolderId(parentFolderId);
    return pipeline;
}
Also used : PipelineVO(com.epam.pipeline.controller.vo.PipelineVO)

Example 2 with PipelineVO

use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.

the class FolderManagerTest method deleteFolderWithPipeline.

@Test(expected = IllegalArgumentException.class)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void deleteFolderWithPipeline() throws Exception {
    folderManager.create(folder);
    PipelineVO pipeline = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
    pipelineManager.create(pipeline);
    folderManager.delete(folder.getId());
}
Also used : ObjectCreatorUtils.constructPipelineVO(com.epam.pipeline.manager.ObjectCreatorUtils.constructPipelineVO) PipelineVO(com.epam.pipeline.controller.vo.PipelineVO) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with PipelineVO

use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.

the class FolderManagerTest method loadFolderWithPipelineAndStorage.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void loadFolderWithPipelineAndStorage() throws Exception {
    folderManager.create(folder);
    PipelineVO pipelineVO = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
    DataStorageVO storageVO = constructDataStorageVO(TEST_NAME, TEST_DESCRIPTION, DataStorageType.S3, TEST_PATH, STS_DURATION, LTS_DURATION, folder.getId(), TEST_MOUNT_POINT, TEST_MOUNT_OPTIONS);
    Pipeline pipeline = pipelineManager.create(pipelineVO);
    AbstractDataStorage storage = dataStorageManager.create(storageVO, false, false, false);
    Folder loaded = folderManager.load(folder.getId());
    Pipeline loadedPipe = loaded.getPipelines().get(0);
    assertNotNull(loadedPipe);
    assertEquals(pipeline.getId(), loadedPipe.getId());
    assertEquals(pipeline.getName(), loadedPipe.getName());
    assertEquals(pipeline.getParentFolderId(), loadedPipe.getParentFolderId());
    AbstractDataStorage loadedStorage = loaded.getStorages().get(0);
    assertNotNull(loadedStorage);
    assertEquals(storage.getId(), loadedStorage.getId());
    assertEquals(storage.getName(), loadedStorage.getName());
    assertEquals(storage.getParentFolderId(), loadedStorage.getParentFolderId());
}
Also used : AbstractDataStorage(com.epam.pipeline.entity.datastorage.AbstractDataStorage) DataStorageVO(com.epam.pipeline.controller.vo.DataStorageVO) ObjectCreatorUtils.constructDataStorageVO(com.epam.pipeline.manager.ObjectCreatorUtils.constructDataStorageVO) Folder(com.epam.pipeline.entity.pipeline.Folder) ObjectCreatorUtils.constructPipelineVO(com.epam.pipeline.manager.ObjectCreatorUtils.constructPipelineVO) PipelineVO(com.epam.pipeline.controller.vo.PipelineVO) Pipeline(com.epam.pipeline.entity.pipeline.Pipeline) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 4 with PipelineVO

use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.

the class FolderManagerTest method deleteFolderAfterMovingPipelineAndStorage.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void deleteFolderAfterMovingPipelineAndStorage() throws Exception {
    folderManager.create(folder);
    PipelineVO pipelineVO = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
    DataStorageVO storageVO = constructDataStorageVO(TEST_NAME, TEST_DESCRIPTION, DataStorageType.S3, TEST_PATH, STS_DURATION, LTS_DURATION, folder.getId(), TEST_MOUNT_POINT, TEST_MOUNT_OPTIONS);
    Pipeline pipeline = pipelineManager.create(pipelineVO);
    AbstractDataStorage storage = dataStorageManager.create(storageVO, false, false, false);
    pipelineVO.setId(pipeline.getId());
    pipelineVO.setParentFolderId(null);
    pipelineManager.update(pipelineVO);
    storageVO.setParentFolderId(null);
    storageVO.setId(storage.getId());
    dataStorageManager.update(storageVO);
    folderManager.delete(folder.getId());
}
Also used : AbstractDataStorage(com.epam.pipeline.entity.datastorage.AbstractDataStorage) DataStorageVO(com.epam.pipeline.controller.vo.DataStorageVO) ObjectCreatorUtils.constructDataStorageVO(com.epam.pipeline.manager.ObjectCreatorUtils.constructDataStorageVO) ObjectCreatorUtils.constructPipelineVO(com.epam.pipeline.manager.ObjectCreatorUtils.constructPipelineVO) PipelineVO(com.epam.pipeline.controller.vo.PipelineVO) Pipeline(com.epam.pipeline.entity.pipeline.Pipeline) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with PipelineVO

use of com.epam.pipeline.controller.vo.PipelineVO in project cloud-pipeline by epam.

the class FolderManagerTest method deleteFolderWithChildrenForce.

@Test
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void deleteFolderWithChildrenForce() throws Exception {
    folderManager.create(subFolder);
    folder.setParent(subFolder);
    folderManager.create(folder);
    PipelineVO pipeline1 = constructPipelineVO(TEST_NAME, TEST_REPO, folder.getId());
    pipelineManager.create(pipeline1);
    generateDataStorage(folder.getId());
    PipelineVO pipeline2 = constructPipelineVO(TEST_NAME, TEST_REPO, subFolder.getId());
    pipelineManager.create(pipeline2);
    generateDataStorage(subFolder.getId());
    folderManager.deleteForce(folder.getId());
}
Also used : ObjectCreatorUtils.constructPipelineVO(com.epam.pipeline.manager.ObjectCreatorUtils.constructPipelineVO) PipelineVO(com.epam.pipeline.controller.vo.PipelineVO) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

PipelineVO (com.epam.pipeline.controller.vo.PipelineVO)5 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)4 ObjectCreatorUtils.constructPipelineVO (com.epam.pipeline.manager.ObjectCreatorUtils.constructPipelineVO)4 Test (org.junit.Test)4 Transactional (org.springframework.transaction.annotation.Transactional)4 DataStorageVO (com.epam.pipeline.controller.vo.DataStorageVO)2 AbstractDataStorage (com.epam.pipeline.entity.datastorage.AbstractDataStorage)2 Pipeline (com.epam.pipeline.entity.pipeline.Pipeline)2 ObjectCreatorUtils.constructDataStorageVO (com.epam.pipeline.manager.ObjectCreatorUtils.constructDataStorageVO)2 Folder (com.epam.pipeline.entity.pipeline.Folder)1