PageRenderTime 24ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 111 lines | 52 code | 19 blank | 40 comment | 0 complexity | 3879b36c05565be0ea35a7f5983abdd1 MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
  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.InitialAddressMessage;
  28. import org.mobicents.protocols.ss7.isup.message.parameter.BackwardCallIndicators;
  29. import org.mobicents.protocols.ss7.isup.message.parameter.CalledPartyNumber;
  30. import org.mobicents.protocols.ss7.isup.message.parameter.CallingPartyCategory;
  31. import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
  32. import org.mobicents.protocols.ss7.isup.message.parameter.ForwardCallIndicators;
  33. import org.mobicents.protocols.ss7.isup.message.parameter.NatureOfConnectionIndicators;
  34. import org.mobicents.protocols.ss7.isup.message.parameter.TransmissionMediumRequirement;
  35. /**
  36. * @author baranowb
  37. *
  38. */
  39. public class IAM_ACMTest extends SingleTimers {
  40. /* (non-Javadoc)
  41. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT()
  42. */
  43. protected long getT() {
  44. return ISUPTimeoutEvent.T7_DEFAULT;
  45. }
  46. /* (non-Javadoc)
  47. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT_ID()
  48. */
  49. protected int getT_ID() {
  50. return ISUPTimeoutEvent.T7;
  51. }
  52. /* (non-Javadoc)
  53. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getRequest()
  54. */
  55. protected ISUPMessage getRequest() {
  56. InitialAddressMessage msg = super.provider.getMessageFactory().createIAM(1);
  57. NatureOfConnectionIndicators nai = super.provider.getParameterFactory().createNatureOfConnectionIndicators();
  58. ForwardCallIndicators fci = super.provider.getParameterFactory().createForwardCallIndicators();
  59. CallingPartyCategory cpg = super.provider.getParameterFactory().createCallingPartyCategory();
  60. TransmissionMediumRequirement tmr = super.provider.getParameterFactory().createTransmissionMediumRequirement();
  61. CalledPartyNumber cpn = super.provider.getParameterFactory().createCalledPartyNumber();
  62. cpn.setAddress("14614577");
  63. msg.setNatureOfConnectionIndicators(nai);
  64. msg.setForwardCallIndicators(fci);
  65. msg.setCallingPartCategory(cpg);
  66. msg.setCalledPartyNumber(cpn);
  67. msg.setTransmissionMediumRequirement(tmr);
  68. return msg;
  69. }
  70. /* (non-Javadoc)
  71. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getAnswer()
  72. */
  73. protected ISUPMessage getAnswer() {
  74. AddressCompleteMessage ans = super.provider.getMessageFactory().createACM();
  75. BackwardCallIndicators bci = super.provider.getParameterFactory().createBackwardCallIndicators();
  76. ans.setBackwardCallIndicators(bci);
  77. CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
  78. cic.setCIC(1);
  79. ans.setCircuitIdentificationCode(cic);
  80. return ans;
  81. }
  82. /* (non-Javadoc)
  83. * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getSpecificConfig()
  84. */
  85. protected Properties getSpecificConfig() {
  86. Properties p = new Properties();
  87. p.put("t7", getT()+"");
  88. p.put("ni", "2");
  89. p.put("localspc", "2");
  90. return p;
  91. }
  92. }