Examples of ErrorReporter


Examples of org.apache.woden.ErrorReporter

                try {
                    Class clazz = Class.forName(extensionRegistrarClassName);
                    ExtensionRegistrar registrar = (ExtensionRegistrar)clazz.newInstance();
                    registrar.registerExtensions(this);
                } catch (ClassNotFoundException cnfe) {
                    ErrorReporter er = getErrorReporter();
                    er.reportError(
                            null,
                            "WSDL020",
                            new Object[] {extensionRegistrarClassName},
                            ErrorReporter.SEVERITY_ERROR,
                            cnfe);
View Full Code Here

Examples of org.apache.woden.ErrorReporter

public abstract class BaseWSDLFactory extends WSDLFactory {

    protected WSDLContext fWsdlContext;
   
    protected BaseWSDLFactory() throws WSDLException {
        ErrorReporter errRpt = new ErrorReporterImpl();
        ExtensionRegistry extReg = new PopulatedExtensionRegistry(errRpt);
        ((ErrorReporterImpl)errRpt).setExtensionRegistry(extReg);
        fWsdlContext = new WSDLContext(this, errRpt, extReg, null);
    }
View Full Code Here

Examples of org.apache.woden.ErrorReporter

     * <li>the key is not found in any resource bundle.</li>
     * <ul>
     */
    public void testMessageExtension() {
        fExtReg.registerResourceBundle("org.apache.woden.wsdl20.extensions.resources.ExtensionMessages");
        ErrorReporter errorReporter = fExtReg.getErrorReporter();

        // verify formatting of a message in core resource bundle
        assertEquals("Unexpected core message",
                "The feature name \"foo\" is not recognized.",
                errorReporter.getFormattedMessage("WSDL006", new Object[]{"foo"}));

        // verify formatting of a message in extension resource bundle
        assertEquals("Unexpected extension message",
                "Attribute \"count\" in element \"ext\" must contain \"int\".",
                errorReporter.getFormattedMessage("EXT001", new Object[]{"count", "ext", "int"}));

        // verify core format is not overridden by extension resource bundle
        assertEquals("Unexpected core message",
                "The property name must not be null when attempting to get or set a named property.",
                errorReporter.getFormattedMessage("WSDL007", null));

        // verify exception on unknown format key
        String unknownKey = "_UNKNOWN_KEY_";
        try {
            errorReporter.getFormattedMessage(unknownKey, new Object[]{});
            fail("Expected MissingResourceException for "+unknownKey);
        } catch (MissingResourceException mre) {
            assertEquals("Unexpected MissingResourceException key", unknownKey, mre.getKey());
        }
    }
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

                super.setFork(fork);
                super.setClassname(useGroovyShell ? "groovy.lang.GroovyShell" : "org.codehaus.groovy.ant.Groovy");
                super.execute();
            } catch (Exception e) {
                StringWriter writer = new StringWriter();
                new ErrorReporter(e, false).write(new PrintWriter(writer));
                String message = writer.toString();
                throw new BuildException("Script Failed: " + message, e, getLocation());
            }
            return;
        }
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

        }
    }

    private void processError(Exception e) {
        StringWriter writer = new StringWriter();
        new ErrorReporter(e, false).write(new PrintWriter(writer));
        String message = writer.toString();
        throw new BuildException("Script Failed: " + message, e, getLocation());
    }
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

                        if ((re.getClass() == RuntimeException.class) && (re.getCause() != null)) {
                            // unwrap to the real exception
                            t = re.getCause();
                        }
                        StringWriter writer = new StringWriter();
                        new ErrorReporter(t, false).write(new PrintWriter(writer));
                        String message = writer.toString();

                        if (failOnError) {
                            log(message, Project.MSG_INFO);
                            throw new BuildException("Compilation Failed", t, getLocation());
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

                super.setFork(fork);
                super.setClassname(useGroovyShell ? "groovy.lang.GroovyShell" : "org.codehaus.groovy.ant.Groovy");
                super.execute();
            } catch (Exception e) {
                StringWriter writer = new StringWriter();
                new ErrorReporter(e, false).write(new PrintWriter(writer));
                String message = writer.toString();
                throw new BuildException("Script Failed: " + message, e, getLocation());
            }
            return;
        }
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

        }
    }

    private void processError(Exception e) {
        StringWriter writer = new StringWriter();
        new ErrorReporter(e, false).write(new PrintWriter(writer));
        String message = writer.toString();
        throw new BuildException("Script Failed: " + message, e, getLocation());
    }
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

    /**
     * Reports the last parsing error to the user.
     */
    private void report() {
        err.println("Discarding invalid text:"); // TODO: i18n
        new ErrorReporter(error, false).write(err);
    }
View Full Code Here

Examples of org.codehaus.groovy.tools.ErrorReporter

    /**
     * Reports the last parsing error to the user.
     */
    private void report() {
        err.println("Discarding invalid text:"); // TODO: i18n
        new ErrorReporter(error, false).write(err);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.