Package com.consol.citrus.admin.exception

Examples of com.consol.citrus.admin.exception.CitrusAdminRuntimeException


        for (EndpointConverter converter : endpointConverter) {
            if (converter.getEndpointType().equals(type)) {
                try {
                    return converter.convert(converter.getModelClass().newInstance());
                } catch (InstantiationException e) {
                    throw new CitrusAdminRuntimeException("Failed to create new endpoint model instance", e);
                } catch (IllegalAccessException e) {
                    throw new CitrusAdminRuntimeException("Failed to create new endpoint model instance", e);
                }
            }
        }

        throw new CitrusAdminRuntimeException("Unable to find endpoint definition for type '" + type + "'");
    }
View Full Code Here


                library = functionLibrarySpringBeanConverter.convert(springBean);
            }
        }

        if (library == null) {
            throw new CitrusAdminRuntimeException(String.format("Unable to find function library definition for id '%s'", id));
        }

        return library;
    }
View Full Code Here

        if (type.equals(TestCaseType.XML)) {
            testModel = getXmlTestModel(project, packageName, testName);
        } else if (type.equals(TestCaseType.JAVA)) {
            testModel = getJavaTestModel(packageName, testName);
        } else {
            throw new CitrusAdminRuntimeException("Unsupported test case type: " + type);
        }

        if (testModel.getVariables() != null) {
            for (Variables.Variable variable : testModel.getVariables().getVariables()) {
                testCase.getVariables().put(variable.getName(), variable.getValue());
View Full Code Here

                    model.setName(StringUtils.hasText(methodName) ? methodName : testClassName);
                    return model;
                }
            }
        } catch (ClassNotFoundException e) {
            throw new CitrusAdminRuntimeException("Failed to load Java source as it is not part of classpath: " + packageName + "." + testClassName, e);
        } catch (Exception e) {
            throw new CitrusAdminRuntimeException("Failed to load Java source " + packageName + "." + testClassName, e);
        }

        Testcase testModel = new Testcase();
        testModel.setName(StringUtils.hasText(methodName) ? methodName : testClassName);
        return testModel;
View Full Code Here

     */
    private Testcase getXmlTestModel(Project project, String packageName, String testName) {
        String xmlSource = getSourceCode(project, packageName, testName, TestCaseType.XML);

        if (!StringUtils.hasText(xmlSource)) {
            throw new CitrusAdminRuntimeException("Failed to get XML source code for test: " + packageName + "." + testName);
        }

        try {
            return ((SpringBeans) unmarshaller.unmarshal(new StringSource(xmlSource))).getTestcase();
        } catch (IOException e) {
            throw new CitrusAdminRuntimeException("Failed to unmarshal test case from Spring XML bean definition", e);
        }
    }
View Full Code Here

                return files;
            } else {
                return new String[] {};
            }
        } else {
            throw new CitrusAdminRuntimeException("Could not open directory because it does not exist: " + directory);
        }
    }
View Full Code Here

            StringResult result = new StringResult();
            transformer.transform(xmlSource, result);
            FileUtils.writeToFile(result.toString(), configFile);
            return;
        } catch (IOException e) {
            throw new CitrusAdminRuntimeException("Unable to read update bean definition transformation source", e);
        } catch (TransformerException e) {
            throw new CitrusAdminRuntimeException("Failed to update bean definition", e);
        }
    }
View Full Code Here

                transformer.transform(xmlSource, result);
                FileUtils.writeToFile(result.toString(), file);
                return;
            }
        } catch (IOException e) {
            throw new CitrusAdminRuntimeException("Unable to read update bean definition transformation source", e);
        } catch (TransformerException e) {
            throw new CitrusAdminRuntimeException("Failed to update bean definition", e);
        }
    }
View Full Code Here

                transformer.transform(xmlSource, result);
                FileUtils.writeToFile(result.toString(), file);
                return;
            }
        } catch (IOException e) {
            throw new CitrusAdminRuntimeException("Unable to read update bean definition transformation source", e);
        } catch (TransformerException e) {
            throw new CitrusAdminRuntimeException("Failed to update bean definition", e);
        }
    }
View Full Code Here

        String directory = null;

        try {
            directory = URLDecoder.decode(url, "UTF-8"); // TODO use system default encoding?
        } catch (UnsupportedEncodingException e) {
            throw new CitrusAdminRuntimeException("Unable to decode directory URL", e);
        }

        if (directory.equals("/")) {
            if (StringUtils.hasText(rootDirectory)) {
                directory = rootDirectory;
View Full Code Here

TOP

Related Classes of com.consol.citrus.admin.exception.CitrusAdminRuntimeException

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.