/protocols/ss7/map/map-impl/src/test/java/org/mobicents/protocols/ss7/map/functional/MAPServiceSupplementaryImplWrapper.java
Java | 58 lines | 26 code | 9 blank | 23 comment | 2 complexity | a0ec9bbad02c53b51b653175a365ff72 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.map.functional; 24 25import org.mobicents.protocols.ss7.map.MAPProviderImpl; 26import org.mobicents.protocols.ss7.map.api.MAPApplicationContext; 27import org.mobicents.protocols.ss7.map.api.dialog.ServingCheckData; 28import org.mobicents.protocols.ss7.map.api.dialog.ServingCheckResult; 29import org.mobicents.protocols.ss7.map.dialog.ServingCheckDataImpl; 30import org.mobicents.protocols.ss7.map.service.supplementary.MAPServiceSupplementaryImpl; 31import org.mobicents.protocols.ss7.tcap.asn.ApplicationContextNameImpl; 32 33public class MAPServiceSupplementaryImplWrapper extends MAPServiceSupplementaryImpl { 34 35 private int testMode = 0; 36 37 public MAPServiceSupplementaryImplWrapper(MAPProviderImpl mapProviderImpl) { 38 super(mapProviderImpl); 39 } 40 41 public ServingCheckData isServingService(MAPApplicationContext dialogApplicationContext) { 42 if(this.testMode == 1) { 43 // For reproducing FunctionalTestScenario.actionC MAPFunctionalTest 44 // - remove temporally this comment comment 45 ApplicationContextNameImpl ac = new ApplicationContextNameImpl(); 46 ac.setOid(new long[] { 1, 2, 3 }); 47 ServingCheckDataImpl i1 = new ServingCheckDataImpl(ServingCheckResult.AC_VersionIncorrect, ac); 48 return i1; 49 } 50 51 return super.isServingService(dialogApplicationContext); 52 } 53 54 public void setTestMode( int testMode ) { 55 this.testMode = testMode; 56 } 57 58}