Package org.apache.woden

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


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

     * <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

TOP

Related Classes of org.apache.woden.ErrorReporter

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.