Code example for QName

0
 
        createNewPolicy(); 
        testPol.addPolicyComponents(pC);
 
        elm = PolicyUtil.getPolicyAsOMElement(testPol);
        String attr = elm.getAttributeValue(attrName);
        assertEquals("attribute1",attr);
 
        String ps1 = PolicyUtil.getPolicyAsString(testPol1);
        System.out.println(ps1);
 
        wrapEle = PolicyUtil.getWrapper("testingPolicy");
        OMNamespace nmSpecs = element.getNamespace();
        assertEquals("wsp",nmSpecs.getPrefix());
 
    } 
 
    public void createNewPolicy() throws Exception{ 
         
        attrName = new QName("attr");
        attrName1 = new QName("attr1");
 
        testPol = new Policy();
        testPol.setName("testPol");
        testPol.setId("pol");
        testPol.addAttribute(attrName,"attribute1");
 
        testPol1 = new Policy();
        testPol1.setName("testPol1");
        testPol1.setId("pol1");
        testPol1.addAttribute(attrName1,"attribute2");