PageRenderTime 27ms CodeModel.GetById 16ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 111 lines | 52 code | 19 blank | 40 comment | 0 complexity | 3879b36c05565be0ea35a7f5983abdd1 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.AddressCompleteMessage;
 29import org.mobicents.protocols.ss7.isup.message.ISUPMessage;
 30import org.mobicents.protocols.ss7.isup.message.InitialAddressMessage;
 31import org.mobicents.protocols.ss7.isup.message.parameter.BackwardCallIndicators;
 32import org.mobicents.protocols.ss7.isup.message.parameter.CalledPartyNumber;
 33import org.mobicents.protocols.ss7.isup.message.parameter.CallingPartyCategory;
 34import org.mobicents.protocols.ss7.isup.message.parameter.CircuitIdentificationCode;
 35import org.mobicents.protocols.ss7.isup.message.parameter.ForwardCallIndicators;
 36import org.mobicents.protocols.ss7.isup.message.parameter.NatureOfConnectionIndicators;
 37import org.mobicents.protocols.ss7.isup.message.parameter.TransmissionMediumRequirement;
 38
 39/**
 40 * @author baranowb
 41 *
 42 */
 43public class IAM_ACMTest extends SingleTimers {
 44
 45	/* (non-Javadoc)
 46	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT()
 47	 */
 48	
 49	protected long getT() {
 50		return ISUPTimeoutEvent.T7_DEFAULT;
 51	}
 52
 53	/* (non-Javadoc)
 54	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.SingleTimers#getT_ID()
 55	 */
 56	
 57	protected int getT_ID() {
 58		return ISUPTimeoutEvent.T7;
 59	}
 60
 61	/* (non-Javadoc)
 62	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getRequest()
 63	 */
 64	
 65	protected ISUPMessage getRequest() {
 66		InitialAddressMessage msg = super.provider.getMessageFactory().createIAM(1);
 67		NatureOfConnectionIndicators nai = super.provider.getParameterFactory().createNatureOfConnectionIndicators();
 68		ForwardCallIndicators fci = super.provider.getParameterFactory().createForwardCallIndicators();
 69		CallingPartyCategory cpg = super.provider.getParameterFactory().createCallingPartyCategory();
 70		TransmissionMediumRequirement tmr = super.provider.getParameterFactory().createTransmissionMediumRequirement();
 71		CalledPartyNumber cpn = super.provider.getParameterFactory().createCalledPartyNumber();
 72		cpn.setAddress("14614577");
 73		
 74		
 75		msg.setNatureOfConnectionIndicators(nai);
 76		msg.setForwardCallIndicators(fci);
 77		msg.setCallingPartCategory(cpg);
 78		msg.setCalledPartyNumber(cpn);
 79		msg.setTransmissionMediumRequirement(tmr);
 80	
 81		
 82		return msg;
 83	}
 84
 85	/* (non-Javadoc)
 86	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getAnswer()
 87	 */
 88	
 89	protected ISUPMessage getAnswer() {
 90		AddressCompleteMessage ans = super.provider.getMessageFactory().createACM();
 91		BackwardCallIndicators bci = super.provider.getParameterFactory().createBackwardCallIndicators();
 92		ans.setBackwardCallIndicators(bci);
 93		CircuitIdentificationCode cic = super.provider.getParameterFactory().createCircuitIdentificationCode();
 94		cic.setCIC(1);
 95		ans.setCircuitIdentificationCode(cic);
 96		return ans;
 97	}
 98
 99	/* (non-Javadoc)
100	 * @see org.mobicents.protocols.ss7.isup.impl.stack.timers.EventTestHarness#getSpecificConfig()
101	 */
102	
103	protected Properties getSpecificConfig() {
104		Properties p = new Properties();
105		p.put("t7", getT()+"");
106		p.put("ni", "2");
107		p.put("localspc", "2");
108		return p;
109	}
110
111}