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

http://mobicents.googlecode.com/ · Java · 105 lines · 38 code · 19 blank · 48 comment · 0 complexity · 9ccf4fae7812a8bba61b862c1247c1d6 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.ISUPMessage;
  26. import org.mobicents.protocols.ss7.isup.message.UnblockingAckMessage;
  27. import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
  28. /**
  29. * @author baranowb
  30. *
  31. */
  32. public class UBLTest 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.T14_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.T15_DEFAULT;
  45. }
  46. /* (non-Javadoc)
  47. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT_ID()
  48. */
  49. protected int getSmallerT_ID() {
  50. return ISUPTimeoutEvent.T14;
  51. }
  52. /* (non-Javadoc)
  53. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT_ID()
  54. */
  55. protected int getBiggerT_ID() {
  56. return ISUPTimeoutEvent.T15;
  57. }
  58. /* (non-Javadoc)
  59. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getRequest()
  60. */
  61. protected ISUPMessage getRequest() {
  62. return super.provider.getMessageFactory().createUBL(1);
  63. }
  64. /* (non-Javadoc)
  65. * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getAnswer()
  66. */
  67. protected ISUPMessage getAnswer() {
  68. UnblockingAckMessage bla = super.provider.getMessageFactory().createUBA();
  69. CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
  70. cic.setCIC(1);
  71. bla.setCircuitIdentificationCode(cic);
  72. return bla;
  73. }
  74. /* (non-Javadoc)
  75. * @see org.mobicents.protocols.ss7.isup.impl.stack.EventTestHarness#getSpecificConfig()
  76. */
  77. protected Properties getSpecificConfig() {
  78. //ensure proper values;
  79. Properties p = new Properties();
  80. p.put("t14", getSmallerT()+"");
  81. p.put("t15" , getBiggerT()+"");
  82. p.put("ni", "2");
  83. p.put("localspc", "2");
  84. return p;
  85. }
  86. }