/** @throws Exception */ @AfterClass() public void clear() throws Exception { String servicePathToDelete = absPath; if (wsRegistryServiceClient.resourceExists(servicePathToDelete)) { resourceAdminServiceClient.deleteResource(servicePathToDelete); } // String schemaPathToDelete = // "/_system/governance/trunk/schemas/org/bar/purchasing/purchasing.xsd"; // if (wsRegistryServiceClient.resourceExists(schemaPathToDelete)) { // resourceAdminServiceClient.deleteResource(schemaPathToDelete); // } // String wsdlPathToDelete = // "/_system/governance/trunk/wsdls/com/foo/IntergalacticService.wsdl"; // if (wsRegistryServiceClient.resourceExists(wsdlPathToDelete)) { // resourceAdminServiceClient.deleteResource(wsdlPathToDelete); // } lifeCycleManagementClient.deleteLifeCycle(LC_NAME); wsRegistryServiceClient = null; lifeCycleAdminServiceClient = null; lifeCycleManagementClient = null; governanceServiceClient = null; listMetadataServiceClient = null; resourceAdminServiceClient = null; userManagementClient = null; infoServiceAdminClient = null; humanTaskAdminClient = null; }
@Test(groups = "wso2.greg", description = "Create a service") public void testCreateService() throws XMLStreamException, IOException, AddServicesServiceRegistryExceptionException, ListMetadataServiceRegistryExceptionException, ResourceAdminServiceExceptionException { String servicePath = getTestArtifactLocation() + "artifacts" + File.separator + "GREG" + File.separator + "services" + File.separator + "intergalacticService16.metadata.xml"; DataHandler dataHandler = new DataHandler(new URL("file:///" + servicePath)); String mediaType = "application/vnd.wso2-service+xml"; String description = "This is a test service"; resourceAdminServiceClient.addResource( "/_system/governance/service2", mediaType, description, dataHandler); ResourceData[] data = resourceAdminServiceClient.getResource(absPath); assertNotNull(data, "Service not found"); }