Package com.consol.citrus.admin.exception

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


    public <T> void marshal(JAXBContext context, T element, File file) {
        try {
            Marshaller marshaller = getMarshaller(context);
            marshaller.marshal(element, file);
        } catch (JAXBException e) {
            throw new CitrusAdminRuntimeException("Could not marshall element", e);
        }
    }
View Full Code Here


        try {
            Unmarshaller u = context.createUnmarshaller();
            JAXBElement<T> response = u.unmarshal(new StreamSource(new StringReader(raw)), clazz);
            return response.getValue();
        } catch (JAXBException e) {
            throw new CitrusAdminRuntimeException(String.format("Could not unmarshall %s ", clazz), e);
        }
    }
View Full Code Here

            InputStreamReader in = new InputStreamReader(fis, "UTF-8");
            Unmarshaller u = context.createUnmarshaller();
            JAXBElement<T> response = u.unmarshal(new StreamSource(in), clazz);
            return response.getValue();
        } catch (JAXBException e) {
            throw new CitrusAdminRuntimeException(String.format("Could not unmarshall %s ", clazz), e);
        } catch (FileNotFoundException e) {
            throw new CitrusAdminRuntimeException("Exception thrown during unmarshal", e);
        } catch (UnsupportedEncodingException e) {
            throw new CitrusAdminRuntimeException("Exception thrown during unmarshal", e);
        } finally {
            if (fis != null) {
                try {
                    fis.close();
                } catch (IOException e) {
View Full Code Here

     * @param projectHomeDir
     * @return
     */
    public void load(String projectHomeDir) {
        if (!validateProjectHome(projectHomeDir)) {
            throw new CitrusAdminRuntimeException("Invalid project home - not a proper Citrus project");
        }

        System.setProperty(PropertyConstants.PROJECT_HOME, projectHomeDir);
        project = new Project(projectHomeDir);
        project.setup();
View Full Code Here

                library = dictionarySpringBeanConverter.convert(springBean);
            }
        }

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

        return library;
    }
View Full Code Here

                return FileUtils.readToString(new FileInputStream(sourceFilePath));
            } else {
                return "";
            }
        } catch (IOException e) {
            throw new CitrusAdminRuntimeException("Failed to load test case source code", e);
        }
    }
View Full Code Here

            return fileSystemTestExecutor;
        } else if (configuration instanceof ClasspathRunConfiguration) {
            return classpathTestExecutor;
        }

        throw new CitrusAdminRuntimeException("Unable to execute test for run configuration: " + configuration.getId());
    }
View Full Code Here

     * @param jsonObject
     * @return
     */
    public Object readModel(JSONObject jsonObject) {
        if (!jsonObject.containsKey("modelType")) {
            throw new CitrusAdminRuntimeException("Missing model type information in json object");
        }

        // remove type information as it is not present in jaxb objects
        jsonObject.remove("type");

        String modelType = jsonObject.remove("modelType").toString();
        try {
            return jsonMapper.readValue(jsonObject.toJSONString(), Class.forName(modelType));
        } catch (ClassNotFoundException e) {
            throw new CitrusAdminRuntimeException(String.format("Unknown model type '%s'", modelType), e);
        } catch (Exception e) {
            throw new CitrusAdminRuntimeException("Failed to read json object", e);
        }
    }
View Full Code Here

            if (model != null) {
                return converter.convert(model);
            }
        }

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

     */
    public Project(String projectHome) {
        try {
            this.projectHome = new File(projectHome).getCanonicalPath();
        } catch (IOException e) {
            throw new CitrusAdminRuntimeException("Unable to access project home directory", e);
        }
    }
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.