Search in sources :

Example 1 with BinaryContent

use of com.epam.ta.reportportal.database.entity.BinaryContent in project commons-dao by reportportal.

the class LogRepositoryTest method addLogWithBinaryData.

@Before
public void addLogWithBinaryData() {
    Map<String, String> metaInfo = new HashMap<>();
    metaInfo.put("project", "EPMRPP");
    BinaryData binaryData = new BinaryData(CONTENT_TYPE, 64807L, this.getClass().getClassLoader().getResourceAsStream("meh.jpg"));
    filename = dataStorage.saveData(binaryData, "filename", metaInfo);
    thumbnail = dataStorage.saveData(binaryData, "thumbnail", metaInfo);
    BinaryContent binaryContent = new BinaryContent(filename, thumbnail, CONTENT_TYPE);
    Log log = new Log();
    log.setBinaryContent(binaryContent);
    saved = logRepository.save(log);
}
Also used : HashMap(java.util.HashMap) Log(com.epam.ta.reportportal.database.entity.Log) BinaryData(com.epam.ta.reportportal.database.BinaryData) BinaryContent(com.epam.ta.reportportal.database.entity.BinaryContent) Before(org.junit.Before)

Example 2 with BinaryContent

use of com.epam.ta.reportportal.database.entity.BinaryContent in project commons-dao by reportportal.

the class LogRepositoryTest method logs.

public List<Log> logs() {
    Log log1 = new Log();
    log1.setTestItemRef("item1");
    log1.setBinaryContent(new BinaryContent("binary1", "thumbnail1", "contentType1"));
    Log log2 = new Log();
    log2.setTestItemRef("item1");
    log2.setBinaryContent(new BinaryContent("binary2", "thumbnail2", "contentType2"));
    Log log3 = new Log();
    log3.setTestItemRef("item2");
    log3.setBinaryContent(new BinaryContent("binary3", "thumbnail3", "contentType3"));
    return asList(log1, log2, log3);
}
Also used : Log(com.epam.ta.reportportal.database.entity.Log) BinaryContent(com.epam.ta.reportportal.database.entity.BinaryContent)

Aggregations

BinaryContent (com.epam.ta.reportportal.database.entity.BinaryContent)2 Log (com.epam.ta.reportportal.database.entity.Log)2 BinaryData (com.epam.ta.reportportal.database.BinaryData)1 HashMap (java.util.HashMap)1 Before (org.junit.Before)1