Package org.objectweb.celtix.tools.common

Examples of org.objectweb.celtix.tools.common.ToolException


            expression = expression + "/" + bindings.getAttribute("node");
            try {
                evaluateBindingsNode(bindings, expression);
            } catch (WSDLException we) {
                Message msg = new Message("PARSE_BININDINGFILE_EXCEPTION", LOG);
                throw new ToolException(msg, we);
            }
        }

        Element[] children = getChildElements(bindings, ToolConstants.NS_JAXWS_BINDINGS);
        for (int i = 0; i < children.length; i++) {
View Full Code Here


            jaxwsBindings.add(root);
        } else if (isValidJaxbBindingFile(reader)) {
            env.addJaxbBindingFile(bindingFile, is);
        } else {
            Message msg = new Message("UNKONW_BINDING_FILE", LOG, bindingFile);
            throw new ToolException(msg);
        }
    }
View Full Code Here

                }
                wsdlLocation = ProcessorUtil.absolutize(ProcessorUtil.getFileOrURLName(wsdlLocation));
                   
                if (!StringUtils.getURL(wsdlURL).equals(StringUtils.getURL(wsdlLocation))) {
                    Message msg = new Message("NOT_POINTTO_URL", LOG, new Object[]{wsdlLocation, wsdlURL});
                    throw new ToolException(msg);
                }
            } else {
                return false;
            }
        } catch (MalformedURLException e) {
            Message msg = new Message("CAN_NOT_GET_WSDL_LOCATION", LOG);
            throw new ToolException(msg, e);
        }
        return true;
    }
View Full Code Here

                });

            // builder.setEntityResolver(new NullEntityResolver());
            return builder.parse(source).getDocumentElement();
        } catch (ParserConfigurationException e) {
            throw new ToolException("parsing.parserConfigException", e);
        } catch (FactoryConfigurationError e) {
            throw new ToolException("parsing.factoryConfigException", e);
        } catch (SAXException e) {
            throw new ToolException("parsing.saxException", e);
        } catch (IOException e) {
            throw new ToolException("parsing.saxException", e);
        }
    }
View Full Code Here

        env = null;
    }
   
    private void mkDir(File dir) {
        if (dir == null) {
            throw new ToolException("dir attribute is required");
        }
       
        if (dir.isFile()) {
            throw new ToolException("Unable to create directory as a file "
                                    + "already exists with that name: "
                                    + dir.getAbsolutePath());
        }

        if (!dir.exists()) {
            boolean result = doMkDirs(dir);
            if (!result) {
                String msg = "Directory " + dir.getAbsolutePath()
                    + " creation was not successful for an unknown reason";
                throw new ToolException(msg);
            }
        }
    }
View Full Code Here

import junit.framework.TestCase;
import org.objectweb.celtix.tools.common.ToolException;
public class ToolExceptionTest extends TestCase {
    public void testMassMethod() {
        ToolException e = new ToolException("e");
        assertTrue(e.getCause() == null);
        e = new ToolException("run time exception", new RuntimeException("test run time exception"));
        assertTrue(e.getCause() instanceof RuntimeException);
        assertTrue(e.toString() != null);
    }
View Full Code Here

                org.objectweb.celtix.common.i18n.Message msg =
                    new org.objectweb.celtix.common.i18n.Message("ELEMENT_MISSING",
                                                                 LOG,
                                                                 new Object[]{element.toString(),
                                                                              part.getName()});
                throw new ToolException(msg);
                // return new ArrayList<Property>();
            }
        } else {
            return new ArrayList<Property>();
        }
View Full Code Here

            }
            i++;
        }
        if (!criteria1) {
            Message message = new Message("DOC_BARE_METHOD_CRITERIA1", LOG);
            throw new ToolException(message);
        }
        if (!criteria2) {
            Message message = new Message("DOC_BARE_METHOD_CRITERIA2", LOG);
            throw new ToolException(message);
        }
        criteria3 = nonHeaderParamCount <= 1 ? true : false;
        if (!criteria3) {
            Message message = new Message("DOC_BARE_METHOD_CRITERIA3", LOG);
            throw new ToolException(message);
        }
        return paras;
    }
View Full Code Here

            Class exReturnType = null;
            Method faultInfo = null;
            try {
                faultInfo = exClass.getMethod("getFaultInfo", new Class[0]);
            } catch (SecurityException e) {
                throw new ToolException(e.getMessage(), e);
            } catch (NoSuchMethodException e) {
                throw new ToolException(e.getMessage(), e);
            }

            if (faultInfo != null) {
                WebFault wf = exClass.getAnnotation(WebFault.class);
                exReturnType = faultInfo.getReturnType();
View Full Code Here

        if (bindingType == null) {
            org.objectweb.celtix.common.i18n.Message msg =
                new org.objectweb.celtix.common.i18n.Message("BINDING_SPECIFY_ONE_PROTOCOL",
                                                              LOG,
                                                              binding.getQName());
            throw new ToolException(msg);
        }

        if (isSoapBinding()) {
            SOAPBinding spbd = (SOAPBinding)this.bindingObj;
            jport.setStyle(getSoapStyle(spbd.getStyle()));
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.tools.common.ToolException

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.