Package org.wso2.carbon.governance.api.wsdls.dataobjects

Examples of org.wso2.carbon.governance.api.wsdls.dataobjects.Wsdl.addAttribute()


    public void testAddEndpoint() throws Exception {
        // first add an endpoint, get it delete it, simply stuff like that.
        EndpointManager endpointManager = new EndpointManager(registry);

        Endpoint endpoint1 = endpointManager.newEndpoint("http://localhost/papapa/booom");
        endpoint1.addAttribute("status", "QA");

        endpointManager.addEndpoint(endpoint1);
        assertEquals("/endpoints/localhost/papapa/ep-booom", endpoint1.getPath());

        // now get the endpoint back.
View Full Code Here


public class PolicyTest extends BaseTestCase {
    public void testAddPolicy() throws Exception {
        PolicyManager policyManager = new PolicyManager(registry);

        Policy policy = policyManager.newPolicy("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/policy/policy.xml");
        policy.addAttribute("creator", "it is me");
        policy.addAttribute("version", "0.01");
        policyManager.addPolicy(policy);

        Policy newPolicy = policyManager.getPolicy(policy.getId());
        assertEquals(policy.getPolicyContent(), newPolicy.getPolicyContent());
View Full Code Here

    public void testAddPolicy() throws Exception {
        PolicyManager policyManager = new PolicyManager(registry);

        Policy policy = policyManager.newPolicy("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/policy/policy.xml");
        policy.addAttribute("creator", "it is me");
        policy.addAttribute("version", "0.01");
        policyManager.addPolicy(policy);

        Policy newPolicy = policyManager.getPolicy(policy.getId());
        assertEquals(policy.getPolicyContent(), newPolicy.getPolicyContent());
        assertEquals("it is me", newPolicy.getAttribute("creator"));
View Full Code Here

public class SchemaTest extends BaseTestCase {
    public void testAddSchema() throws Exception {
        SchemaManager schemaManager = new SchemaManager(registry);

        Schema schema = schemaManager.newSchema("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/xsd/purchasing.xsd");
        schema.addAttribute("creator", "it is me");
        schema.addAttribute("version", "0.01");
        schemaManager.addSchema(schema);

        Schema newSchema = schemaManager.getSchema(schema.getId());
        assertEquals(schema.getSchemaElement().toString(), newSchema.getSchemaElement().toString());
View Full Code Here

    public void testAddSchema() throws Exception {
        SchemaManager schemaManager = new SchemaManager(registry);

        Schema schema = schemaManager.newSchema("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/xsd/purchasing.xsd");
        schema.addAttribute("creator", "it is me");
        schema.addAttribute("version", "0.01");
        schemaManager.addSchema(schema);

        Schema newSchema = schemaManager.getSchema(schema.getId());
        assertEquals(schema.getSchemaElement().toString(), newSchema.getSchemaElement().toString());
        assertEquals("it is me", newSchema.getAttribute("creator"));
View Full Code Here

        // Save the endpoint reference element as an attribute
        OMElement epr = EndpointReferenceHelper.toOM(OMAbstractFactory.getSOAP11Factory(),
                service.getEpr(),
                AddressingConstants.Final.WSA_ENDPOINT_REFERENCE,
                AddressingConstants.Final.WSA_NAMESPACE);
        newService.addAttribute(DiscoveryConstants.ATTR_EPR, epr.toString());

        // Set the version if provided
        if (service.getMetadataVersion() != -1) {
            newService.addAttribute(DiscoveryConstants.ATTR_METADATA_VERSION,
                    String.valueOf(service.getMetadataVersion()));
View Full Code Here

                AddressingConstants.Final.WSA_NAMESPACE);
        newService.addAttribute(DiscoveryConstants.ATTR_EPR, epr.toString());

        // Set the version if provided
        if (service.getMetadataVersion() != -1) {
            newService.addAttribute(DiscoveryConstants.ATTR_METADATA_VERSION,
                    String.valueOf(service.getMetadataVersion()));
        }

         // Store other service metadata (scopes, types, x-addresses)
        QName[] types = service.getTypes();
View Full Code Here

   
    public void testAddService() throws Exception {
        ServiceManager serviceManager = new ServiceManager(registry);

        Service service = serviceManager.newService(new QName("http://bang.boom.com/mnm/beep", "MyService"));
        service.addAttribute("testAttribute", "somevalue");
        serviceManager.addService(service);

        String serviceId = service.getId();
        Service newService = serviceManager.getService(serviceId);
View Full Code Here

        OMElement contentElement = GovernanceUtils.buildOMElement(fileContents);

        ServiceManager serviceManager = new ServiceManager(registry);                                      
        Service service = serviceManager.newService(contentElement);

        service.addAttribute("custom-attribute", "custom-value");
        serviceManager.addService(service);


        // so retrieve it back
        String serviceId = service.getId();
View Full Code Here

        assertEquals(newService.getAttribute("interface_wsdlURL"),
                "/_system/governance/wsdls/com/foo/abc.wsdl");
        assertEquals(service.getQName(), newService.getQName());

        Service service2 = serviceManager.newService(new QName("http://baps.paps.mug/done", "meep"));
        service2.addAttribute("custom-attribute", "custom-value2");
        serviceManager.addService(service2);

        Service service3 =  serviceManager.newService(new QName("http://baps.paps.mug/jug", "peem"));
        service3.addAttribute("custom-attribute", "not-custom-value");
        serviceManager.addService(service3);
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.