Search in sources :

Example 1 with ProcessId

use of com.synopsys.integration.blackduck.dockerinspector.ProcessId in project blackduck-docker-inspector by blackducksoftware.

the class ContainerPathsTest method doTest.

private void doTest(String sharedDirPathLocal, String sharedDirPathContainer, String targetFilePathLocal) throws IOException {
    Config config = Mockito.mock(Config.class);
    Mockito.when(config.getSharedDirPathLocal()).thenReturn(sharedDirPathLocal);
    Mockito.when(config.getSharedDirPathImageInspector()).thenReturn(sharedDirPathContainer);
    Mockito.when(config.getWorkingDirPath()).thenReturn(sharedDirPathLocal);
    ProcessId processId = Mockito.mock(ProcessId.class);
    Mockito.when(processId.addProcessIdToName("run")).thenReturn("run_1");
    ProgramPaths programPaths = new ProgramPaths(config, processId);
    ContainerPaths containerPaths = new ContainerPaths(config, programPaths);
    String containerPathToTargetFile = containerPaths.getContainerPathToTargetFile(targetFilePathLocal);
    assertEquals(CONTAINER_PATH_TO_TARGET_FILE, containerPathToTargetFile);
    String containerPathToOutputFile = containerPaths.getContainerPathToOutputFile("test_out.tar");
    assertEquals(CONTAINER_PATH_TO_OUTPUT_FILE, containerPathToOutputFile);
}
Also used : Config(com.synopsys.integration.blackduck.dockerinspector.config.Config) ProgramPaths(com.synopsys.integration.blackduck.dockerinspector.config.ProgramPaths) ProcessId(com.synopsys.integration.blackduck.dockerinspector.ProcessId)

Example 2 with ProcessId

use of com.synopsys.integration.blackduck.dockerinspector.ProcessId in project blackduck-docker-inspector by blackducksoftware.

the class SquashedImageTest method setUp.

@BeforeAll
static void setUp() throws IOException {
    Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
    rootLogger.setLevel(Level.INFO);
    Logger integrationLogger = (Logger) LoggerFactory.getLogger("com.synopsys.integration");
    integrationLogger.setLevel(Level.DEBUG);
    testWorkingDir = new File("test/output/squashingTest");
    ImageTarFilename imageTarFilename = new ImageTarFilename();
    FileOperations fileOperations = new FileOperations();
    Config config = Mockito.mock(Config.class);
    Mockito.when(config.getWorkingDirPath()).thenReturn(testWorkingDir.getCanonicalPath());
    ProgramPaths programPaths = new ProgramPaths(config, new ProcessId());
    dockerClientManager = new DockerClientManager(fileOperations, new ImageNameResolver(), config, imageTarFilename, programPaths);
    squashedImage = new SquashedImage();
    squashedImage.setDockerClientManager(dockerClientManager);
    squashedImage.setFileOperations(new FileOperations());
}
Also used : Config(com.synopsys.integration.blackduck.dockerinspector.config.Config) DockerClientManager(com.synopsys.integration.blackduck.dockerinspector.dockerclient.DockerClientManager) ImageNameResolver(com.synopsys.integration.blackduck.imageinspector.api.name.ImageNameResolver) FileOperations(com.synopsys.integration.blackduck.imageinspector.linux.FileOperations) ProgramPaths(com.synopsys.integration.blackduck.dockerinspector.config.ProgramPaths) ProcessId(com.synopsys.integration.blackduck.dockerinspector.ProcessId) Logger(ch.qos.logback.classic.Logger) File(java.io.File) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

ProcessId (com.synopsys.integration.blackduck.dockerinspector.ProcessId)2 Config (com.synopsys.integration.blackduck.dockerinspector.config.Config)2 ProgramPaths (com.synopsys.integration.blackduck.dockerinspector.config.ProgramPaths)2 Logger (ch.qos.logback.classic.Logger)1 DockerClientManager (com.synopsys.integration.blackduck.dockerinspector.dockerclient.DockerClientManager)1 ImageNameResolver (com.synopsys.integration.blackduck.imageinspector.api.name.ImageNameResolver)1 FileOperations (com.synopsys.integration.blackduck.imageinspector.linux.FileOperations)1 File (java.io.File)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1