Package org.cyclopsgroup.jmxterm.cmd

Source Code of org.cyclopsgroup.jmxterm.cmd.CloseCommandTest

package org.cyclopsgroup.jmxterm.cmd;

import static org.junit.Assert.assertFalse;

import java.io.StringWriter;

import org.cyclopsgroup.jmxterm.MockSession;
import org.junit.Before;
import org.junit.Test;

/**
* Test of {@link CloseCommand}
*
* @author <a href="mailto:jiaqi.guo@gmail.com">Jiaqi Guo</a>
*/
public class CloseCommandTest
{
    private CloseCommand command;

    private StringWriter output;

    /**
     * Set up classes to test
     */
    @Before
    public void setUp()
    {
        command = new CloseCommand();
        output = new StringWriter();
    }

    /**
     * Test execution
     *
     * @throws Exception
     */
    @Test
    public void testExecute()
        throws Exception
    {
        MockSession session = new MockSession( output, null );
        command.setSession( session );
        command.execute();
        assertFalse( session.isConnected() );
    }
}
TOP

Related Classes of org.cyclopsgroup.jmxterm.cmd.CloseCommandTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.