Search in sources :

Example 1 with NullLog

use of org.jfrog.build.api.util.NullLog in project build-info by JFrogDev.

the class SpecsHelperTest method testGetUploadDownloadSpecFromStringPositiveCases.

/**
 * Tests positive scenarios of parsing a String to FileSpec object.
 */
@Test(dataProvider = "fileSpecWithValues")
public void testGetUploadDownloadSpecFromStringPositiveCases(String specFileName, String aql, String pattern, String target, String props, String recursive, String flat, String regexp, String build) throws IOException {
    SpecsHelper specsHelper = new SpecsHelper(new NullLog());
    String specString = FileUtils.readFileToString(getFileFromResources("positiveTestSpecs/" + specFileName));
    FileSpec spec = specsHelper.getDownloadUploadSpec(specString, new UploadSpecValidator()).getFiles()[0];
    assertSpecParams(aql, pattern, target, props, recursive, flat, regexp, build, spec);
}
Also used : UploadSpecValidator(org.jfrog.build.extractor.clientConfiguration.util.spec.validator.UploadSpecValidator) NullLog(org.jfrog.build.api.util.NullLog) Test(org.testng.annotations.Test)

Example 2 with NullLog

use of org.jfrog.build.api.util.NullLog in project build-info by JFrogDev.

the class SpecsHelperTest method testGetUploadDownloadSpecFromFilePositiveCases.

/**
 * Tests positive scenarios of parsing a File to FileSpec object.
 */
@Test(dataProvider = "fileSpecWithValues")
public void testGetUploadDownloadSpecFromFilePositiveCases(String specFileName, String aql, String pattern, String target, String props, String recursive, String flat, String regexp, String build) throws IOException {
    SpecsHelper specsHelper = new SpecsHelper(new NullLog());
    File fileSpec = getFileFromResources("positiveTestSpecs/" + specFileName);
    FileSpec spec = specsHelper.getDownloadUploadSpec(fileSpec, new UploadSpecValidator()).getFiles()[0];
    assertSpecParams(aql, pattern, target, props, recursive, flat, regexp, build, spec);
}
Also used : UploadSpecValidator(org.jfrog.build.extractor.clientConfiguration.util.spec.validator.UploadSpecValidator) NullLog(org.jfrog.build.api.util.NullLog) File(java.io.File) Test(org.testng.annotations.Test)

Example 3 with NullLog

use of org.jfrog.build.api.util.NullLog in project build-info by JFrogDev.

the class SpecsHelperTest method testGetUploadDownloadSpecFromStringNegativeCases.

/**
 * Tests negative scenarios of parsing a String to FileSpec object.
 */
@Test(dataProvider = "corruptedStringSpecs", expectedExceptions = { JsonMappingException.class, IllegalArgumentException.class })
public void testGetUploadDownloadSpecFromStringNegativeCases(String spec) throws IOException {
    SpecsHelper specsHelper = new SpecsHelper(new NullLog());
    specsHelper.getDownloadUploadSpec(spec, new UploadSpecValidator());
}
Also used : UploadSpecValidator(org.jfrog.build.extractor.clientConfiguration.util.spec.validator.UploadSpecValidator) NullLog(org.jfrog.build.api.util.NullLog) Test(org.testng.annotations.Test)

Example 4 with NullLog

use of org.jfrog.build.api.util.NullLog in project build-info by JFrogDev.

the class SpecsHelperTest method testGetUploadDownloadSpecFromFileNegativeCases.

/**
 * Tests negative scenarios of parsing a File to FileSpec object.
 */
@Test(dataProvider = "corruptedFileSpecs", expectedExceptions = { JsonMappingException.class, IllegalArgumentException.class })
public void testGetUploadDownloadSpecFromFileNegativeCases(String specFileName) throws IOException {
    SpecsHelper specsHelper = new SpecsHelper(new NullLog());
    File fileSpec = getFileFromResources("negativeTestSpecs/" + specFileName);
    specsHelper.getDownloadUploadSpec(fileSpec, new UploadSpecValidator());
}
Also used : UploadSpecValidator(org.jfrog.build.extractor.clientConfiguration.util.spec.validator.UploadSpecValidator) NullLog(org.jfrog.build.api.util.NullLog) File(java.io.File) Test(org.testng.annotations.Test)

Aggregations

NullLog (org.jfrog.build.api.util.NullLog)4 UploadSpecValidator (org.jfrog.build.extractor.clientConfiguration.util.spec.validator.UploadSpecValidator)4 Test (org.testng.annotations.Test)4 File (java.io.File)2