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     */
039    public TestMediaSession(final PayloadType payloadType, final TransportCandidate remote, final TransportCandidate local,
040            final String locator, JingleSession jingleSession) {
041        super(payloadType, remote, local, "Test", jingleSession);
042        initialize();
043    }
044
045    /**
046     * Initialize the screen share channels.
047     */
048    @Override
049    public void initialize() {
050
051    }
052
053    /**
054     * Starts transmission and for NAT Traversal reasons start receiving also.
055     */
056    @Override
057    public void startTransmit() {
058
059    }
060
061    /**
062     * Set transmit activity. If the active is true, the instance should transmit.
063     * If it is set to false, the instance should pause transmit.
064     *
065     * @param active active state
066     */
067    @Override
068    public void setTransmit(boolean active) {
069
070    }
071
072    /**
073     * For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
074     */
075    @Override
076    public void startReceive() {
077        // Do nothing
078    }
079
080    /**
081     * Stops transmission and for NAT Traversal reasons stop receiving also.
082     */
083    @Override
084    public void stopTransmit() {
085
086    }
087
088    /**
089     * For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
090     */
091    @Override
092    public void stopReceive() {
093
094    }
095}