summaryrefslogtreecommitdiffstats
path: root/vespa-testrunner-components/src/test/java/com/yahoo/vespa/hosted/testrunner/PomXmlGeneratorTest.java
blob: 391e2a0abbf3b0e7f2a9bf548740b2c70856e0d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.testrunner;

import com.yahoo.vespa.testrunner.legacy.TestProfile;
import org.junit.Test;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;

/**
 * @author valerijf
 */
public class PomXmlGeneratorTest {

    @Test
    public void write_system_tests_pom_xml() throws IOException {
        List<Path> artifacts = Arrays.asList(
                Paths.get("components/my-comp.jar"),
                Paths.get("main.jar"));

        String actual = PomXmlGenerator.generatePomXml(TestProfile.SYSTEM_TEST, artifacts, artifacts.get(1));
        assertFile("/pom.xml_system_tests", actual);
    }

    private void assertFile(String resourceFile, String actual) throws IOException {
        String expected = new String(this.getClass().getResourceAsStream(resourceFile).readAllBytes());
        assertEquals(resourceFile, expected, actual);
    }

}