PageRenderTime 29ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/protocols/ss7/isup/isup-impl/src/test/java/org/mobicents/protocols/ss7/isup/impl/message/parameter/GenericNotificationIndicatorTest.java

http://mobicents.googlecode.com/
Java | 81 lines | 29 code | 9 blank | 43 comment | 0 complexity | b0c78595733a937b20b582c9898eba73 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. /**
  23. * Start time:11:34:01 2009-04-24<br>
  24. * Project: mobicents-isup-stack<br>
  25. *
  26. * @author <a href="mailto:baranowb@gmail.com">Bartosz Baranowski
  27. * </a>
  28. *
  29. */
  30. package org.mobicents.protocols.ss7.isup.impl.message.parameter;
  31. import java.io.IOException;
  32. import java.util.Arrays;
  33. import org.mobicents.protocols.ss7.isup.ParameterException;
  34. import org.testng.annotations.Test;
  35. import static org.testng.Assert.*;
  36. import org.testng.*;
  37. import org.testng.annotations.*;
  38. /**
  39. * Start time:11:34:01 2009-04-24<br>
  40. * Project: mobicents-isup-stack<br>
  41. *
  42. * @author <a href="mailto:baranowb@gmail.com">Bartosz Baranowski
  43. * </a>
  44. */
  45. public class GenericNotificationIndicatorTest extends ParameterHarness {
  46. public GenericNotificationIndicatorTest() {
  47. super();
  48. super.goodBodies.add(new byte[] { 67, 12, 13, 14, 15, 16, 17, (byte) (18 | (0x01 << 7)) });
  49. super.badBodies.add(new byte[1]);
  50. }
  51. private byte[] getBody() {
  52. return super.goodBodies.get(0);
  53. }
  54. @Test(groups = { "functional.encode","functional.decode","parameter"})
  55. public void testBody1EncodedValues() throws IOException, ParameterException {
  56. GenericNotificationIndicatorImpl eci = new GenericNotificationIndicatorImpl(getBody());
  57. byte[] body = getBody();
  58. byte[] encoded = eci.encode();
  59. boolean equal = Arrays.equals(body, encoded);
  60. assertTrue(equal,"Body index: \n" + makeCompare(body, encoded));
  61. }
  62. /*
  63. * (non-Javadoc)
  64. *
  65. * @see
  66. * org.mobicents.isup.messages.parameters.ParameterHarness#getTestedComponent
  67. * ()
  68. */
  69. public AbstractISUPParameter getTestedComponent() throws ParameterException {
  70. return new GenericNotificationIndicatorImpl(new byte[2]);
  71. }
  72. }