/protocols/ss7/isup/isup-impl/src/test/java/org/mobicents/protocols/ss7/isup/impl/stack/timers/SAM_ACMTest.java

http://mobicents.googlecode.com/ · Java · 97 lines · 40 code · 17 blank · 40 comment · 0 complexity · 322d1ef8cfb0ca6de4e0cf5dcb7d67f9 MD5 · raw file

  1. /*
  2. * JBoss, Home of Professional Open Source
  3. * Copyright 2011, Red Hat, Inc. and individual contributors
  4. * by the @authors tag. See the copyright.txt in the distribution for a
  5. * full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.mobicents.protocols.ss7.isup.impl.stack.timers;
  23. import java.util.Properties;
  24. import org.mobicents.protocols.ss7.isup.ISUPTimeoutEvent;
  25. import org.mobicents.protocols.ss7.isup.message.AddressCompleteMessage;
  26. import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
  27. import org.mobicents.protocols.ss7.isup.message.SubsequentAddressMessage;
  28. import org.mobicents.protocols.ss7.isup.message.parameter.BackwardCallIndicators;
  29. import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
  30. import org.mobicents.protocols.ss7.isup.message.parameter.SubsequentNumber;
  31. /**
  32. * @author baranowb
  33. *
  34. */
  35. public class SAM_ACMTest extends SingleTimers {
  36. /* (non-Javadoc)
  37. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT()
  38. */
  39. protected long getT() {
  40. return ISUPTimeoutEvent.T7_DEFAULT;
  41. }
  42. /* (non-Javadoc)
  43. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT_ID()
  44. */
  45. protected int getT_ID() {
  46. return ISUPTimeoutEvent.T7;
  47. }
  48. /* (non-Javadoc)
  49. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getRequest()
  50. */
  51. protected ISUPMessage getRequest() {
  52. SubsequentAddressMessage msg = super.provider.getMessageFactory().createSAM(1);
  53. SubsequentNumber sn = super.provider.getParameterFactory().createSubsequentNumber();
  54. sn.setAddress("11");
  55. msg.setSubsequentNumber(sn);
  56. return msg;
  57. }
  58. /* (non-Javadoc)
  59. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getAnswer()
  60. */
  61. protected ISUPMessage getAnswer() {
  62. AddressCompleteMessage ans = super.provider.getMessageFactory().createACM();
  63. BackwardCallIndicators bci = super.provider.getParameterFactory().createBackwardCallIndicators();
  64. ans.setBackwardCallIndicators(bci);
  65. CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
  66. cic.setCIC(1);
  67. ans.setCircuitIdentificationCode(cic);
  68. return ans;
  69. }
  70. /* (non-Javadoc)
  71. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getSpecificConfig()
  72. */
  73. protected Properties getSpecificConfig() {
  74. Properties p = new Properties();
  75. p.put("t7", getT()+"");
  76. p.put("ni", "2");
  77. p.put("localspc", "2");
  78. return p;
  79. }
  80. }