Package ru.yandex.qatools.allure.data

Examples of ru.yandex.qatools.allure.data.ReportGenerationException


                    getXslTransformations()
            );

            return serialize(outputDirectory, body);
        } catch (Exception e) {
            throw new ReportGenerationException(e);
        } finally {
            deleteFile(body);
        }
    }
View Full Code Here


        for (File attach : listAttachmentFiles(inputDirectories)) {
            try {
                copyAttachment(attach, new File(outputDirectory, attach.getName()));
                size += attach.length();
            } catch (IOException e) {
                throw new ReportGenerationException(e);
            }
        }
        return size;
    }
View Full Code Here

     * @param directory given directory to check
     * @throws ReportGenerationException if can't create specified directory
     */
    public static void checkDirectory(File directory) {
        if (!(directory.exists() || directory.mkdirs())) {
            throw new ReportGenerationException(
                    String.format("Can't create data directory <%s>", directory.getAbsolutePath())
            );
        }
    }
View Full Code Here

            OutputStreamWriter writer = new OutputStreamWriter(data, StandardCharsets.UTF_8);
            mapper.writerWithDefaultPrettyPrinter().writeValue(writer, obj);
            return data.size();
        } catch (IOException e) {
            throw new ReportGenerationException(e);
        }
    }
View Full Code Here

        for (String xslResourceName : xslTransformations) {
            File tmp = null;
            try (InputStream inputStream = new FileInputStream(result)) {
                tmp = applyTransformation(inputStream, xslResourceName);
            } catch (IOException e) {
                throw new ReportGenerationException(e);
            } finally {
                if (xml != result) {
                    deleteFile(result);
                }
                result = tmp;
View Full Code Here

            try (Writer resultWriter = new FileWriter(result)) {
                applyTransformation(xml, xslResourceName, resultWriter);
                return result;
            }
        } catch (IOException e) {
            throw new ReportGenerationException(e);
        }
    }
View Full Code Here

    }

    public static void applyTransformation(InputStream xml, String xslResourceName, Writer resultWriter) {
        URL url = XslTransformationUtils.class.getClassLoader().getResource(xslResourceName);
        if (url == null) {
            throw new ReportGenerationException("Can't find resource " + xslResourceName);
        }

        try (InputStream inputStream = url.openStream()) {
            applyTransformation(new StreamSource(xml), new StreamSource(inputStream, url.toString()), resultWriter);
        } catch (IOException e) {
            throw new ReportGenerationException(e);
        }
    }
View Full Code Here

        try {
            transformer = (Controller) new TransformerFactoryImpl().newTransformer(xsl);
            Result result = new StreamResult(resultWriter);
            transformer.transform(xml, result);
        } catch (TransformerException e) {
            throw new ReportGenerationException(e);
        } finally {
            if (transformer != null) {
                transformer.reset();
                transformer.clearParameters();
                transformer.clearDocumentPool();
View Full Code Here

                });
            }
            service.shutdown();
            service.awaitTermination(1, TimeUnit.HOURS);
        } catch (Exception e) {
            throw new ReportGenerationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of ru.yandex.qatools.allure.data.ReportGenerationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.