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

http://mobicents.googlecode.com/ · Java · 106 lines · 38 code · 19 blank · 49 comment · 0 complexity · e9f4c66e432a978090a5708c45291ce7 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.BlockingAckMessage;
  26. import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
  27. import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
  28. /**
  29. * @author baranowb
  30. *
  31. */
  32. public class BLOTest extends DoubleTimers {
  33. //thanks to magic of super class, this is whole test :)
  34. /* (non-Javadoc)
  35. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT()
  36. */
  37. protected long getSmallerT() {
  38. return ISUPTimeoutEvent.T12_DEFAULT+3000;
  39. }
  40. /* (non-Javadoc)
  41. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT()
  42. */
  43. protected long getBiggerT() {
  44. return ISUPTimeoutEvent.T13_DEFAULT;
  45. //return 40000;
  46. }
  47. /* (non-Javadoc)
  48. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT_ID()
  49. */
  50. protected int getSmallerT_ID() {
  51. return ISUPTimeoutEvent.T12;
  52. }
  53. /* (non-Javadoc)
  54. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT_ID()
  55. */
  56. protected int getBiggerT_ID() {
  57. return ISUPTimeoutEvent.T13;
  58. }
  59. /* (non-Javadoc)
  60. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getRequest()
  61. */
  62. protected ISUPMessage getRequest() {
  63. return super.provider.getMessageFactory().createBLO(1);
  64. }
  65. /* (non-Javadoc)
  66. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getAnswer()
  67. */
  68. protected ISUPMessage getAnswer() {
  69. BlockingAckMessage bla = super.provider.getMessageFactory().createBLA();
  70. CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
  71. cic.setCIC(1);
  72. bla.setCircuitIdentificationCode(cic);
  73. return bla;
  74. }
  75. /* (non-Javadoc)
  76. * @see org.mobicents.protocols.ss7.isup.impl.stack.EventTestHarness#getSpecificConfig()
  77. */
  78. protected Properties getSpecificConfig() {
  79. //ensure proper values;
  80. Properties p = new Properties();
  81. p.put("t12", getSmallerT()+"");
  82. p.put("t13" , getBiggerT()+"");
  83. p.put("ni", "2");
  84. p.put("localspc", "2");
  85. return p;
  86. }
  87. }