PageRenderTime 24ms CodeModel.GetById 12ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 119 lines | 51 code | 20 blank | 48 comment | 0 complexity | 9f53fde7c6f12194bc0449c69664658a 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.ReleaseCompleteMessage;
 30import org.mobicents.protocols.ss7.isup.message.ReleaseMessage;
 31import org.mobicents.protocols.ss7.isup.message.ResetCircuitMessage;
 32import org.mobicents.protocols.ss7.isup.message.parameter.CauseIndicators;
 33import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
 34
 35/**
 36 * @author baranowb
 37 *
 38 */
 39public class RELTest extends DoubleTimers {
 40	//thanks to magic of super class, this is whole test :)
 41	/* (non-Javadoc)
 42	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT()
 43	 */
 44	
 45	protected long getSmallerT() {
 46		return ISUPTimeoutEvent.T1_DEFAULT+2000;
 47	}
 48
 49	/* (non-Javadoc)
 50	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT()
 51	 */
 52	
 53	protected long getBiggerT() {
 54		return ISUPTimeoutEvent.T5_DEFAULT;
 55	}
 56
 57	/* (non-Javadoc)
 58	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getSmallerT_ID()
 59	 */
 60	
 61	protected int getSmallerT_ID() {
 62		return ISUPTimeoutEvent.T1;
 63	}
 64
 65	/* (non-Javadoc)
 66	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getBiggerT_ID()
 67	 */
 68	
 69	protected int getBiggerT_ID() {
 70		return ISUPTimeoutEvent.T5;
 71	}
 72
 73	/* (non-Javadoc)
 74	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getRequest()
 75	 */
 76	
 77	protected ISUPMessage getRequest() {
 78		ReleaseMessage rel = super.provider.getMessageFactory().createREL(1);
 79		CauseIndicators ci = super.provider.getParameterFactory().createCauseIndicators();
 80		ci.setCauseValue(0);
 81		ci.setCodingStandard(ci._CODING_STANDARD_NATIONAL);
 82		rel.setCauseIndicators(ci);
 83		return rel; 
 84	}
 85
 86	/* (non-Javadoc)
 87	 * @see org.mobicents.protocols.ss7.isup.impl.stack.DoubleTimers#getAnswer()
 88	 */
 89	
 90	protected ISUPMessage getAnswer() {
 91		ReleaseCompleteMessage rlc = super.provider.getMessageFactory().createRLC();
 92		CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
 93		cic.setCIC(1);
 94		rlc.setCircuitIdentificationCode(cic);
 95		return rlc; //asnwer to RSC is... RLC :P
 96	}
 97
 98	protected ISUPMessage getAfterBigTRequest()
 99	{
100		ResetCircuitMessage rsc = super.provider.getMessageFactory().createRSC(1);
101		return rsc;
102	}
103	
104	/* (non-Javadoc)
105	 * @see org.mobicents.protocols.ss7.isup.impl.stack.EventTestHarness#getSpecificConfig()
106	 */
107	
108	protected Properties getSpecificConfig() {
109		//ensure proper values;
110		Properties p = new Properties();
111		p.put("t1", getSmallerT()+"");
112		p.put("t5" ,  getBiggerT()+"");
113		p.put("ni", "2");
114		p.put("localspc", "2");
115		return p;
116	}	
117
118
119}