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

http://mobicents.googlecode.com/ · Java · 110 lines · 37 code · 17 blank · 56 comment · 0 complexity · 54dc4033bfcd15c7f2d9801d8765c044 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.ConnectMessage;
  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.CircuitIdentificationCode;
  29. import org.mobicents.protocols.ss7.isup.message.parameter.SubsequentNumber;
  30. /**
  31. * @author baranowb
  32. *
  33. */
  34. public class SAM_CONTest extends SingleTimers {
  35. /*
  36. * (non-Javadoc)
  37. *
  38. * @see
  39. * org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT()
  40. */
  41. protected long getT() {
  42. return ISUPTimeoutEvent.T7_DEFAULT;
  43. }
  44. /*
  45. * (non-Javadoc)
  46. *
  47. * @see
  48. * org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT_ID()
  49. */
  50. protected int getT_ID() {
  51. return ISUPTimeoutEvent.T7;
  52. }
  53. /*
  54. * (non-Javadoc)
  55. *
  56. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#
  57. * getRequest()
  58. */
  59. protected ISUPMessage getRequest() {
  60. SubsequentAddressMessage msg = super.provider.getMessageFactory().createSAM(1);
  61. SubsequentNumber sn = super.provider.getParameterFactory().createSubsequentNumber();
  62. sn.setAddress("11");
  63. msg.setSubsequentNumber(sn);
  64. return msg;
  65. }
  66. /*
  67. * (non-Javadoc)
  68. *
  69. * @see
  70. * org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getAnswer
  71. * ()
  72. */
  73. protected ISUPMessage getAnswer() {
  74. ConnectMessage ans = super.provider.getMessageFactory().createCON();
  75. CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
  76. cic.setCIC(1);
  77. ans.setCircuitIdentificationCode(cic);
  78. return ans;
  79. }
  80. /*
  81. * (non-Javadoc)
  82. *
  83. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#
  84. * getSpecificConfig()
  85. */
  86. protected Properties getSpecificConfig() {
  87. Properties p = new Properties();
  88. p.put("t7", getT() + "");
  89. p.put("ni", "2");
  90. p.put("localspc", "2");
  91. return p;
  92. }
  93. }