PageRenderTime 63ms CodeModel.GetById 55ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 23package org.mobicents.protocols.ss7.isup.impl.stack.timers;
 24
 25import java.util.Properties;
 26
 27import org.mobicents.protocols.ss7.isup.ISUPTimeoutEvent;
 28import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
 29import org.mobicents.protocols.ss7.isup.message.UnblockingAckMessage;
 30import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
 31
 32/**
 33 * @author baranowb
 34 *
 35 */
 36public class UBLTest extends DoubleTimers {
 37	//thanks to magic of super class, this is whole test :)
 38	/* (non-Javadoc)
 39	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT()
 40	 */
 41	
 42	protected long getSmallerT() {
 43		return ISUPTimeoutEvent.T14_DEFAULT+3000;
 44	}
 45
 46	/* (non-Javadoc)
 47	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT()
 48	 */
 49	
 50	protected long getBiggerT() {
 51		return ISUPTimeoutEvent.T15_DEFAULT;
 52	}
 53
 54	/* (non-Javadoc)
 55	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT_ID()
 56	 */
 57	
 58	protected int getSmallerT_ID() {
 59		return ISUPTimeoutEvent.T14;
 60	}
 61
 62	/* (non-Javadoc)
 63	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT_ID()
 64	 */
 65	
 66	protected int getBiggerT_ID() {
 67		return ISUPTimeoutEvent.T15;
 68	}
 69
 70	/* (non-Javadoc)
 71	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getRequest()
 72	 */
 73	
 74	protected ISUPMessage getRequest() {
 75		return super.provider.getMessageFactory().createUBL(1);
 76	}
 77
 78	/* (non-Javadoc)
 79	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getAnswer()
 80	 */
 81	
 82	protected ISUPMessage getAnswer() {
 83		UnblockingAckMessage bla = super.provider.getMessageFactory().createUBA();
 84		CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
 85		cic.setCIC(1);
 86		bla.setCircuitIdentificationCode(cic);
 87		return bla;
 88	}
 89	
 90
 91	/* (non-Javadoc)
 92	 * @see org.mobicents.protocols.ss7.isup.impl.stack.EventTestHarness#getSpecificConfig()
 93	 */
 94	
 95	protected Properties getSpecificConfig() {
 96		//ensure proper values;
 97		Properties p = new Properties();
 98		p.put("t14", getSmallerT()+"");
 99		p.put("t15" , getBiggerT()+"");
100		p.put("ni", "2");
101		p.put("localspc", "2");
102		return p;
103	}
104
105}