Examples of IntOrTokenAnyAttrImpl


Examples of org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl

    {
        /* IntOrTokenAnyAttrImpl is the class registered for this extension attribute. Use this type
         * here, rather than the IntOrTokenAttr interface, to guarantee that if the code contains an
         * xs:token it is of type #any.
         */
        IntOrTokenAnyAttrImpl code = (IntOrTokenAnyAttrImpl) ((WSDLElement) getParent())
            .getExtensionAttribute(HTTPConstants.Q_ATTR_CODE);
       
        if(code == null)
        {
            //defaults to xs:token #any if the attribute is omitted from the WSDL.
            return HTTPErrorStatusCode.ANY;
        }
        else if(code.isToken())
        {
            //if IntOrTokenAnyAttrImpl contains a token then is must be '#any'
            return HTTPErrorStatusCode.ANY;
        }
        else if(code.isInt())
        {
            return new HTTPErrorStatusCode(code.getInt());
        }
        else
        {
            //the whttp:code attribute contains an invalid value (i.e. not an xs:QName or the xs:token #any)
            //TODO confirm if this should be represented in the Component model as a null
View Full Code Here

Examples of org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl

    }
   
    public void testAttributeType() throws Exception
    {
        String attrVal = "#any";
        attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
        String expectedQN = qn.toString();
        String actualQN = attr.getAttributeType().toString();
        assertEquals("Expected attribute type qname '" + expectedQN + "' but actual qname was '" + actualQN + "'.",
                expectedQN,
                actualQN );
View Full Code Here

Examples of org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl

    }
   
    public void testValidToken() throws Exception
    {
        String attrVal = "#any";
        attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
       
        assertTrue("isValid() should return true", attr.isValid());
        assertTrue("getContent() should return instance of 'String' but actual object type was '" + attr.getContent().getClass().getName() + "'.",
                attr.getContent() instanceof String);
        assertEquals("Expected toExternalForm() to return '" + attrVal + "' but actual value was '" + attr.toExternalForm() + "'.",
View Full Code Here

Examples of org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl

    }

    public void testValidInt() throws Exception
    {
        String attrVal = "123";
        attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
       
        assertTrue("isValid() should return true", attr.isValid());
        assertTrue("getContent() should return instance of 'Integer' but actual object type was '" + attr.getContent().getClass().getName() + "'.",
                attr.getContent() instanceof Integer);
        assertEquals("Expected toExternalForm() to return '" + attrVal + "' but actual value was '" + attr.toExternalForm() + "'.",
View Full Code Here

Examples of org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl

    }

    public void testInvalidValue() throws Exception
    {
        String attrVal = "#rubbish";
        attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
       
        ErrorInfo errInfo = (ErrorInfo)handler.errors.get("WSDL512");
        assertNotNull("An error should have been reported", errInfo);
        assertEquals("Error 'WSDL512' expected but error reported was '" + errInfo.getKey() + "'.",
                "WSDL512",
View Full Code Here

Examples of org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl

    }

    public void testNullValue() throws Exception
    {
        String attrVal = null;
        attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
       
        ErrorInfo errInfo = (ErrorInfo)handler.errors.get("WSDL512");
        assertNotNull("An error should have been reported", errInfo);
        assertEquals("Error 'WSDL512' expected but error reported was '" + errInfo.getKey() + "'.",
                "WSDL512",
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.