Package org.cipango.diameter.api

Examples of org.cipango.diameter.api.DiameterServletAnswer


    {

      @Override
      public void doHandle(DiameterMessage message) throws Throwable
      {
        DiameterServletAnswer uda;
        DiameterServletRequest request = (DiameterServletRequest) message;

        assertEquals(true, message.isRequest());
        assertEquals(Sh.UDR, request.getCommand());
        assertEquals(request.getApplicationId(), Sh.SH_APPLICATION_ID.getId());
        assertEquals(request.getDestinationHost(), "server");
        uda = request.createAnswer(Common.DIAMETER_SUCCESS);
        uda.send();
      }
     
    };
    _server.setHandler(serverHandler);
    _server.start();
   
    TestDiameterHandler clientHandler = new TestDiameterHandler()
    {
     
      @Override
      public void doHandle(DiameterMessage message) throws Throwable
      {
        DiameterServletAnswer uda = (DiameterServletAnswer) message;
 
        assertFalse(message.isRequest());
        assertEquals(Sh.UDA, uda.getCommand());
        assertEquals(uda.getApplicationId(), Sh.SH_APPLICATION_ID.getId());

      }
    };
    _client.setHandler(clientHandler);
    _client.start();
View Full Code Here


    {

      @Override
      public void doHandle(DiameterMessage message) throws Throwable
      {
        DiameterServletAnswer uda;
        DiameterServletRequest request = (DiameterServletRequest) message;

        assertEquals(true, message.isRequest());
        assertEquals(Sh.UDR, request.getCommand());
        assertEquals(request.getApplicationId(), Sh.SH_APPLICATION_ID.getId());
        assertEquals(request.getDestinationHost(), "server");
        uda = request.createAnswer(Common.DIAMETER_SUCCESS);
        uda.send();
      }
     
    };
    _server.setHandler(serverHandler);
    _server.start();
   
    TestDiameterHandler clientHandler = new TestDiameterHandler()
    {
     
      @Override
      public void doHandle(DiameterMessage message) throws Throwable
      {
        DiameterServletAnswer uda = (DiameterServletAnswer) message;
 
        assertFalse(message.isRequest());
        assertEquals(Sh.UDA, uda.getCommand());
        assertEquals(uda.getApplicationId(), Sh.SH_APPLICATION_ID.getId());

      }
    };
    _client.setHandler(clientHandler);
    _client.start();
View Full Code Here

          assertEquals(_sessionId, message.getSessionId());
          assertEquals(_session, message.getSession());
        }
        else
        {
          DiameterServletAnswer sna;
          DiameterServletRequest request = (DiameterServletRequest) message;
 
          assertEquals(true, message.isRequest());
          assertEquals(Sh.SNR, request.getCommand());
          assertEquals(request.getApplicationId(), Sh.SH_APPLICATION_ID.getId());
          assertEquals(request.getDestinationHost(), "server");
          sna = request.createAnswer(Common.DIAMETER_SUCCESS);
          _sessionId = request.getSessionId();
          assertNotNull(_sessionId);
          _session = request.getSession();
          assertNotNull(_session);
          sna.send();
         
          Thread.sleep(50);
          DiameterServletRequest pnr = _session.createRequest(Sh.PNR, true);
          pnr.send();
        }
      }
     
    };
    _server.setHandler(serverHandler);
    _server.start();
   
    TestDiameterHandler clientHandler = new TestDiameterHandler()
    {
      private String _sessionId;
      private DiameterSession _session;
     
      @Override
      public void doHandle(DiameterMessage message) throws Throwable
      {
        if (message instanceof DiameterServletAnswer)
        {
          DiameterServletAnswer sna = (DiameterServletAnswer) message;
          assertEquals(Sh.SNA, sna.getCommand());
          assertEquals(sna.getApplicationId(), Sh.SH_APPLICATION_ID.getId());
          _sessionId = sna.getSessionId();
          _session = sna.getSession();
          assertNotNull(_sessionId);
          assertNotNull(_session);
          assertEquals(_sessionId, sna.getRequest().getSessionId());
        }
        else
        {
          DiameterServletRequest pnr = (DiameterServletRequest) message;
          assertEquals(Sh.PNR, pnr.getCommand());
View Full Code Here

TOP

Related Classes of org.cipango.diameter.api.DiameterServletAnswer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.