Examples of ResourceProperty


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

    * @throws Exception DOCUMENT_ME
    */
   public void testGet()
         throws Exception
   {
      ResourceProperty resourceProp = m_resourcePropSet.get( SushiPropertyQNames.AKAGI );
      assertEquals( 1, resourceProp.size() );
      assertEquals( SushiPropertyQNames.AKAGI, resourceProp.getMetaData().getName() );
      XmlObject propElemXBean = (XmlObject) resourceProp.get( 0 );
      assertEquals( "24", XmlBeanUtils.getValue( propElemXBean ) );
   }
View Full Code Here

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

    * @throws Exception DOCUMENT_ME
    */
   public void testRemove()
         throws Exception
   {
      ResourceProperty resourceProp = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      assertEquals( 1, resourceProp.size() );
      m_resourcePropSet.remove( SushiPropertyQNames.IKA );
      resourceProp = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      assertNull( resourceProp );
   }
View Full Code Here

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

    * Test for XmlBeansResourceProperty#add.
    */
   public void testAdd()
         throws Exception
   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      final String stringValue = "somethang";
      prop.add( XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      assertEquals( 2,
            prop.size() );
      XmlString xString = (XmlString) prop.get( 1 );
      assertEquals( stringValue,
            xString.getStringValue() );
   }
View Full Code Here

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

    * Test for XmlBeansResourceProperty#clear.
    */
   public void testClear()
         throws Exception
   {
      ResourceProperty manufacturerProp = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      manufacturerProp.clear();
      assertTrue( manufacturerProp.isEmpty() );
   }
View Full Code Here

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

    * Test for XmlBeansResourceProperty#get.
    */
   public void testGet()
         throws Exception
   {
      ResourceProperty manufacturerProp = m_resourcePropSet.get( SushiPropertyQNames.AKAGI );
      Object propObj = manufacturerProp.get( 0 );
      assertTrue( propObj instanceof XmlInt );
      XmlInt xInt = (XmlInt) propObj;
      assertEquals( "24",
            xInt.getStringValue() );
   }
View Full Code Here

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

    * Test for XmlBeansResourceProperty#getMetaData.
    */
   public void testGetMetaData()
         throws Exception
   {
      ResourceProperty blockSize = m_resourcePropSet.get( SushiPropertyQNames.EBI );
      ResourcePropertyMetaData metaData = blockSize.getMetaData();
      assertNotNull( metaData );
      assertEquals( SushiPropertyQNames.EBI,
            metaData.getName() );
      assertEquals( 1,
            metaData.getMinOccurs() );
View Full Code Here

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

    * Test for XmlBeansResourceProperty#isEmpty.
    */
   public void testIsEmpty()
         throws Exception
   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      assertFalse( prop.isEmpty() );
      prop.clear();
      assertTrue( prop.isEmpty() );
      assertEquals( 0,
            prop.size() );
   }
View Full Code Here

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

    * Test for XmlBeansResourceProperty#remove.
    */
   public void testRemoveExistingElement()
         throws Exception
   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.HAMACHI );
      prop.remove( prop.get( 0 ) );
      assertTrue( prop.isEmpty() );
      assertEquals( 0, XmlBeanUtils.getChildElements( m_resourcePropSet.toXmlObject(), SushiPropertyQNames.HAMACHI ).length );
   }
View Full Code Here

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

     * Another test for XmlBeansResourceProperty#remove.
     */
    public void testRemoveAddedElement()
          throws Exception
    {
        ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.HAMACHI );
        prop.clear();
        XmlObject hamachiDoc = XmlObject.Factory.parse( "<Hamachi xmlns=\"http://ws.apache.org/resource/properties/test/sushi\">\n" +
                                         "  <Flavor>disgusting</Flavor>\n" +
                                         "</Hamachi>" );
        prop.add( hamachiDoc );
        assertEquals( 1, prop.size() );
        assertEquals( 1, XmlBeanUtils.getChildElements( m_resourcePropSet.toXmlObject(), SushiPropertyQNames.HAMACHI ).length );
        prop.remove( prop.get( 0 ) );
        assertTrue( prop.isEmpty() );
        assertEquals( 0, XmlBeanUtils.getChildElements( m_resourcePropSet.toXmlObject(), SushiPropertyQNames.HAMACHI ).length );
    }
View Full Code Here

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

    * Test for XmlBeansResourceProperty#set.
    */
   public void testSet()
         throws Exception
   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      final String stringValue = "somethang";
      prop.set( 0,
            XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      XmlString xString = (XmlString) prop.get( 0 );
      assertEquals( stringValue,
            xString.getStringValue() );
   }
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.