PageRenderTime 57ms CodeModel.GetById 49ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 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.BlockingAckMessage;
 29import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
 30import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
 31
 32/**
 33 * @author baranowb
 34 *
 35 */
 36public class BLOTest 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	protected long getSmallerT() {
 42		return ISUPTimeoutEvent.T12_DEFAULT+3000;
 43	}
 44
 45	/* (non-Javadoc)
 46	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT()
 47	 */
 48	
 49	protected long getBiggerT() {
 50		return ISUPTimeoutEvent.T13_DEFAULT;
 51		//return 40000;
 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.T12;
 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.T13;
 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().createBLO(1);
 76	}
 77
 78	/* (non-Javadoc)
 79	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getAnswer()
 80	 */
 81	
 82	protected ISUPMessage getAnswer() {
 83		BlockingAckMessage bla = super.provider.getMessageFactory().createBLA();
 84		CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
 85		cic.setCIC(1);
 86		bla.setCircuitIdentificationCode(cic);
 87		return bla;
 88	}
 89
 90	/* (non-Javadoc)
 91	 * @see org.mobicents.protocols.ss7.isup.impl.stack.EventTestHarness#getSpecificConfig()
 92	 */
 93	
 94	protected Properties getSpecificConfig() {
 95		//ensure proper values;
 96		Properties p = new Properties();
 97		p.put("t12", getSmallerT()+"");
 98		p.put("t13" ,  getBiggerT()+"");
 99		p.put("ni", "2");
100		p.put("localspc", "2");
101		return p;
102	}
103	
104	
105	
106}