private void endpointDeletionScenario()
     throws RemoteException, EndpointAdminEndpointAdminException {
   int beforeCount = endPointAdminClient.getEndpointCount();
   endPointAdminClient.deleteEndpoint(ENDPOINT_NAME);
   int afterCount = endPointAdminClient.getEndpointCount();
   assertEquals(1, beforeCount - afterCount);
 }
 private void cleanupEndpoints() throws RemoteException, EndpointAdminEndpointAdminException {
   String[] endpointNames = endPointAdminClient.getEndpointNames();
   List endpointList;
   if (endpointNames != null && endpointNames.length > 0 && endpointNames[0] != null) {
     endpointList = Arrays.asList(endpointNames);
     if (endpointList.contains(ENDPOINT_NAME)) {
       endPointAdminClient.deleteEndpoint(ENDPOINT_NAME);
     }
   }
 }
  private void endpointAdditionScenario() throws Exception {
    int beforeCount = endPointAdminClient.getEndpointCount();

    addEndpoint(
        AXIOMUtil.stringToOM(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                + "<endpoint xmlns=\"http://ws.apache.org/ns/synapse\" name=\""
                + ENDPOINT_NAME
                + "\">\n"
                + "<http method=\"POST\"\n"
                + "              uri-template=\"http://localhost:9000/services/SimpleStockQuoteService\"/>"
                + "</endpoint>"));
    int afterCount = endPointAdminClient.getEndpointCount();
    assertEquals(1, afterCount - beforeCount);

    String[] endpoints = endPointAdminClient.getEndpointNames();
    if (endpoints != null && endpoints.length > 0 && endpoints[0] != null) {
      List endpointList = Arrays.asList(endpoints);
      assertTrue(endpointList.contains(ENDPOINT_NAME));
    } else {
      fail("Endpoint has not been added to the system properly");
    }
  }
 private void endpointStatisticsScenario()
     throws RemoteException, EndpointAdminEndpointAdminException {
   endPointAdminClient.enableEndpointStatistics(ENDPOINT_NAME);
   String endpoint = endPointAdminClient.getEndpointConfiguration(ENDPOINT_NAME);
   assertTrue(endpoint.contains("statistics=\"enable"));
 }
 private void dynamicEndpointDeletionScenario(String path)
     throws RemoteException, EndpointAdminEndpointAdminException {
   int beforeCount = endPointAdminClient.getDynamicEndpointCount();
   endPointAdminClient.deleteDynamicEndpoint(path);
   EndpointTestUtils.assertDynamicEndpointDeletion(beforeCount, endPointAdminClient);
 }
 private void dynamicEndpointAdditionScenario(String path)
     throws IOException, EndpointAdminEndpointAdminException, XMLStreamException {
   int beforeCount = endPointAdminClient.getDynamicEndpointCount();
   endPointAdminClient.addDynamicEndPoint(path, AXIOMUtil.stringToOM(ENDPOINT_XML));
   EndpointTestUtils.assertDynamicEndpointAddition(path, beforeCount, endPointAdminClient);
 }