PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 110 lines | 37 code | 17 blank | 56 comment | 0 complexity | 54dc4033bfcd15c7f2d9801d8765c044 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.ConnectMessage;
 29import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
 30import org.mobicents.protocols.ss7.isup.message.SubsequentAddressMessage;
 31import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
 32import org.mobicents.protocols.ss7.isup.message.parameter.SubsequentNumber;
 33
 34/**
 35 * @author baranowb
 36 * 
 37 */
 38public class SAM_CONTest extends SingleTimers {
 39
 40	/*
 41	 * (non-Javadoc)
 42	 * 
 43	 * @see
 44	 * org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT()
 45	 */
 46
 47	protected long getT() {
 48		return ISUPTimeoutEvent.T7_DEFAULT;
 49	}
 50
 51	/*
 52	 * (non-Javadoc)
 53	 * 
 54	 * @see
 55	 * org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT_ID()
 56	 */
 57
 58	protected int getT_ID() {
 59		return ISUPTimeoutEvent.T7;
 60	}
 61
 62	/*
 63	 * (non-Javadoc)
 64	 * 
 65	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#
 66	 * getRequest()
 67	 */
 68
 69	protected ISUPMessage getRequest() {
 70		SubsequentAddressMessage msg = super.provider.getMessageFactory().createSAM(1);
 71
 72		SubsequentNumber sn = super.provider.getParameterFactory().createSubsequentNumber();
 73		sn.setAddress("11");
 74		msg.setSubsequentNumber(sn);
 75
 76		return msg;
 77	}
 78
 79	/*
 80	 * (non-Javadoc)
 81	 * 
 82	 * @see
 83	 * org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getAnswer
 84	 * ()
 85	 */
 86
 87	protected ISUPMessage getAnswer() {
 88		ConnectMessage ans = super.provider.getMessageFactory().createCON();
 89		CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
 90		cic.setCIC(1);
 91		ans.setCircuitIdentificationCode(cic);
 92		return ans;
 93	}
 94
 95	/*
 96	 * (non-Javadoc)
 97	 * 
 98	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#
 99	 * getSpecificConfig()
100	 */
101
102	protected Properties getSpecificConfig() {
103		Properties p = new Properties();
104		p.put("t7", getT() + "");
105		p.put("ni", "2");
106		p.put("localspc", "2");
107		return p;
108	}
109
110}