1/* 2 * Copyright 2007 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16package org.mockftpserver.core.command; 17 18/** 19 * Tests for the ConnectCommandHandler class 20 * 21 * @author Chris Mair 22 * @version $Revision$ - $Date$ 23 */ 24public final class ConnectCommandHandlerTest extends AbstractCommandHandlerTestCase { 25 26 private ConnectCommandHandler commandHandler; 27 private Command command1; 28 29 public void testHandleCommand() throws Exception { 30 31 session.sendReply(ReplyCodes.CONNECT_OK, replyTextFor(ReplyCodes.CONNECT_OK)); 32 replay(session); 33 34 commandHandler.handleCommand(command1, session); 35 verify(session); 36 37 verifyNumberOfInvocations(commandHandler, 1); 38 verifyNoDataElements(commandHandler.getInvocation(0)); 39 } 40 41 protected void setUp() throws Exception { 42 super.setUp(); 43 commandHandler = new ConnectCommandHandler(); 44 commandHandler.setReplyTextBundle(replyTextBundle); 45 command1 = new Command(CommandNames.CONNECT, EMPTY); 46 } 47 48}