示例#1
0
  public static synchronized void start(String repository, String axis2xml) throws Exception {
    if (count == 0) {
      TestUtils.shutdownFailsafe(TESTING_PORT);
      ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);

      receiver = new SimpleHttpServerExtension(er, TESTING_PORT);

      try {
        receiver.start();
        System.out.print("Server started on port " + TESTING_PORT + ".....");
      } catch (Exception e) {
        throw new AxisFault("Error while starting the server on port " + TESTING_PORT, e);
      }

      try {
        Thread.sleep(2000);
      } catch (InterruptedException e1) {
        throw new AxisFault("Thread interuptted", e1);
      }
    }

    waitForService();

    count++;
  }
示例#2
0
  public static synchronized void start(String repository) throws Exception {
    if (count == 0) {
      TestUtils.shutdownFailsafe(TESTING_PORT);
      ConfigurationContext er = getNewConfigurationContext(repository);

      receiver = new SimpleHttpServerExtension(er, TESTING_PORT);

      try {
        receiver.start();
        ListenerManager listenerManager = er.getListenerManager();
        TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
        trsIn.setReceiver(receiver);
        if (listenerManager == null) {
          listenerManager = new ListenerManager();
          listenerManager.init(er);
        }
        listenerManager.addListener(trsIn, true);
        System.out.print("Server started on port " + TESTING_PORT + ".....");
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    try {
      Thread.sleep(2000);
    } catch (InterruptedException e1) {
      throw new AxisFault("Thread interuptted", e1);
    }

    waitForService();

    count++;
  }