private void uploadResourcesToConfigRegistry() throws Exception {

    ResourceAdminServiceClient resourceAdminServiceStub =
        new ResourceAdminServiceClient(
            context.getContextUrls().getBackEndUrl(), getSessionCookie());

    resourceAdminServiceStub.deleteResource("/_system/config/sequence");
    resourceAdminServiceStub.addCollection(
        "/_system/config/", "sequence", "", "Contains test sequence files");

    resourceAdminServiceStub.addResource(
        "/_system/config/sequence/out_sequence.xml",
        "application/vnd.wso2.sequence",
        "application/vnd.wso2.sequence files",
        new DataHandler(
            new URL(
                "file:///"
                    + getESBResourceLocation()
                    + "/proxyconfig/proxy/utils/out_sequence.xml")));

    Thread.sleep(2000);

    resourceAdminServiceStub.addResource(
        "/_system/config/sequence/fault_sequence.xml",
        "application/vnd.wso2.sequence",
        "application/vnd.wso2.sequence files",
        new DataHandler(
            new URL(
                "file:///"
                    + getESBResourceLocation()
                    + "/proxyconfig/proxy/utils/fault_sequence.xml")));

    Thread.sleep(1000);
  }
  @AfterClass(alwaysRun = true)
  public void destroy() throws Exception {
    ResourceAdminServiceClient resourceAdmin =
        new ResourceAdminServiceClient(contextUrls.getBackEndUrl(), sessionCookie);
    try {
      resourceAdmin.deleteResource("/_system/config/securityTransform");
    } finally {

      super.cleanup();
    }
  }
  private void clearUploadedResource()
      throws InterruptedException, ResourceAdminServiceExceptionException, RemoteException,
          XPathExpressionException {

    ResourceAdminServiceClient resourceAdminServiceStub =
        new ResourceAdminServiceClient(
            context.getContextUrls().getBackEndUrl(), getSessionCookie());

    resourceAdminServiceStub.deleteResource("/_system/config/sequence");

    Thread.sleep(1000);
  }
  @BeforeClass(alwaysRun = true)
  public void setEnvironment() throws Exception {
    super.init();

    ResourceAdminServiceClient resourceAdmin =
        new ResourceAdminServiceClient(contextUrls.getBackEndUrl(), sessionCookie);
    resourceAdmin.addCollection(
        "/_system/config/", "securityTransform", "collection", "policy files");
    resourceAdmin.addResource(
        "/_system/config/securityTransform/scenario2-policy.xml",
        "application/xml",
        "dss",
        new DataHandler(new URL("file:///" + policyPath + "scenario2-policy.xml")));

    updateESBConfiguration(
        SecureEndpointSetter.setEndpoint(
            "/artifacts/ESB/proxyconfig/proxy/secureProxy/security_transformation_proxy_for_policy2_backEnd.xml"));
  }
 private void uploadResourcesToConfigRegistry() throws Exception {
   resourceAdminServiceClient.addResource(
       "/_system/config/smooks_config.xml",
       "application/xml",
       "xml files",
       new DataHandler(
           new URL(
               "file:///"
                   + getClass()
                       .getResource("/artifacts/ESB/synapseconfig/smooks/smooks_config.xml")
                       .getPath())));
 }
 @AfterClass(alwaysRun = true)
 public void close() throws Exception {
   try {
     if (isProxyDeployed) {
       deleteProxyService("SmooksProxy");
     }
     resourceAdminServiceClient.deleteResource("/_system/config/smooks_config.xml");
   } finally {
     cleanup();
     Thread.sleep(3000);
     serverConfigurationManager.restoreToLastConfiguration();
     resourceAdminServiceClient = null;
     serverConfigurationManager = null;
   }
 }