@BeforeClass(alwaysRun = true)
 public void setEnvironment() throws Exception {
   super.init();
   uploadResourcesToConfigRegistry();
   loadESBConfigurationFromClasspath(
       "/artifacts/ESB/proxyconfig/proxy/customProxy/outsequence_faultsequence.xml");
 }
  @SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE})
  @BeforeClass(alwaysRun = true)
  public void setEnvironment() throws Exception {
    super.init();

    //        if (FrameworkFactory.getFrameworkProperties(
    //                ProductConstant.ESB_SERVER_NAME).getEnvironmentSettings().is_builderEnabled())
    // {
    axis2Server = new SampleAxis2Server("test_axis2_server_9001.xml");
    axis2Server.start();
    axis2Server.deployService(MTOM_SERVICE);
    loadESBConfigurationFromClasspath(relativeFilePath);

    //        } else {
    //            builder = new EnvironmentBuilder().as(ProductConstant.ADMIN_USER_ID);
    //            appServer = builder.build().getAs();
    //            int deploymentDelay =
    // builder.getFrameworkSettings().getEnvironmentVariables().getDeploymentDelay();
    //            String serviceFilePath =
    // ProductConstant.getResourceLocations(ProductConstant.AXIS2_SERVER_NAME)
    //                                     + File.separator + "aar" + File.separator + MTOM_SERVICE
    // + ".aar";
    //            ServiceDeploymentUtil deployer = new ServiceDeploymentUtil();
    //            deployer.deployArrService(appServer.getBackEndUrl(), appServer.getSessionCookie()
    //                    , MTOM_SERVICE, serviceFilePath, deploymentDelay);
    //            updateESBConfiguration(replaceEndpoints(relativeFilePath, MTOM_SERVICE, "9001"));
    //        }

  }
 @BeforeClass(alwaysRun = true)
 public void uploadSynapseConfig() throws Exception {
   super.init();
   symbol =
       FileUtils.readFileToString(
           new File(getESBResourceLocation() + "/mediatorconfig/iterate/iterate1.txt"));
   loadESBConfigurationFromClasspath("/artifacts/ESB/mediatorconfig/iterate/invalid_XPath.xml");
 }
  @AfterClass(groups = "wso2.esb")
  public void close() throws Exception {
    // resourceAdminServiceClient.deleteResource("/_system/config/test_ep_config");
    axis2Server1.stop();

    endPointAdminClient = null;
    super.cleanup();
  }
 @BeforeClass(alwaysRun = true)
 public void setEnvironment() throws Exception {
   super.init();
   loadESBConfigurationFromClasspath("/artifacts/ESB/synapseconfig/config20/synapse.xml");
   aggregatedRequestClient = new AggregatedRequestClient();
   aggregatedRequestClient.setProxyServiceUrl(
       getProxyServiceURLHttp("aggregateMediatorTestProxy"));
   aggregatedRequestClient.setSymbol("IBM");
 }
 @BeforeClass(alwaysRun = true)
 public void init() throws Exception {
   super.init();
   String relativePath = "/artifacts/ESB/synapseconfig/esbjava2283/api.xml";
   ESBTestCaseUtils util = new ESBTestCaseUtils();
   relativePath = relativePath.replaceAll("[\\\\/]", File.separator);
   OMElement apiConfig = util.loadResource(relativePath);
   addApi(apiConfig);
 }
  @BeforeTest(alwaysRun = true)
  public void init() throws Exception {
    super.init();

    wireMonitorServer = new WireMonitorServer(6770);
    wireMonitorServer.start();

    loadESBConfigurationFromClasspath(
        "/artifacts/ESB/passthru/transport/header/PreserveContentTypeHeaderTest.xml");
  }
  @BeforeClass(alwaysRun = true)
  public void setEnvironment() throws Exception {

    super.init();
    serverConfigurationManager = new ServerConfigurationManager(context);
    serverConfigurationManager.applyConfiguration(
        new File(
            getClass()
                .getResource(
                    File.separator
                        + "artifacts"
                        + File.separator
                        + "ESB"
                        + File.separator
                        + "synapseconfig"
                        + File.separator
                        + "smooks"
                        + File.separator
                        + "axis2.xml")
                .getPath()));
    super.init();
    loadESBConfigurationFromClasspath(
        File.separator
            + "artifacts"
            + File.separator
            + "ESB"
            + File.separator
            + "synapseconfig"
            + File.separator
            + "smooks"
            + File.separator
            + "smooks_synapse.xml");

    resourceAdminServiceClient =
        new ResourceAdminServiceClient(
            contextUrls.getBackEndUrl(),
            context.getContextTenant().getContextUser().getUserName(),
            context.getContextTenant().getContextUser().getPassword());

    uploadResourcesToConfigRegistry();
    addSmooksProxy();
    addSmooksSequence();
  }
  @BeforeClass(alwaysRun = true)
  protected void init() throws Exception {
    super.init();
    OMElement synapse =
        esbUtils.loadResource(
            "/artifacts/ESB/jms/transport/ESBJAVA3714_JMX_Pause_JMS_Listener.xml");
    updateESBConfiguration(JMSEndpointManager.setConfigurations(synapse));

    jmxClient = new JMXClient(null, null, "localhost", "admin", "admin");
    mbsc = jmxClient.connect();
  }
  @AfterClass(alwaysRun = true)
  public void destroy() throws Exception {
    ResourceAdminServiceClient resourceAdmin =
        new ResourceAdminServiceClient(contextUrls.getBackEndUrl(), sessionCookie);
    try {
      resourceAdmin.deleteResource("/_system/config/securityTransform");
    } finally {

      super.cleanup();
    }
  }
  @AfterClass(alwaysRun = true)
  public void close() throws Exception {
    if (axis2Server != null && axis2Server.isStarted()) {
      axis2Server.stop();

      //        } else {
      //            ServiceDeploymentUtil deployer = new ServiceDeploymentUtil();
      //            deployer.unDeployArrService(appServer.getBackEndUrl(),
      // appServer.getSessionCookie()
      //                    , MTOM_SERVICE, 30000);
    }
    super.cleanup();
  }
 @BeforeClass(alwaysRun = true)
 public void init() throws Exception {
   super.init();
   loadESBConfigurationFromClasspath(
       File.separator
           + "artifacts"
           + File.separator
           + "ESB"
           + File.separator
           + "synapseconfig"
           + File.separator
           + "esbjava3022"
           + File.separator
           + "synapse.xml");
 }
  @BeforeClass(alwaysRun = true)
  public void init() throws Exception {
    super.init();

    loadESBConfigurationFromClasspath(
        File.separator
            + "artifacts"
            + File.separator
            + "ESB"
            + File.separator
            + "endpoint"
            + File.separator
            + "httpEndpointConfig"
            + File.separator
            + "serviceChainingWithHTTPEP.xml");
  }
  @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"));
  }
  @BeforeClass(alwaysRun = true)
  public void initialize() throws Exception {
    super.init();
    loadESBConfigurationFromClasspath(
        File.separator
            + "artifacts"
            + File.separator
            + "ESB"
            + File.separator
            + "mailTransport"
            + File.separator
            + "mailTransportReceiver"
            + File.separator
            + "mail_transport_invalid_folder.xml");

    // Since ESB reads all unread emails one by one, we have to delete
    // the all unread emails before run the test
    MailToTransportUtil.deleteAllUnreadEmailsFromGmail();
  }
  @BeforeClass(alwaysRun = true)
  public void init() throws Exception {

    axis2Server1 = new SampleAxis2Server("test_axis2_server_9009.xml");
    axis2Server1.start();
    axis2Server1.deployService(ESBTestConstant.STUDENT_REST_SERVICE);

    super.init();
    loadESBConfigurationFromClasspath(
        File.separator
            + "artifacts"
            + File.separator
            + "ESB"
            + File.separator
            + "endpoint"
            + File.separator
            + "httpEndpointConfig"
            + File.separator
            + "synapse.xml");

    endPointAdminClient =
        new EndPointAdminClient(context.getContextUrls().getBackEndUrl(), getSessionCookie());
  }
 @AfterClass()
 public void close() throws Exception {
   super.cleanup();
 }
 @BeforeClass(alwaysRun = true)
 public void setEnvironment() throws Exception {
   super.init();
   loadESBConfigurationFromClasspath("/artifacts/ESB/jaxrs/jsonfilterfromjsonpath.xml");
 }
 @AfterClass(alwaysRun = true)
 public void stop() throws Exception {
   client.destroy();
   super.cleanup();
 }
 @AfterClass(alwaysRun = true)
 public void destroy() throws Exception {
   clearUploadedResource();
   super.cleanup();
 }
 @AfterClass(groups = "wso2.esb", alwaysRun = true)
 public void close() throws Exception {
   super.cleanup();
   symbol = null;
 }
 @AfterClass(alwaysRun = true)
 public void destroy() throws Exception {
   aggregatedRequestClient = null;
   super.cleanup();
 }
 @AfterClass
 public void close() throws Exception {
   symbol = null;
   super.cleanup();
 }
 @AfterClass(alwaysRun = true)
 public void destroy() throws Exception {
   super.cleanup();
   jmxClient.disconnect();
 }
 @AfterClass(alwaysRun = true)
 public void deleteService() throws Exception {
   super.cleanup();
 }
 @AfterTest(alwaysRun = true)
 public void destroy() throws Exception {
   super.cleanup();
 }
 @BeforeClass(alwaysRun = true)
 public void uploadSynapseConfig() throws Exception {
   super.init();
   loadSampleESBConfiguration(14);
 }
 @BeforeClass(alwaysRun = true)
 public void setEnvironment() throws Exception {
   super.init();
   loadSampleESBConfiguration(153);
 }
 @AfterClass(alwaysRun = true)
 private void destroy() throws Exception {
   super.cleanup();
 }
 @BeforeClass(alwaysRun = true)
 public void setEnvironment() throws Exception {
   super.init();
   loadESBConfigurationFromClasspath(
       "/artifacts/ESB/proxyconfig/proxy/passThroughProxy/passThroughProxy.xml");
 }