Package org.easetech.easytest.io

Examples of org.easetech.easytest.io.ResourceLoader


        }
    }

    private static Properties getProperties(TestProperties resource, Class<?> configClass) {
        java.util.Properties properties = new java.util.Properties();
        ResourceLoader resourceLoader = new ResourceLoaderStrategy(configClass);
        for (String resourcePath : resource.value()) {
            Resource fileResource = resourceLoader.getResource(resourcePath);
            if (fileResource.exists()) {

                try {
                    properties.load(fileResource.getInputStream());
                } catch (IOException e) {
View Full Code Here


   
    private void writeData() {
        for (TestInfo testInfo : testInfoList) {
            if (testInfo.getFilePaths() != null && testInfo.getDataLoader() != null && testInfo.getWriteData()) {
                try {
                    ResourceLoader resourceLoader = new ResourceLoaderStrategy(testInfo.getTestClass().getJavaClass());
                    for(String filePath : testInfo.getFilePaths()){
                        testInfo.getDataLoader().writeData(resourceLoader.getResource(filePath), writableData, testInfo.getMethodName());
                    }
                } catch (Exception e) {
                    throw new ParameterizedAssertionError(e, testInfo.getMethodName(), testInfo);
                }
            }
View Full Code Here

                    // We also maintain the copy of the actual data for our write functionality.
                    fillWritableData(writableData , data , testData.appendData());
                    DataContext.setData(DataConverter.appendClassName(data, currentTestClass.getJavaClass()), testData.appendData());
                    DataContext.setConvertedData(DataConverter.convert(data, currentTestClass.getJavaClass()) , testData.appendData());
                } else {
                    ResourceLoader resourceLoader = new ResourceLoaderStrategy(currentTestClass.getJavaClass());
                    for (String filePath : testInfo.getFilePaths()) {
                        Resource resource = resourceLoader.getResource(filePath);
                        try {
                            if (resource.exists()) {
                                Map<String, List<Map<String, Object>>> data = dataLoader.loadData(resource);
                                // We also maintain the copy of the actual data for our write functionality.
                                fillWritableData(writableData , data , testData.appendData());
View Full Code Here

TOP

Related Classes of org.easetech.easytest.io.ResourceLoader

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.