Package org.apache.ws.resource.properties

Examples of org.apache.ws.resource.properties.SushiResourceContext


     */
    public void testQueryResourcePropertiesCallback()
            throws ResourceException,
            ResourceContextException
    {
        m_resourceContext = new SushiResourceContext();

        //build callback obj
        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );

View Full Code Here


    /**
     * Tests that a GetRP request for an existing prop returns a GetRPResponse elem containing that prop.
     */
    public void testGetExistingProp()
    {
        m_resourceContext = new SushiResourceContext();
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse response = getResourceProperty( SushiPropertyQNames.IKA );
        XmlObject[] ebiPropElems = XmlBeanUtils.getChildElements( response, SushiPropertyQNames.IKA );
        assertNotNull( ebiPropElems );
        assertEquals( 1, ebiPropElems.length );
        assertEquals( "mamamia", XmlBeanUtils.getValue( ebiPropElems[0] ) );
View Full Code Here

    /**
     * Tests that a GetRP request for a non-existing optional prop returns an empty GetRPResponse elem.
     */
    public void testGetNonexistingOptionalProp()
    {
        m_resourceContext = new SushiResourceContext();
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse response = getResourceProperty( SushiPropertyQNames.UNI );
        XmlObject[] uniPropElems = XmlBeanUtils.getChildElements( response, SushiPropertyQNames.UNI );
        assertNotNull( uniPropElems );
        assertEquals( 0, uniPropElems.length );
    }
View Full Code Here

     * Tests that a GetRP request for an invalid prop QName throws a fault exception,
     * wether or not the RP doc permits open content.
     */
    public void testGetInvalidProp()
    {
        m_resourceContext = new SushiResourceContext( true );
        assertGetRequestForInvalidPropThrowsFault();
        m_resourceContext = new SushiResourceContext( false );
        assertGetRequestForInvalidPropThrowsFault();
    }
View Full Code Here

     * invokes a {@link org.apache.ws.resource.properties.ResourcePropertyCallback} if one is registered for the
     * requested property.
     */
    public void testGetPropertyTriggersCallback() throws Exception
    {
        m_resourceContext = new SushiResourceContext();
        // create and register callback object
        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
View Full Code Here

    /* ===================================== TESTS FOR 'INSERT' ====================================== */

    public void testInsertResourcePropertiesCallback() throws XmlException, ResourceException,
            ResourceContextException
    {
        m_resourceContext = new SushiResourceContext();
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( m_callback );

        XmlObject xBean =
View Full Code Here

    }

    public void testInsertResourceProperty()
            throws XmlException
    {
        m_resourceContext = new SushiResourceContext();
        XmlObject xBean =
                XmlObject.Factory.parse( "<foo:Ebi xmlns:foo=\"http://ws.apache.org/resource/properties/test/sushi\">"
                + "0" + "</foo:Ebi>" );
        insertResourceProperty( new XmlObject[]{xBean} );
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse getResourcePropertyResponse = getResourceProperty(
View Full Code Here

        assertEquals( 2, childElements.length );
    }

    public void testInsertAnyIntoOpenContent() throws XmlException
    {
        m_resourceContext = new SushiResourceContext();
        insertXsdAnyPropElem();
        assertPropHasOneElemWithGivenValue( SushiPropertyQNames.FUGU, INITIAL_PROP_VALUE_FUGU );
    }
View Full Code Here

        assertPropHasOneElemWithGivenValue( SushiPropertyQNames.FUGU, INITIAL_PROP_VALUE_FUGU );
    }

    public void testInsertAnyIntoNonOpenContent() throws Exception
    {
        m_resourceContext = new SushiResourceContext( false );
        try
        {
            insertXsdAnyPropElem();
            fail();
        }
View Full Code Here

    /* ===================================== TESTS FOR 'DELETE' ====================================== */

    public void testDeleteExistingOptionalProp()
            throws Exception
    {
        m_resourceContext = new SushiResourceContext();
        deleteResourceProperty( SushiPropertyQNames.OHTORO );
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse response = getResourceProperty(
                SushiPropertyQNames.OHTORO );
        XmlObject[] ohtoroPropElems = XmlBeanUtils.getChildElements( response, SushiPropertyQNames.OHTORO );
        assertNotNull( ohtoroPropElems );
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.properties.SushiResourceContext

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.