001/** 002 * 003 * Copyright 2003-2006 Jive Software. 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.jivesoftware.smackx.jingleold.mediaimpl.test; 018 019import org.jivesoftware.smackx.jingleold.JingleSession; 020import org.jivesoftware.smackx.jingleold.media.JingleMediaSession; 021import org.jivesoftware.smackx.jingleold.media.PayloadType; 022import org.jivesoftware.smackx.jingleold.nat.TransportCandidate; 023 024/** 025 * This Class implements a complete JingleMediaSession for unit testing. 026 * 027 * @author Thiago Camargo 028 */ 029public class TestMediaSession extends JingleMediaSession { 030 031 /** 032 * Creates a TestMediaSession with defined payload type, remote and local candidates. 033 * 034 * @param payloadType Payload of the jmf 035 * @param remote the remote information. The candidate that the jmf will be sent to. 036 * @param local the local information. The candidate that will receive the jmf 037 * @param locator media locator 038 * @param jingleSession the jingle session. 039 */ 040 public TestMediaSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local, 041 final String locator, JingleSession jingleSession) { 042 super(payloadType, remote, local, "Test", jingleSession); 043 initialize(); 044 } 045 046 /** 047 * Initialize the screen share channels. 048 */ 049 @Override 050 public void initialize() { 051 052 } 053 054 /** 055 * Starts transmission and for NAT Traversal reasons start receiving also. 056 */ 057 @Override 058 public void startTransmit() { 059 060 } 061 062 /** 063 * Set transmit activity. If the active is true, the instance should transmit. 064 * If it is set to false, the instance should pause transmit. 065 * 066 * @param active active state 067 */ 068 @Override 069 public void setTransmit(boolean active) { 070 071 } 072 073 /** 074 * For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf 075 */ 076 @Override 077 public void startReceive() { 078 // Do nothing 079 } 080 081 /** 082 * Stops transmission and for NAT Traversal reasons stop receiving also. 083 */ 084 @Override 085 public void stopTransmit() { 086 087 } 088 089 /** 090 * For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf 091 */ 092 @Override 093 public void stopReceive() { 094 095 } 096}